From 06668205512d9ccefaaa74db6ec7bcee11fd4f56 Mon Sep 17 00:00:00 2001 From: FernandoAscencio Date: Wed, 11 Jan 2023 16:04:20 -0500 Subject: [PATCH 1/6] plugin: --- packages/debug/src/browser/view/debug-watch-expression.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/debug/src/browser/view/debug-watch-expression.tsx b/packages/debug/src/browser/view/debug-watch-expression.tsx index ab21689aae14a..c826613e0e869 100644 --- a/packages/debug/src/browser/view/debug-watch-expression.tsx +++ b/packages/debug/src/browser/view/debug-watch-expression.tsx @@ -62,7 +62,7 @@ export class DebugWatchExpression extends ExpressionItem { async open(): Promise { const input = new SingleTextInputDialog({ - title: 'Edit Watch Expression', + title: nls.localizeByDefault('Edit Expression'), initialValue: this.expression }); const newValue = await input.open(); From 59892d5e0b6ce7499817d1577f98264029915d3b Mon Sep 17 00:00:00 2001 From: FernandoAscencio Date: Wed, 11 Jan 2023 17:18:36 -0500 Subject: [PATCH 2/6] packages: localization fix title focus The commit fixes six localization bugs related titles of windows and messages. Signed-off-by: FernandoAscencio --- .../debug/src/browser/console/debug-console-items.tsx | 3 ++- .../filesystem/src/browser/file-tree/file-tree-model.ts | 9 +++++---- packages/git/src/browser/git-scm-provider.ts | 4 ++-- packages/plugin-ext/src/main/browser/commands.ts | 2 +- packages/plugin-ext/src/main/browser/dialogs-main.ts | 3 ++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/debug/src/browser/console/debug-console-items.tsx b/packages/debug/src/browser/console/debug-console-items.tsx index ff21c14ff00e9..79fc0dd20398f 100644 --- a/packages/debug/src/browser/console/debug-console-items.tsx +++ b/packages/debug/src/browser/console/debug-console-items.tsx @@ -21,6 +21,7 @@ import { ConsoleItem, CompositeConsoleItem } from '@theia/console/lib/browser/co import { DebugSession } from '../debug-session'; import { Severity } from '@theia/core/lib/common/severity'; import * as monaco from '@theia/monaco-editor-core'; +import { nls } from '@theia/core'; export type DebugSessionProvider = () => DebugSession | undefined; @@ -237,7 +238,7 @@ export class DebugVariable extends ExpressionContainer { return; } const input = new SingleTextInputDialog({ - title: `Set ${this.name} Value`, + title: nls.localize('theia/debug/debugVariableInput', 'Set {0} Value', this.name), initialValue: this.value }); const newValue = await input.open(); diff --git a/packages/filesystem/src/browser/file-tree/file-tree-model.ts b/packages/filesystem/src/browser/file-tree/file-tree-model.ts index 108aaa9be260f..e710e62c169f1 100644 --- a/packages/filesystem/src/browser/file-tree/file-tree-model.ts +++ b/packages/filesystem/src/browser/file-tree/file-tree-model.ts @@ -25,6 +25,7 @@ import { FileOperationError, FileOperationResult, FileChangesEvent, FileChangeTy import { MessageService } from '@theia/core/lib/common/message-service'; import { EnvVariablesServer } from '@theia/core/lib/common/env-variables'; import { FileSystemUtils } from '../../common'; +import { nls } from '@theia/core'; @injectable() export class FileTreeModel extends CompressedTreeModel implements LocationService { @@ -200,10 +201,10 @@ export class FileTreeModel extends CompressedTreeModel implements LocationServic protected async shouldReplace(fileName: string): Promise { const dialog = new ConfirmDialog({ - title: 'Replace file', - msg: `File '${fileName}' already exists in the destination folder. Do you want to replace it?`, - ok: 'Yes', - cancel: 'No' + title: nls.localize('theia/filesystem/replaceTitle', 'Replace file'), + msg: nls.localize('theia/filesystem/fileVariableInput', 'File \'{0}\' already exists in the destination folder. Do you want to replace it?', fileName), + ok: nls.localizeByDefault('Yes'), + cancel: nls.localizeByDefault('No') }); return !!await dialog.open(); } diff --git a/packages/git/src/browser/git-scm-provider.ts b/packages/git/src/browser/git-scm-provider.ts index ef18a95022d0b..d65a61dab3d18 100644 --- a/packages/git/src/browser/git-scm-provider.ts +++ b/packages/git/src/browser/git-scm-provider.ts @@ -415,14 +415,14 @@ export class GitScmProvider implements ScmProvider { fileText = `${paths.length} files`; } return new ConfirmDialog({ - title: 'Discard changes', + title: nls.localize('theia/git/replaceConfirmDiscardTitle', 'Discard changes'), msg: nls.localize('vscode.git/commands/confirm discard', 'Do you really want to discard changes in {0}?', fileText) }).open(); } protected confirmAll(): Promise { return new ConfirmDialog({ - title: 'Discard All Changes', + title: nls.localize('theia/git/replaceConfirmDiscardAllTitle', 'Discard All Changes'), msg: nls.localize('vscode.git/commands/confirm discard all', 'Do you really want to discard all changes?') }).open(); } diff --git a/packages/plugin-ext/src/main/browser/commands.ts b/packages/plugin-ext/src/main/browser/commands.ts index 41b76340e8b8a..601484cf5c6a3 100644 --- a/packages/plugin-ext/src/main/browser/commands.ts +++ b/packages/plugin-ext/src/main/browser/commands.ts @@ -71,7 +71,7 @@ class OpenNewTabDialog extends AbstractDialog { constructor(windowService: WindowService) { super({ - title: 'Your browser prevented opening of a new tab' + title: nls.localize('theia/plugin/blockNewTab', 'Your browser prevented opening of a new tab') }); this.windowService = windowService; diff --git a/packages/plugin-ext/src/main/browser/dialogs-main.ts b/packages/plugin-ext/src/main/browser/dialogs-main.ts index 4519f3f8677ff..501bd7618a9a8 100644 --- a/packages/plugin-ext/src/main/browser/dialogs-main.ts +++ b/packages/plugin-ext/src/main/browser/dialogs-main.ts @@ -24,6 +24,7 @@ import { FileUploadService } from '@theia/filesystem/lib/browser/file-upload-ser import { FileService } from '@theia/filesystem/lib/browser/file-service'; import { FileStat } from '@theia/filesystem/lib/common/files'; import { EnvVariablesServer } from '@theia/core/lib/common/env-variables'; +import { nls } from '@theia/core'; export class DialogsMainImpl implements DialogsMain { @@ -146,7 +147,7 @@ export class DialogsMainImpl implements DialogsMain { try { // Create save file dialog props const dialogProps = { - title: options.title ?? 'Save', + title: options.title ?? nls.localizeByDefault('Save'), saveLabel: options.saveLabel, filters: options.filters, inputValue: fileNameValue From 92b90a348e742f9c61ec29b21728a7f308530504 Mon Sep 17 00:00:00 2001 From: FernandoAscencio Date: Thu, 12 Jan 2023 11:34:03 -0500 Subject: [PATCH 3/6] packages: localization title fix Corrections to the previous localization title fix as suggested in the Reviews Signed-off-by: FernandoAscencio --- .../filesystem/src/browser/file-tree/file-tree-model.ts | 8 ++++---- packages/git/src/browser/git-scm-provider.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/filesystem/src/browser/file-tree/file-tree-model.ts b/packages/filesystem/src/browser/file-tree/file-tree-model.ts index e710e62c169f1..dfe406d380857 100644 --- a/packages/filesystem/src/browser/file-tree/file-tree-model.ts +++ b/packages/filesystem/src/browser/file-tree/file-tree-model.ts @@ -16,7 +16,7 @@ import { injectable, inject, postConstruct } from '@theia/core/shared/inversify'; import URI from '@theia/core/lib/common/uri'; -import { CompositeTreeNode, TreeNode, ConfirmDialog, CompressedTreeModel } from '@theia/core/lib/browser'; +import { CompositeTreeNode, TreeNode, ConfirmDialog, CompressedTreeModel, Dialog } from '@theia/core/lib/browser'; import { FileStatNode, DirNode, FileNode } from './file-tree'; import { LocationService } from '../location'; import { LabelProvider } from '@theia/core/lib/browser/label-provider'; @@ -202,9 +202,9 @@ export class FileTreeModel extends CompressedTreeModel implements LocationServic protected async shouldReplace(fileName: string): Promise { const dialog = new ConfirmDialog({ title: nls.localize('theia/filesystem/replaceTitle', 'Replace file'), - msg: nls.localize('theia/filesystem/fileVariableInput', 'File \'{0}\' already exists in the destination folder. Do you want to replace it?', fileName), - ok: nls.localizeByDefault('Yes'), - cancel: nls.localizeByDefault('No') + msg: nls.localizeByDefault('{0} already exists. Are you sure you want to overwrite it?', fileName), + ok: Dialog.YES, + cancel: Dialog.NO }); return !!await dialog.open(); } diff --git a/packages/git/src/browser/git-scm-provider.ts b/packages/git/src/browser/git-scm-provider.ts index d65a61dab3d18..310effb643c68 100644 --- a/packages/git/src/browser/git-scm-provider.ts +++ b/packages/git/src/browser/git-scm-provider.ts @@ -415,14 +415,14 @@ export class GitScmProvider implements ScmProvider { fileText = `${paths.length} files`; } return new ConfirmDialog({ - title: nls.localize('theia/git/replaceConfirmDiscardTitle', 'Discard changes'), + title: nls.localize('vscode.git/package/command.clean', 'Discard changes'), msg: nls.localize('vscode.git/commands/confirm discard', 'Do you really want to discard changes in {0}?', fileText) }).open(); } protected confirmAll(): Promise { return new ConfirmDialog({ - title: nls.localize('theia/git/replaceConfirmDiscardAllTitle', 'Discard All Changes'), + title: nls.localize('vscode.git/package/command.cleanAll', 'Discard All Changes'), msg: nls.localize('vscode.git/commands/confirm discard all', 'Do you really want to discard all changes?') }).open(); } From 386ec225717dde8de2a9990e3b77f8f3b5f22e8d Mon Sep 17 00:00:00 2001 From: FernandoAscencio Date: Thu, 12 Jan 2023 11:53:14 -0500 Subject: [PATCH 4/6] packages: title localization fix Another review correction Signed-off-by: FernandoAscencio --- packages/filesystem/src/browser/file-tree/file-tree-model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/filesystem/src/browser/file-tree/file-tree-model.ts b/packages/filesystem/src/browser/file-tree/file-tree-model.ts index dfe406d380857..69a21f2644b45 100644 --- a/packages/filesystem/src/browser/file-tree/file-tree-model.ts +++ b/packages/filesystem/src/browser/file-tree/file-tree-model.ts @@ -201,7 +201,7 @@ export class FileTreeModel extends CompressedTreeModel implements LocationServic protected async shouldReplace(fileName: string): Promise { const dialog = new ConfirmDialog({ - title: nls.localize('theia/filesystem/replaceTitle', 'Replace file'), + title: nls.localize('theia/filesystem/replaceTitle', 'Replace File'), msg: nls.localizeByDefault('{0} already exists. Are you sure you want to overwrite it?', fileName), ok: Dialog.YES, cancel: Dialog.NO From 89ebd45ef71da4eee934e48678887451436775f4 Mon Sep 17 00:00:00 2001 From: FernandoAscencio <48699277+FernandoAscencio@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:01:57 -0500 Subject: [PATCH 5/6] Update packages/git/src/browser/git-scm-provider.ts Co-authored-by: Vincent Fugnitto --- packages/git/src/browser/git-scm-provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/git/src/browser/git-scm-provider.ts b/packages/git/src/browser/git-scm-provider.ts index 310effb643c68..86836561e7a3c 100644 --- a/packages/git/src/browser/git-scm-provider.ts +++ b/packages/git/src/browser/git-scm-provider.ts @@ -415,7 +415,7 @@ export class GitScmProvider implements ScmProvider { fileText = `${paths.length} files`; } return new ConfirmDialog({ - title: nls.localize('vscode.git/package/command.clean', 'Discard changes'), + title: nls.localize('vscode.git/package/command.clean', 'Discard Changes'), msg: nls.localize('vscode.git/commands/confirm discard', 'Do you really want to discard changes in {0}?', fileText) }).open(); } From 9e4a502c509beb8b5db0fd65d3e048ef45f07ad0 Mon Sep 17 00:00:00 2001 From: FernandoAscencio Date: Mon, 16 Jan 2023 09:03:37 -0500 Subject: [PATCH 6/6] packages: title localization fix The commit fixes six localization bugs related titles of windows and messages. Signed-off-by: FernandoAscencio --- packages/git/src/browser/git-scm-provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/git/src/browser/git-scm-provider.ts b/packages/git/src/browser/git-scm-provider.ts index 310effb643c68..86836561e7a3c 100644 --- a/packages/git/src/browser/git-scm-provider.ts +++ b/packages/git/src/browser/git-scm-provider.ts @@ -415,7 +415,7 @@ export class GitScmProvider implements ScmProvider { fileText = `${paths.length} files`; } return new ConfirmDialog({ - title: nls.localize('vscode.git/package/command.clean', 'Discard changes'), + title: nls.localize('vscode.git/package/command.clean', 'Discard Changes'), msg: nls.localize('vscode.git/commands/confirm discard', 'Do you really want to discard changes in {0}?', fileText) }).open(); }