Skip to content

Commit

Permalink
packages: localization fix title focus
Browse files Browse the repository at this point in the history
The commit fixes six localization bugs related titles of windows and messages.

Signed-off-by: FernandoAscencio <[email protected]>
  • Loading branch information
FernandoAscencio committed Jan 11, 2023
1 parent a39c21c commit aa0623e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/debug/src/browser/console/debug-console-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand Down
9 changes: 5 additions & 4 deletions packages/filesystem/src/browser/file-tree/file-tree-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -200,10 +201,10 @@ export class FileTreeModel extends CompressedTreeModel implements LocationServic

protected async shouldReplace(fileName: string): Promise<boolean> {
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();
}
Expand Down
4 changes: 2 additions & 2 deletions packages/git/src/browser/git-scm-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean | undefined> {
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();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/main/browser/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class OpenNewTabDialog extends AbstractDialog<string> {

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;

Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-ext/src/main/browser/dialogs-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aa0623e

Please sign in to comment.