From 802af701c3f204ef0f6a471b9ef2aefc687308ae Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Sun, 24 Oct 2021 13:10:38 +0000 Subject: [PATCH] Use `localizeByDefault` across the codebase --- .../src/browser/bulk-edit-contribution.ts | 4 +- .../bulk-edit-tree/bulk-edit-tree-widget.tsx | 4 +- .../src/browser/console-contribution.ts | 4 +- .../browser/common-frontend-contribution.ts | 128 ++--- packages/core/src/browser/core-preferences.ts | 45 +- packages/core/src/browser/dialogs.ts | 8 +- .../browser-keyboard-frontend-contribution.ts | 4 +- .../quick-command-frontend-contribution.ts | 2 +- .../quick-input/quick-command-service.ts | 4 +- .../src/browser/shell/tab-bar-toolbar.tsx | 2 +- .../core/src/browser/window-contribution.ts | 4 +- packages/core/src/common/command.ts | 10 + packages/core/src/common/i18n/localization.ts | 14 +- packages/core/src/common/nls.ts | 23 +- .../menu/electron-menu-contribution.ts | 34 +- .../window/electron-window-preferences.ts | 4 +- .../console/debug-console-contribution.tsx | 7 +- ...debug-frontend-application-contribution.ts | 155 ++--- .../debug/src/browser/debug-preferences.ts | 14 +- .../src/browser/debug-prefix-configuration.ts | 6 +- .../model/debug-function-breakpoint.tsx | 7 +- .../browser/preferences/launch-preferences.ts | 5 +- .../browser/view/debug-breakpoints-widget.ts | 2 +- .../view/debug-configuration-widget.tsx | 10 +- .../browser/view/debug-stack-frames-widget.ts | 2 +- .../src/browser/view/debug-toolbar-widget.tsx | 16 +- .../browser/view/debug-variables-widget.ts | 2 +- .../src/browser/view/debug-watch-widget.ts | 2 +- .../debug/src/browser/view/debug-widget.ts | 2 +- .../browser/editor-preview-contribution.ts | 6 +- .../src/browser/editor-preview-preferences.ts | 3 +- packages/editor/src/browser/editor-command.ts | 106 ++-- .../editor/src/browser/editor-contribution.ts | 6 +- packages/editor/src/browser/editor-menu.ts | 6 +- .../editor/src/browser/editor-preferences.ts | 541 +++++++++--------- .../external-terminal-contribution.ts | 4 +- .../external-terminal-preference.ts | 6 +- .../browser/quick-file-open-contribution.ts | 2 +- .../src/browser/quick-file-open.ts | 4 +- .../file-download-command-contribution.ts | 4 +- .../src/browser/file-upload-service.ts | 6 +- .../src/browser/filesystem-preferences.ts | 24 +- .../src/browser/getting-started-widget.tsx | 30 +- .../src/browser/diff/git-diff-contribution.ts | 25 +- packages/git/src/browser/git-contribution.ts | 2 +- .../browser/keymaps-frontend-contribution.ts | 12 +- .../browser/problem/problem-contribution.ts | 14 +- .../browser/problem/problem-preferences.ts | 4 +- .../src/browser/problem/problem-widget.tsx | 2 +- .../browser/notification-center-component.tsx | 8 +- .../src/browser/notification-component.tsx | 2 +- .../src/browser/notifications-commands.ts | 16 +- .../src/browser/notifications-contribution.ts | 8 +- .../src/browser/mini-browser-open-handler.ts | 14 +- packages/monaco/src/browser/monaco-command.ts | 8 +- packages/monaco/src/browser/monaco-menu.ts | 10 +- .../browser/monaco-status-bar-contribution.ts | 10 +- .../src/browser/workspace-symbol-command.ts | 6 +- .../src/browser/navigator-contribution.ts | 24 +- .../navigator/src/browser/navigator-diff.ts | 9 +- .../src/browser/navigator-preferences.ts | 2 +- .../src/browser/navigator-widget-factory.ts | 2 +- .../src/browser/navigator-widget.tsx | 4 +- .../navigator-open-editors-commands.ts | 18 +- .../navigator-open-editors-widget.tsx | 2 +- .../src/browser/outline-view-contribution.ts | 2 +- .../src/browser/outline-view-widget.tsx | 4 +- .../output/src/browser/output-commands.ts | 4 +- .../output/src/browser/output-contribution.ts | 6 +- .../browser/output-toolbar-contribution.tsx | 6 +- packages/output/src/browser/output-widget.ts | 2 +- .../plugin-vscode-commands-contribution.ts | 4 +- .../src/browser/util/preference-types.ts | 36 +- .../views/preference-scope-tabbar-widget.tsx | 6 +- .../views/preference-searchbar-widget.tsx | 10 +- .../src/browser/views/preference-widget.tsx | 2 +- .../src/browser/preview-contribution.ts | 6 +- .../resource-property-view-tree-widget.tsx | 4 +- .../browser/history/scm-history-widget.tsx | 2 +- packages/scm/src/browser/scm-contribution.ts | 18 +- .../src/browser/scm-no-repository-widget.tsx | 2 +- packages/scm/src/browser/scm-preferences.ts | 6 +- packages/scm/src/browser/scm-widget.tsx | 2 +- ...arch-in-workspace-frontend-contribution.ts | 31 +- .../search-in-workspace-preferences.ts | 10 +- ...search-in-workspace-result-tree-widget.tsx | 22 +- .../browser/search-in-workspace-widget.tsx | 36 +- .../src/browser/task-frontend-contribution.ts | 46 +- .../browser/terminal-frontend-contribution.ts | 75 ++- .../src/browser/terminal-preferences.ts | 40 +- .../browser/terminal-quick-open-service.ts | 6 +- .../src/browser/terminal-widget-impl.ts | 4 +- .../src/browser/vsx-extension-commands.ts | 19 +- .../browser/vsx-extensions-view-container.ts | 4 +- .../src/browser/vsx-extensions-widget.ts | 6 +- .../src/browser/workspace-commands.ts | 77 ++- .../workspace-frontend-contribution.ts | 4 +- 97 files changed, 1004 insertions(+), 972 deletions(-) diff --git a/packages/bulk-edit/src/browser/bulk-edit-contribution.ts b/packages/bulk-edit/src/browser/bulk-edit-contribution.ts index 35c63990e56b7..145215bcb1082 100644 --- a/packages/bulk-edit/src/browser/bulk-edit-contribution.ts +++ b/packages/bulk-edit/src/browser/bulk-edit-contribution.ts @@ -63,13 +63,13 @@ export class BulkEditContribution extends AbstractViewContribution 0) { return super.renderTree(model); } - return
{nls.localize('vscode/bulkEditService/nothing', 'No edits have been detected in the workspace so far.')}
; + return
{nls.localizeByDefault('No edits have been detected in the workspace so far.')}
; } protected renderCaption(node: TreeNode, props: NodeProps): React.ReactNode { diff --git a/packages/console/src/browser/console-contribution.ts b/packages/console/src/browser/console-contribution.ts index 74b993ae3b444..8012cb307627d 100644 --- a/packages/console/src/browser/console-contribution.ts +++ b/packages/console/src/browser/console-contribution.ts @@ -102,12 +102,12 @@ export class ConsoleContribution implements FrontendApplicationContribution, Com }); menus.registerMenuAction(ConsoleContextMenu.CLIPBOARD, { commandId: ConsoleCommands.COLLAPSE_ALL.id, - label: nls.localize('vscode/repl/collapse', 'Collapse All'), + label: nls.localizeByDefault('Collapse All'), order: 'a3' }); menus.registerMenuAction(ConsoleContextMenu.CLEAR, { commandId: ConsoleCommands.CLEAR.id, - label: nls.localize('vscode/repl/clearRepl', 'Clear Console') + label: nls.localizeByDefault('Clear Console') }); } diff --git a/packages/core/src/browser/common-frontend-contribution.ts b/packages/core/src/browser/common-frontend-contribution.ts index e30a0b7c4a126..2a7cff8376298 100644 --- a/packages/core/src/browser/common-frontend-contribution.ts +++ b/packages/core/src/browser/common-frontend-contribution.ts @@ -90,67 +90,67 @@ export namespace CommonMenus { export namespace CommonCommands { - export const FILE_CATEGORY_KEY = 'vscode/menubarControl/mFile'; - export const VIEW_CATEGORY_KEY = 'vscode/menubarControl/mView'; - export const PREFERENCES_CATEGORY_KEY = 'vscode/actions/preferences'; export const FILE_CATEGORY = 'File'; export const VIEW_CATEGORY = 'View'; export const PREFERENCES_CATEGORY = 'Preferences'; + export const FILE_CATEGORY_KEY = nls.getDefaultKey(FILE_CATEGORY); + export const VIEW_CATEGORY_KEY = nls.getDefaultKey(VIEW_CATEGORY); + export const PREFERENCES_CATEGORY_KEY = nls.getDefaultKey(PREFERENCES_CATEGORY); export const OPEN: Command = { id: 'core.open', }; - export const CUT = Command.toLocalizedCommand({ + export const CUT = Command.toDefaultLocalizedCommand({ id: 'core.cut', label: 'Cut' - }, 'vscode/fileActions.contribution/cut'); - export const COPY = Command.toLocalizedCommand({ + }); + export const COPY = Command.toDefaultLocalizedCommand({ id: 'core.copy', label: 'Copy' - }, 'vscode/fileActions/copyFile'); - export const PASTE = Command.toLocalizedCommand({ + }); + export const PASTE = Command.toDefaultLocalizedCommand({ id: 'core.paste', label: 'Paste' - }, 'vscode/fileActions/pasteFile'); + }); - export const COPY_PATH = Command.toLocalizedCommand({ + export const COPY_PATH = Command.toDefaultLocalizedCommand({ id: 'core.copy.path', label: 'Copy Path' - }, 'vscode/fileActions.contribution/copyPath'); + }); - export const UNDO = Command.toLocalizedCommand({ + export const UNDO = Command.toDefaultLocalizedCommand({ id: 'core.undo', label: 'Undo' - }, 'vscode/textInputActions/undo'); - export const REDO = Command.toLocalizedCommand({ + }); + export const REDO = Command.toDefaultLocalizedCommand({ id: 'core.redo', label: 'Redo' - }, 'vscode/textInputActions/redo'); - export const SELECT_ALL = Command.toLocalizedCommand({ + }); + export const SELECT_ALL = Command.toDefaultLocalizedCommand({ id: 'core.selectAll', label: 'Select All' - }, 'vscode/textInputActions/selectAll'); + }); - export const FIND = Command.toLocalizedCommand({ + export const FIND = Command.toDefaultLocalizedCommand({ id: 'core.find', label: 'Find' - }, 'vscode/simpleFindReplaceWidget/label.find'); - export const REPLACE = Command.toLocalizedCommand({ + }); + export const REPLACE = Command.toDefaultLocalizedCommand({ id: 'core.replace', label: 'Replace' - }, 'vscode/simpleFindReplaceWidget/label.replace'); + }); - export const NEXT_TAB = Command.toLocalizedCommand({ + export const NEXT_TAB = Command.toDefaultLocalizedCommand({ id: 'core.nextTab', category: VIEW_CATEGORY, - label: 'Switch to Next Tab' - }, 'vscode/menubar/mShowNextTab', VIEW_CATEGORY_KEY); - export const PREVIOUS_TAB = Command.toLocalizedCommand({ + label: 'Show Next Tab' + }); + export const PREVIOUS_TAB = Command.toDefaultLocalizedCommand({ id: 'core.previousTab', category: VIEW_CATEGORY, - label: 'Switch to Previous Tab' - }, 'vscode/menubar/mShowPreviousTab', VIEW_CATEGORY_KEY); + label: 'Show Previous Tab' + }); export const NEXT_TAB_IN_GROUP = Command.toLocalizedCommand({ id: 'core.nextTabInGroup', category: VIEW_CATEGORY, @@ -221,70 +221,70 @@ export namespace CommonCommands { category: VIEW_CATEGORY, label: 'Toggle Bottom Panel' }, 'theia/core/common/collapseBottomPanel', VIEW_CATEGORY_KEY); - export const TOGGLE_STATUS_BAR = Command.toLocalizedCommand({ + export const TOGGLE_STATUS_BAR = Command.toDefaultLocalizedCommand({ id: 'workbench.action.toggleStatusbarVisibility', category: VIEW_CATEGORY, label: 'Toggle Status Bar Visibility' - }, 'vscode/layoutActions/toggleStatusbar'); + }); export const TOGGLE_MAXIMIZED = Command.toLocalizedCommand({ id: 'core.toggleMaximized', category: VIEW_CATEGORY, label: 'Toggle Maximized' }, 'theia/core/common/toggleMaximized', VIEW_CATEGORY_KEY); - export const OPEN_VIEW = Command.toLocalizedCommand({ + export const OPEN_VIEW = Command.toDefaultLocalizedCommand({ id: 'core.openView', category: VIEW_CATEGORY, label: 'Open View...' - }, 'vscode/quickAccess.contribution/miOpenView', VIEW_CATEGORY_KEY); + }); - export const SAVE = Command.toLocalizedCommand({ + export const SAVE = Command.toDefaultLocalizedCommand({ id: 'core.save', category: FILE_CATEGORY, label: 'Save', - }, 'vscode/fileCommands/save', FILE_CATEGORY_KEY); - export const SAVE_WITHOUT_FORMATTING = Command.toLocalizedCommand({ + }); + export const SAVE_WITHOUT_FORMATTING = Command.toDefaultLocalizedCommand({ id: 'core.saveWithoutFormatting', category: FILE_CATEGORY, label: 'Save without Formatting', - }, 'vscode/fileCommands/saveWithoutFormatting', FILE_CATEGORY_KEY); - export const SAVE_ALL = Command.toLocalizedCommand({ + }); + export const SAVE_ALL = Command.toDefaultLocalizedCommand({ id: 'core.saveAll', category: FILE_CATEGORY, label: 'Save All', - }, 'vscode/fileCommands/saveAll', FILE_CATEGORY_KEY); + }); - export const AUTO_SAVE = Command.toLocalizedCommand({ + export const AUTO_SAVE = Command.toDefaultLocalizedCommand({ id: 'textEditor.commands.autosave', category: FILE_CATEGORY, label: 'Auto Save', - }, 'vscode/fileActions.contribution/miAutoSave', FILE_CATEGORY_KEY); + }); - export const ABOUT_COMMAND = Command.toLocalizedCommand({ + export const ABOUT_COMMAND = Command.toDefaultLocalizedCommand({ id: 'core.about', label: 'About' - }, 'vscode/windowActions/about'); + }); - export const OPEN_PREFERENCES = Command.toLocalizedCommand({ + export const OPEN_PREFERENCES = Command.toDefaultLocalizedCommand({ id: 'preferences:open', category: PREFERENCES_CATEGORY, - label: 'Open Preferences', - }, 'vscode/preferences.contribution/preferences', PREFERENCES_CATEGORY_KEY); + label: 'Open Settings (UI)', + }); - export const SELECT_COLOR_THEME = Command.toLocalizedCommand({ + export const SELECT_COLOR_THEME = Command.toDefaultLocalizedCommand({ id: 'workbench.action.selectTheme', label: 'Color Theme', category: PREFERENCES_CATEGORY - }, 'vscode/themes.contribution/selectTheme.label', PREFERENCES_CATEGORY_KEY); - export const SELECT_ICON_THEME = Command.toLocalizedCommand({ + }); + export const SELECT_ICON_THEME = Command.toDefaultLocalizedCommand({ id: 'workbench.action.selectIconTheme', label: 'File Icon Theme', category: PREFERENCES_CATEGORY - }, 'vscode/themes.contribution/selectIconTheme.label', PREFERENCES_CATEGORY_KEY); + }); - export const CONFIGURE_DISPLAY_LANGUAGE = Command.toLocalizedCommand({ + export const CONFIGURE_DISPLAY_LANGUAGE = Command.toDefaultLocalizedCommand({ id: 'workbench.action.configureLanguage', label: 'Configure Display Language' - }, 'vscode/localizationsActions/configureLocale'); + }); } @@ -374,14 +374,14 @@ export class CommonFrontendContribution implements FrontendApplicationContributi app.shell.leftPanelHandler.addBottomMenu({ id: 'settings-menu', iconClass: 'codicon codicon-settings-gear', - title: nls.localize(CommonCommands.PREFERENCES_CATEGORY_KEY, CommonCommands.PREFERENCES_CATEGORY), + title: nls.localizeByDefault(CommonCommands.PREFERENCES_CATEGORY), menuPath: SETTINGS_MENU, order: 0, }); const accountsMenu = { id: 'accounts-menu', iconClass: 'codicon codicon-person', - title: nls.localize('vscode/activitybarPart/accounts', 'Accounts'), + title: nls.localizeByDefault('Accounts'), menuPath: ACCOUNTS_MENU, order: 1, }; @@ -446,7 +446,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi this.shell.leftPanelHandler.addTopMenu({ id: mainMenuId, iconClass: 'codicon codicon-menu', - title: nls.localize('vscode/menubar/mAppMenu', 'Application Menu'), + title: nls.localizeByDefault('Application Menu'), menuPath: ['menubar'], order: 0, }); @@ -479,10 +479,10 @@ export class CommonFrontendContribution implements FrontendApplicationContributi } registerMenus(registry: MenuModelRegistry): void { - registry.registerSubmenu(CommonMenus.FILE, nls.localize('vscode/menubarControl/mFile', 'File')); - registry.registerSubmenu(CommonMenus.EDIT, nls.localize('vscode/menubarControl/mEdit', 'Edit')); - registry.registerSubmenu(CommonMenus.VIEW, nls.localize('vscode/menubarControl/mView', 'View')); - registry.registerSubmenu(CommonMenus.HELP, nls.localize('vscode/menubarControl/mHelp', 'Help')); + registry.registerSubmenu(CommonMenus.FILE, nls.localizeByDefault('File')); + registry.registerSubmenu(CommonMenus.EDIT, nls.localizeByDefault('Edit')); + registry.registerSubmenu(CommonMenus.VIEW, nls.localizeByDefault('View')); + registry.registerSubmenu(CommonMenus.HELP, nls.localizeByDefault('Help')); registry.registerMenuAction(CommonMenus.FILE_SAVE, { commandId: CommonCommands.SAVE.id @@ -495,7 +495,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi commandId: CommonCommands.AUTO_SAVE.id }); - registry.registerSubmenu(CommonMenus.FILE_SETTINGS_SUBMENU, nls.localize(CommonCommands.PREFERENCES_CATEGORY_KEY, CommonCommands.PREFERENCES_CATEGORY)); + registry.registerSubmenu(CommonMenus.FILE_SETTINGS_SUBMENU, nls.localizeByDefault(CommonCommands.PREFERENCES_CATEGORY)); registry.registerMenuAction(CommonMenus.EDIT_UNDO, { commandId: CommonCommands.UNDO.id, @@ -548,22 +548,22 @@ export class CommonFrontendContribution implements FrontendApplicationContributi registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, { commandId: CommonCommands.CLOSE_TAB.id, - label: nls.localize('vscode/editor.contribution/close', 'Close'), + label: nls.localizeByDefault('Close'), order: '0' }); registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, { commandId: CommonCommands.CLOSE_OTHER_TABS.id, - label: nls.localize('vscode/editor.contribution/closeOthers', 'Close Others'), + label: nls.localizeByDefault('Close Others'), order: '1' }); registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, { commandId: CommonCommands.CLOSE_RIGHT_TABS.id, - label: nls.localize('vscode/editor.contribution/closeRight', 'Close to the Right'), + label: nls.localizeByDefault('Close to the Right'), order: '2' }); registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, { commandId: CommonCommands.CLOSE_ALL_TABS.id, - label: nls.localize('vscode/editor.contribution/closeAll', 'Close All'), + label: nls.localizeByDefault('Close All'), order: '3' }); registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, { @@ -1076,7 +1076,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi this.quickInputService?.showQuickPick(items, { - placeholder: nls.localize('vscode/extensionsActions/select file icon theme', 'Select File Icon Theme'), + placeholder: nls.localizeByDefault('Select File Icon Theme'), activeItem: items.find(item => item.id === resetTo), onDidChangeSelection: (quickPick: QuickPick, selectedItems: Array) => { resetTo = undefined; @@ -1115,7 +1115,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi const items = [...itemsByTheme.light, ...itemsByTheme.dark, ...itemsByTheme.hc]; this.quickInputService?.showQuickPick(items, { - placeholder: nls.localize('vscode/extensionActions/select color theme', 'Select Color Theme (Up/Down Keys to Preview)'), + placeholder: nls.localizeByDefault('Select Color Theme (Up/Down Keys to Preview)'), activeItem: items.find((item: QuickPickItem) => item.id === resetTo), // eslint-disable-next-line @typescript-eslint/no-explicit-any onDidChangeSelection: (quickPick: any, selectedItems: Array) => { diff --git a/packages/core/src/browser/core-preferences.ts b/packages/core/src/browser/core-preferences.ts index a5f132ac2eb7c..35cec878581d6 100644 --- a/packages/core/src/browser/core-preferences.ts +++ b/packages/core/src/browser/core-preferences.ts @@ -32,19 +32,20 @@ export const corePreferenceSchema: PreferenceSchema = { 'always', ], default: 'ifRequired', - description: nls.localize('vscode/workbench.contribution/confirmBeforeCloseWeb', 'When to confirm before closing the application window.'), + // eslint-disable-next-line max-len + description: nls.localizeByDefault('Controls whether to show a confirmation dialog before closing the browser tab or window. Note that even if enabled, browsers may still decide to close a tab or window without confirmation and that this setting is only a hint that may not work in all cases.'), }, 'breadcrumbs.enabled': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/breadcrumbs/enabled', 'Enable/disable navigation breadcrumbs.'), + 'description': nls.localizeByDefault('Enable/disable navigation breadcrumbs.'), 'scope': 'application' }, 'files.encoding': { 'type': 'string', 'enum': Object.keys(SUPPORTED_ENCODINGS), 'default': 'utf8', - 'description': nls.localize('vscode/files.contribution/encoding', + 'description': nls.localizeByDefault( 'The default character set encoding to use when reading and writing files. This setting can also be configured per language.'), 'scope': 'language-overridable', 'enumDescriptions': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong), @@ -57,22 +58,22 @@ export const corePreferenceSchema: PreferenceSchema = { 'keyCode', ], default: 'code', - description: nls.localize('vscode/keybindingService/dispatch', - 'Whether to interpret keypresses by the `code` of the physical key, or by the `keyCode` provided by the OS.') + description: nls.localizeByDefault( + 'Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`.') }, 'window.menuBarVisibility': { type: 'string', enum: ['classic', 'visible', 'hidden', 'compact'], markdownEnumDescriptions: [ - nls.localize('vscode/workbench.contribution/window.menuBarVisibility.default', 'Menu is displayed at the top of the window and only hidden in full screen mode.'), - nls.localize('vscode/workbench.contribution/window.menuBarVisibility.visible', 'Menu is always visible at the top of the window even in full screen mode.'), - nls.localize('vscode/workbench.contribution/window.menuBarVisibility.hidden', 'Menu is always hidden.'), - nls.localize('vscode/workbench.contribution/window.menuBarVisibility.compact', 'Menu is displayed as a compact button in the sidebar.') + nls.localizeByDefault('Menu is only hidden in full screen mode.'), + nls.localizeByDefault('Menu is always visible even in full screen mode.'), + nls.localizeByDefault('Menu is always hidden.'), + nls.localizeByDefault('Menu is displayed as a compact button in the sidebar. This value is ignored when `#window.titleBarStyle#` is `native`.') ], default: 'classic', scope: 'application', - markdownDescription: nls.localize('vscode/workbench.contribution/menuBarVisibility', `Control the visibility of the menu bar. - A setting of 'compact' will move the menu into the sidebar.`), + // eslint-disable-next-line max-len + markdownDescription: nls.localizeByDefault("Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. By default, the menu bar will be visible, unless the window is full screen."), included: !isOSX }, 'workbench.list.openMode': { @@ -82,17 +83,19 @@ export const corePreferenceSchema: PreferenceSchema = { 'doubleClick' ], default: 'singleClick', - description: nls.localize('vscode/listService/openModeModifier', 'Controls how to open items in trees using the mouse.') + // eslint-disable-next-line max-len + description: nls.localizeByDefault('Controls how to open items in trees and lists using the mouse (if supported). For parents with children in trees, this setting will control if a single click expands the parent or a double click. Note that some trees and lists might choose to ignore this setting if it is not applicable. ') }, 'workbench.editor.highlightModifiedTabs': { 'type': 'boolean', - 'description': nls.localize('vscode/workbench.contribution/highlightModifiedTabs', 'Controls whether a top border is drawn on modified (dirty) editor tabs or not.'), + // eslint-disable-next-line max-len + 'description': nls.localizeByDefault('Controls whether a top border is drawn on modified (dirty) editor tabs or not. This value is ignored when `#workbench.editor.showTabs#` is disabled.'), 'default': false }, 'workbench.editor.closeOnFileDelete': { 'type': 'boolean', // eslint-disable-next-line max-len - 'description': nls.localize('vscode/workbench.contribution/closeOnFileDelete', 'Controls whether editors showing a file that was opened during the session should close automatically when getting deleted or renamed by some other process. Disabling this will keep the editor open on such an event. Note that deleting from within the application will always close the editor and that dirty files will never close to preserve your data.'), + 'description': nls.localizeByDefault('Controls whether editors showing a file that was opened during the session should close automatically when getting deleted or renamed by some other process. Disabling this will keep the editor open on such an event. Note that deleting from within the application will always close the editor and that dirty files will never close to preserve your data.'), 'default': false }, 'workbench.commandPalette.history': { @@ -100,38 +103,38 @@ export const corePreferenceSchema: PreferenceSchema = { default: 50, minimum: 0, // eslint-disable-next-line max-len - description: nls.localize('vscode/workbench.contribution/commandHistory', 'Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history.') + description: nls.localizeByDefault('Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history.') }, 'workbench.colorTheme': { type: 'string', default: FrontendApplicationConfigProvider.get().defaultTheme, - description: nls.localize('vscode/themeConfiguration/colorTheme', 'Specifies the color theme used in the workbench.') + description: nls.localizeByDefault('Specifies the color theme used in the workbench.') }, 'workbench.iconTheme': { type: ['string', 'null'], default: FrontendApplicationConfigProvider.get().defaultIconTheme, - description: nls.localize('vscode/themeConfiguration/iconTheme', "Specifies the icon theme used in the workbench or 'null' to not show any file icons.") + description: nls.localizeByDefault("Specifies the file icon theme used in the workbench or 'null' to not show any file icons.") }, 'workbench.silentNotifications': { type: 'boolean', default: false, - description: nls.localize('vscode/workbench.contribution/zenMode.silentNotifications', 'Controls whether to suppress notification popups.') + description: nls.localize('theia/core/silentNotifications', 'Controls whether to suppress notification popups.') }, 'workbench.statusBar.visible': { type: 'boolean', default: true, - description: 'Controls the visibility of the status bar at the bottom of the workbench.' + description: nls.localizeByDefault('Controls the visibility of the status bar at the bottom of the workbench.') }, 'workbench.tree.renderIndentGuides': { type: 'string', enum: ['onHover', 'none', 'always'], default: 'onHover', - description: nls.localize('vscode/listService/render tree indent guides', 'Controls whether the tree should render indent guides.') + description: nls.localizeByDefault('Controls whether the tree should render indent guides.') }, 'workbench.hover.delay': { type: 'number', default: isOSX ? 1500 : 500, - description: 'Controls the delay in milliseconds after which the hover is shown for workbench items (ex. some extension provided tree view items).' + description: nls.localizeByDefault('Controls the delay in milliseconds after which the hover is shown.') }, } }; diff --git a/packages/core/src/browser/dialogs.ts b/packages/core/src/browser/dialogs.ts index 8d44aabc261be..45be8358f8e18 100644 --- a/packages/core/src/browser/dialogs.ts +++ b/packages/core/src/browser/dialogs.ts @@ -67,10 +67,10 @@ export namespace DialogError { } export namespace Dialog { - export const YES = nls.localize('vscode/extensionsUtils/yes', 'Yes'); - export const NO = nls.localize('vscode/extensionsUtils/no', 'No'); - export const OK = nls.localize('vscode/dialog/ok', 'OK'); - export const CANCEL = nls.localize('vscode/explorerViewer/cancel', 'Cancel'); + export const YES = nls.localizeByDefault('Yes'); + export const NO = nls.localizeByDefault('No'); + export const OK = nls.localizeByDefault('OK'); + export const CANCEL = nls.localizeByDefault('Cancel'); } @injectable() diff --git a/packages/core/src/browser/keyboard/browser-keyboard-frontend-contribution.ts b/packages/core/src/browser/keyboard/browser-keyboard-frontend-contribution.ts index a71fd3b37179d..ccfd14bf67d1d 100644 --- a/packages/core/src/browser/keyboard/browser-keyboard-frontend-contribution.ts +++ b/packages/core/src/browser/keyboard/browser-keyboard-frontend-contribution.ts @@ -23,8 +23,8 @@ import { nls } from '../../common/nls'; export namespace KeyboardCommands { - const KEYBOARD_CATEGORY_KEY = 'vscode/settingsLayout/keyboard'; const KEYBOARD_CATEGORY = 'Keyboard'; + const KEYBOARD_CATEGORY_KEY = nls.getDefaultKey(KEYBOARD_CATEGORY); export const CHOOSE_KEYBOARD_LAYOUT = Command.toLocalizedCommand({ id: 'core.keyboard.choose', @@ -52,7 +52,7 @@ export class BrowserKeyboardFrontendContribution implements CommandContribution protected async chooseLayout(): Promise { const current = this.layoutProvider.currentLayoutData; const autodetect: QuickPickValue<'autodetect'> = { - label: nls.localize('vscode/editorStatus/autoDetect', 'Auto-detect'), + label: nls.localizeByDefault('Auto-detect'), description: this.layoutProvider.currentLayoutSource !== 'user-choice' ? nls.localize('theia/core/keyboard/current', '(current: {0})', current.name) : undefined, detail: nls.localize('theia/core/keyboard/tryDetect', 'Try to detect the keyboard layout from browser information and pressed keys.'), value: 'autodetect' diff --git a/packages/core/src/browser/quick-input/quick-command-frontend-contribution.ts b/packages/core/src/browser/quick-input/quick-command-frontend-contribution.ts index 1d06c837fb04f..99a2ffd6a8427 100644 --- a/packages/core/src/browser/quick-input/quick-command-frontend-contribution.ts +++ b/packages/core/src/browser/quick-input/quick-command-frontend-contribution.ts @@ -43,7 +43,7 @@ export class QuickCommandFrontendContribution implements CommandContribution, Ke registerMenus(menus: MenuModelRegistry): void { menus.registerMenuAction(CommonMenus.VIEW_PRIMARY, { commandId: quickCommand.id, - label: nls.localize('vscode/quickAccess.contribution/commandsQuickAccess', 'Find Command...') + label: nls.localizeByDefault('Command Palette...') }); } diff --git a/packages/core/src/browser/quick-input/quick-command-service.ts b/packages/core/src/browser/quick-input/quick-command-service.ts index dbd473caf7bd2..49963538a5935 100644 --- a/packages/core/src/browser/quick-input/quick-command-service.ts +++ b/packages/core/src/browser/quick-input/quick-command-service.ts @@ -28,10 +28,10 @@ export const quickCommand: Command = { id: 'workbench.action.showCommands' }; -export const CLEAR_COMMAND_HISTORY = Command.toLocalizedCommand({ +export const CLEAR_COMMAND_HISTORY = Command.toDefaultLocalizedCommand({ id: 'clear.command.history', label: 'Clear Command History' -}, 'vscode/commandsQuickAccess/clearCommandHistory'); +}); @injectable() export class QuickCommandService implements QuickAccessContribution, QuickAccessProvider { diff --git a/packages/core/src/browser/shell/tab-bar-toolbar.tsx b/packages/core/src/browser/shell/tab-bar-toolbar.tsx index 433f1c2c8e699..5d9968b732e11 100644 --- a/packages/core/src/browser/shell/tab-bar-toolbar.tsx +++ b/packages/core/src/browser/shell/tab-bar-toolbar.tsx @@ -405,7 +405,7 @@ export class TabBarToolbar extends ReactWidget { protected renderMore(): React.ReactNode { return !!this.more.size &&
+ title={nls.localizeByDefault('More Actions...')} />
; } diff --git a/packages/core/src/browser/window-contribution.ts b/packages/core/src/browser/window-contribution.ts index 77d5004cf7091..998f4feb247a7 100644 --- a/packages/core/src/browser/window-contribution.ts +++ b/packages/core/src/browser/window-contribution.ts @@ -23,10 +23,10 @@ import { CommonMenus } from '../browser/common-frontend-contribution'; export namespace WindowCommands { - export const NEW_WINDOW = Command.toLocalizedCommand({ + export const NEW_WINDOW = Command.toDefaultLocalizedCommand({ id: 'workbench.action.newWindow', label: 'New Window' - }, 'vscode/windowActions/newWindow'); + }); } @injectable() diff --git a/packages/core/src/common/command.ts b/packages/core/src/common/command.ts index 5f68f202651a7..c15843de0d024 100644 --- a/packages/core/src/common/command.ts +++ b/packages/core/src/common/command.ts @@ -64,6 +64,16 @@ export namespace Command { }; } + export function toDefaultLocalizedCommand(command: Command): Command { + return { + ...command, + label: command.label && nls.localizeByDefault(command.label), + originalLabel: command.label, + category: command.category && nls.localizeByDefault(command.category), + originalCategory: command.category, + }; + } + /** Comparator function for when sorting commands */ export function compareCommands(a: Command, b: Command): number { if (a.label && b.label) { diff --git a/packages/core/src/common/i18n/localization.ts b/packages/core/src/common/i18n/localization.ts index b2a0ee807a917..778ed1309cf8b 100644 --- a/packages/core/src/common/i18n/localization.ts +++ b/packages/core/src/common/i18n/localization.ts @@ -59,13 +59,23 @@ export namespace Localization { if (localization) { const translation = localization.translations[key]; if (translation) { - // vscode's localizations often contain additional '&&' symbols, which we simply ignore - value = translation.replace(/&&/g, ''); + value = normalize(value); } } return format(value, args); } + /** + * This function normalizes values from VSCode's localizations, which often contain additional mnemonics (`&&`). + * The normalization removes the mnemonics from the input string. + * + * @param value Localization value coming from VSCode + * @returns A normalized localized value + */ + export function normalize(value: string): string { + return value.replace(/&&/g, ''); + } + export function transformKey(key: string): string { let nlsKey = key; const keySlashIndex = key.lastIndexOf('/'); diff --git a/packages/core/src/common/nls.ts b/packages/core/src/common/nls.ts index 66ddbf977f705..ed23e39d0b209 100644 --- a/packages/core/src/common/nls.ts +++ b/packages/core/src/common/nls.ts @@ -30,16 +30,26 @@ export namespace nls { * Automatically localizes a text if that text also exists in the vscode repository. */ export function localizeByDefault(defaultValue: string, ...args: FormatType[]): string { + const key = getDefaultKey(defaultValue); + if (key) { + return localize(key, defaultValue, ...args); + } + return Localization.format(defaultValue, args); + } + + export function getDefaultKey(defaultValue: string): string { if (localization) { if (!keyProvider) { keyProvider = new LocalizationKeyProvider(); } const key = keyProvider.get(defaultValue); if (key) { - return localize(key, defaultValue, ...args); + return key; + } else { + console.warn(`Could not find translation key for default value: "${defaultValue}"`); } } - return Localization.format(defaultValue, args); + return ''; } export function localize(key: string, defaultValue: string, ...args: FormatType[]): string { @@ -64,6 +74,13 @@ class LocalizationKeyProvider { return this.data.get(defaultValue); } + /** + * Transforms the data coming from the `nls.metadata.json` file into a map. + * The original data contains arrays of keys and messages. + * The result is a map that matches each message to the key that belongs to it. + * + * This allows us to skip the key in the localization process and map the original english default values to their translations in different languages. + */ private buildData(): Map { const bundles = require('../../src/common/i18n/nls.metadata.json'); const keys: NlsKeys = bundles.keys; @@ -72,7 +89,7 @@ class LocalizationKeyProvider { for (const [fileKey, messageBundle] of Object.entries(messages)) { const keyBundle = keys[fileKey]; for (let i = 0; i < messageBundle.length; i++) { - const message = messageBundle[i].replace(/&&/g, ''); + const message = Localization.normalize(messageBundle[i]); const key = keyBundle[i]; const localizationKey = this.buildKey(typeof key === 'string' ? key : key.key, fileKey); data.set(message, localizationKey); diff --git a/packages/core/src/electron-browser/menu/electron-menu-contribution.ts b/packages/core/src/electron-browser/menu/electron-menu-contribution.ts index a954e0825b163..912c5657536a0 100644 --- a/packages/core/src/electron-browser/menu/electron-menu-contribution.ts +++ b/packages/core/src/electron-browser/menu/electron-menu-contribution.ts @@ -34,35 +34,35 @@ import { BrowserMenuBarContribution } from '../../browser/menu/browser-menu-plug import '../../../src/electron-browser/menu/electron-menu-style.css'; export namespace ElectronCommands { - export const TOGGLE_DEVELOPER_TOOLS = Command.toLocalizedCommand({ + export const TOGGLE_DEVELOPER_TOOLS = Command.toDefaultLocalizedCommand({ id: 'theia.toggleDevTools', label: 'Toggle Developer Tools' - }, 'vscode/developerActions/toggleDevTools'); - export const RELOAD = Command.toLocalizedCommand({ + }); + export const RELOAD = Command.toDefaultLocalizedCommand({ id: 'view.reload', label: 'Reload Window' - }, 'vscode/windowActions/reloadWindow'); - export const ZOOM_IN = Command.toLocalizedCommand({ + }); + export const ZOOM_IN = Command.toDefaultLocalizedCommand({ id: 'view.zoomIn', label: 'Zoom In' - }, 'vscode/windowActions/zoomIn'); - export const ZOOM_OUT = Command.toLocalizedCommand({ + }); + export const ZOOM_OUT = Command.toDefaultLocalizedCommand({ id: 'view.zoomOut', label: 'Zoom Out' - }, 'vscode/windowActions/zoomOut'); - export const RESET_ZOOM = Command.toLocalizedCommand({ + }); + export const RESET_ZOOM = Command.toDefaultLocalizedCommand({ id: 'view.resetZoom', label: 'Reset Zoom' - }, 'vscode/windowActions/zoomReset'); - export const CLOSE_WINDOW = Command.toLocalizedCommand({ + }); + export const CLOSE_WINDOW = Command.toDefaultLocalizedCommand({ id: 'close.window', label: 'Close Window' - }, 'vscode/windowActions/close'); - export const TOGGLE_FULL_SCREEN = Command.toLocalizedCommand({ + }); + export const TOGGLE_FULL_SCREEN = Command.toDefaultLocalizedCommand({ id: 'workbench.action.toggleFullScreen', category: CommonCommands.VIEW_CATEGORY, label: 'Toggle Full Screen' - }, 'vscode/windowActions/toggleFullScreen', CommonCommands.VIEW_CATEGORY_KEY); + }); } export namespace ElectronMenus { @@ -228,12 +228,12 @@ export class ElectronMenuContribution extends BrowserMenuBarContribution impleme protected async handleRequiredRestart(): Promise { const msgNode = document.createElement('div'); const message = document.createElement('p'); - message.textContent = nls.localize('vscode/relauncher.contribution/relaunchSettingMessage', 'A setting has changed that requires a restart to take effect'); + message.textContent = nls.localizeByDefault('A setting has changed that requires a restart to take effect'); const detail = document.createElement('p'); - detail.textContent = nls.localize('vscode/relauncher.contribution/relaunchSettingDetail', + detail.textContent = nls.localizeByDefault( 'Press the restart button to restart {0} and enable the setting.', FrontendApplicationConfigProvider.get().applicationName); msgNode.append(message, detail); - const restart = nls.localize('vscode/relauncher.contribution/restart', 'Restart'); + const restart = nls.localizeByDefault('Restart'); const dialog = new ConfirmDialog({ title: restart, msg: msgNode, diff --git a/packages/core/src/electron-browser/window/electron-window-preferences.ts b/packages/core/src/electron-browser/window/electron-window-preferences.ts index 2b4ad3816a6ee..ddb742fd3b6df 100644 --- a/packages/core/src/electron-browser/window/electron-window-preferences.ts +++ b/packages/core/src/electron-browser/window/electron-window-preferences.ts @@ -38,7 +38,7 @@ export const electronWindowPreferencesSchema: PreferenceSchema = { 'maximum': ZoomLevel.MAX, 'scope': 'application', // eslint-disable-next-line max-len - 'description': nls.localize('vscode/desktop.contribution/zoomLevel', 'Adjust the zoom level of the window. The original size is 0 and each increment above (e.g. 1.0) or below (e.g. -1.0) represents zooming 20% larger or smaller. You can also enter decimals to adjust the zoom level with a finer granularity.') + 'description': nls.localizeByDefault('Adjust the zoom level of the window. The original size is 0 and each increment above (e.g. 1.0) or below (e.g. -1.0) represents zooming 20% larger or smaller. You can also enter decimals to adjust the zoom level with a finer granularity.') }, 'window.titleBarStyle': { type: 'string', @@ -46,7 +46,7 @@ export const electronWindowPreferencesSchema: PreferenceSchema = { default: isWindows ? 'custom' : 'native', scope: 'application', // eslint-disable-next-line max-len - description: nls.localize('vscode/desktop.contribution/titleBarStyle', 'Adjust the appearance of the window title bar. On Linux and Windows, this setting also affects the application and context menu appearances. Changes require a full restart to apply.'), + description: nls.localizeByDefault('Adjust the appearance of the window title bar. On Linux and Windows, this setting also affects the application and context menu appearances. Changes require a full restart to apply.'), included: !isOSX }, } diff --git a/packages/debug/src/browser/console/debug-console-contribution.tsx b/packages/debug/src/browser/console/debug-console-contribution.tsx index 1b3092bef204b..b3c01fff87ab5 100644 --- a/packages/debug/src/browser/console/debug-console-contribution.tsx +++ b/packages/debug/src/browser/console/debug-console-contribution.tsx @@ -34,15 +34,14 @@ export const InDebugReplContextKey = Symbol('inDebugReplContextKey'); export namespace DebugConsoleCommands { - export const DEBUG_CATEGORY_KEY = 'vscode/debugCommands/debug'; export const DEBUG_CATEGORY = 'Debug'; - export const CLEAR = Command.toLocalizedCommand({ + export const CLEAR = Command.toDefaultLocalizedCommand({ id: 'debug.console.clear', category: DEBUG_CATEGORY, label: 'Clear Console', iconClass: codicon('clear-all') - }, 'vscode/repl/clearRepl', DEBUG_CATEGORY_KEY); + }); } @injectable() @@ -136,7 +135,7 @@ export class DebugConsoleContribution extends AbstractViewContribution { - const activateBreakpoints = nls.localize('vscode/breakpointsView/enableAllBreakpoints', 'Enable Breakpoints'); - const deactivateBreakpoints = nls.localize('vscode/breakpointsView/disableAllBreakpoints', 'Disable Breakpoints'); + const activateBreakpoints = nls.localizeByDefault('Enable All Breakpoints'); + const deactivateBreakpoints = nls.localizeByDefault('Disable All Breakpoints'); const tooltip = this.breakpointManager.breakpointsEnabled ? deactivateBreakpoints : activateBreakpoints; if (toggleBreakpointsEnabled.tooltip !== tooltip) { toggleBreakpointsEnabled.tooltip = tooltip; diff --git a/packages/debug/src/browser/debug-preferences.ts b/packages/debug/src/browser/debug-preferences.ts index 84da0e36ab104..b082aedd88cc4 100644 --- a/packages/debug/src/browser/debug-preferences.ts +++ b/packages/debug/src/browser/debug-preferences.ts @@ -34,26 +34,26 @@ export const debugPreferencesSchema: PreferenceSchema = { 'debug.openDebug': { enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'], default: 'openOnSessionStart', - description: nls.localize('vscode/debug.contribution/openDebug', 'Controls when the debug view should open.') + description: nls.localizeByDefault('Controls when the debug view should open.') }, 'debug.internalConsoleOptions': { enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'], default: 'openOnFirstSessionStart', - description: nls.localize('vscode/debug/internalConsoleOptions', 'Controls when the internal debug console should open.') + description: nls.localizeByDefault('Controls when the internal debug console should open.') }, 'debug.inlineValues': { type: 'boolean', default: false, - description: nls.localize('vscode/debug.contribution/inlineValues', 'Show variable values inline in editor while debugging.') + description: nls.localizeByDefault('Show variable values inline in editor while debugging.') }, 'debug.showInStatusBar': { enum: ['never', 'always', 'onFirstSessionStart'], enumDescriptions: [ - nls.localize('vscode/debug.contribution/never', 'Never show debug in status bar'), - nls.localize('vscode/debug.contribution/always', 'Always show debug in status bar'), - nls.localize('vscode/debug.contribution/onFirstSessionStart', 'Show debug in status bar only after debug was started for the first time') + nls.localizeByDefault('Never show debug in status bar'), + nls.localizeByDefault('Always show debug in status bar'), + nls.localizeByDefault('Show debug in status bar only after debug was started for the first time') ], - description: nls.localize('vscode/debug.contribution/showInStatusBar', 'Controls when the debug status bar should be visible.'), + description: nls.localizeByDefault('Controls when the debug status bar should be visible.'), default: 'onFirstSessionStart' }, 'debug.confirmOnExit': { diff --git a/packages/debug/src/browser/debug-prefix-configuration.ts b/packages/debug/src/browser/debug-prefix-configuration.ts index 8142a2313593e..52d95ca8c4dcf 100644 --- a/packages/debug/src/browser/debug-prefix-configuration.ts +++ b/packages/debug/src/browser/debug-prefix-configuration.ts @@ -61,11 +61,11 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan readonly statusBarId = 'select-run-debug-statusbar-item'; - private readonly command = Command.toLocalizedCommand({ + private readonly command = Command.toDefaultLocalizedCommand({ id: 'select.debug.configuration', category: DebugCommands.DEBUG_CATEGORY, label: 'Select and Start Debugging' - }, 'vscode/debugCommands/selectAndStartDebugging', DebugCommands.DEBUG_CATEGORY_KEY); + }); @postConstruct() protected initialize(): void { @@ -135,7 +135,7 @@ export class DebugPrefixConfiguration implements CommandContribution, CommandHan for (const configuration of dynamicConfigurations) { items.push({ label: configuration.name, - execute: () => this.runConfiguration({configuration}) + execute: () => this.runConfiguration({ configuration }) }); } } diff --git a/packages/debug/src/browser/model/debug-function-breakpoint.tsx b/packages/debug/src/browser/model/debug-function-breakpoint.tsx index db7ac5b49eea4..717de7d70eee1 100644 --- a/packages/debug/src/browser/model/debug-function-breakpoint.tsx +++ b/packages/debug/src/browser/model/debug-function-breakpoint.tsx @@ -20,6 +20,7 @@ import { FunctionBreakpoint } from '../breakpoint/breakpoint-marker'; import { BreakpointManager } from '../breakpoint/breakpoint-manager'; import { DebugBreakpoint, DebugBreakpointOptions, DebugBreakpointDecoration } from './debug-breakpoint'; import { SingleTextInputDialog } from '@theia/core/lib/browser/dialogs'; +import { nls } from '@theia/core'; export class DebugFunctionBreakpoint extends DebugBreakpoint implements TreeElement { @@ -63,7 +64,7 @@ export class DebugFunctionBreakpoint extends DebugBreakpoint protected doGetDecoration(): DebugBreakpointDecoration { if (!this.isSupported()) { - return this.getDisabledBreakpointDecoration('Function breakpoints are not supported by this debug type'); + return this.getDisabledBreakpointDecoration(nls.localizeByDefault('Function breakpoints are not supported by this debug type')); } return super.doGetDecoration(); } @@ -71,13 +72,13 @@ export class DebugFunctionBreakpoint extends DebugBreakpoint protected getBreakpointDecoration(message?: string[]): DebugBreakpointDecoration { return { className: 'theia-debug-function', - message: message || ['Function Breakpoint'] + message: message || [nls.localizeByDefault('Function Breakpoint')] }; } async open(): Promise { const input = new SingleTextInputDialog({ - title: 'Add Function Breakpoint', + title: nls.localizeByDefault('Add Function Breakpoint'), initialValue: this.name }); const newValue = await input.open(); diff --git a/packages/debug/src/browser/preferences/launch-preferences.ts b/packages/debug/src/browser/preferences/launch-preferences.ts index edf4cd427a72d..9e74eea4a3c8c 100644 --- a/packages/debug/src/browser/preferences/launch-preferences.ts +++ b/packages/debug/src/browser/preferences/launch-preferences.ts @@ -26,10 +26,7 @@ export const launchPreferencesSchema: PreferenceSchema = { properties: { 'launch': { $ref: launchSchemaId, - description: nls.localize( - 'vscode/debug.contribution/launch', - "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces" - ), + description: nls.localizeByDefault("Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces."), defaultValue: { configurations: [], compounds: [] } } } diff --git a/packages/debug/src/browser/view/debug-breakpoints-widget.ts b/packages/debug/src/browser/view/debug-breakpoints-widget.ts index 1ada22f37f58b..8e4789b712f4a 100644 --- a/packages/debug/src/browser/view/debug-breakpoints-widget.ts +++ b/packages/debug/src/browser/view/debug-breakpoints-widget.ts @@ -58,7 +58,7 @@ export class DebugBreakpointsWidget extends SourceTreeWidget { protected init(): void { super.init(); this.id = 'debug:breakpoints:' + this.viewModel.id; - this.title.label = nls.localize('vscode/debug.contribution/breakpoints', 'Breakpoints'); + this.title.label = nls.localizeByDefault('Breakpoints'); this.toDispose.push(this.breakpointsSource); this.source = this.breakpointsSource; } diff --git a/packages/debug/src/browser/view/debug-configuration-widget.tsx b/packages/debug/src/browser/view/debug-configuration-widget.tsx index c627f1b14b5f7..689b44a546c5f 100644 --- a/packages/debug/src/browser/view/debug-configuration-widget.tsx +++ b/packages/debug/src/browser/view/debug-configuration-widget.tsx @@ -79,15 +79,15 @@ export class DebugConfigurationWidget extends ReactWidget { render(): React.ReactNode { const { options } = this; return - + - - + ; } protected get currentValue(): string { diff --git a/packages/debug/src/browser/view/debug-stack-frames-widget.ts b/packages/debug/src/browser/view/debug-stack-frames-widget.ts index 9ad33b9448144..e8b79dd532eb8 100644 --- a/packages/debug/src/browser/view/debug-stack-frames-widget.ts +++ b/packages/debug/src/browser/view/debug-stack-frames-widget.ts @@ -56,7 +56,7 @@ export class DebugStackFramesWidget extends SourceTreeWidget { protected init(): void { super.init(); this.id = 'debug:frames:' + this.viewModel.id; - this.title.label = nls.localize('vscode/debug.contribution/callStack', 'Call Stack'); + this.title.label = nls.localizeByDefault('Call Stack'); this.toDispose.push(this.frames); this.source = this.frames; diff --git a/packages/debug/src/browser/view/debug-toolbar-widget.tsx b/packages/debug/src/browser/view/debug-toolbar-widget.tsx index 6c81fb7a0c242..1c536945a6660 100644 --- a/packages/debug/src/browser/view/debug-toolbar-widget.tsx +++ b/packages/debug/src/browser/view/debug-toolbar-widget.tsx @@ -59,13 +59,13 @@ export class DebugToolBar extends ReactWidget { const { state } = this.model; return {this.renderContinue()} - - - - {this.renderStart()} ; @@ -73,16 +73,16 @@ export class DebugToolBar extends ReactWidget { protected renderStart(): React.ReactNode { const { state } = this.model; if (state === DebugState.Inactive && this.model.sessionCount === 1) { - return ; + return ; } - return ; + return ; } protected renderContinue(): React.ReactNode { const { state } = this.model; if (state === DebugState.Stopped) { - return ; + return ; } - return ; + return ; } protected start = () => this.model.start(); diff --git a/packages/debug/src/browser/view/debug-variables-widget.ts b/packages/debug/src/browser/view/debug-variables-widget.ts index 1241a6d82eebf..1832057826e09 100644 --- a/packages/debug/src/browser/view/debug-variables-widget.ts +++ b/packages/debug/src/browser/view/debug-variables-widget.ts @@ -52,7 +52,7 @@ export class DebugVariablesWidget extends SourceTreeWidget { protected init(): void { super.init(); this.id = 'debug:variables:' + this.viewModel.id; - this.title.label = nls.localize('vscode/debug.contribution/variables', 'Variables'); + this.title.label = nls.localizeByDefault('Variables'); this.toDispose.push(this.variables); this.source = this.variables; } diff --git a/packages/debug/src/browser/view/debug-watch-widget.ts b/packages/debug/src/browser/view/debug-watch-widget.ts index c2aea9a76611e..464ce23a156c0 100644 --- a/packages/debug/src/browser/view/debug-watch-widget.ts +++ b/packages/debug/src/browser/view/debug-watch-widget.ts @@ -52,7 +52,7 @@ export class DebugWatchWidget extends SourceTreeWidget { protected init(): void { super.init(); this.id = 'debug:watch:' + this.viewModel.id; - this.title.label = nls.localize('vscode/debug.contribution/watch', 'Watch'); + this.title.label = nls.localizeByDefault('Watch'); this.toDispose.push(this.variables); this.source = this.variables; } diff --git a/packages/debug/src/browser/view/debug-widget.ts b/packages/debug/src/browser/view/debug-widget.ts index 2eeb53a3e270d..529df050885b5 100644 --- a/packages/debug/src/browser/view/debug-widget.ts +++ b/packages/debug/src/browser/view/debug-widget.ts @@ -39,7 +39,7 @@ export class DebugWidget extends BaseWidget implements StatefulWidget, Applicati } static ID = 'debug'; - static LABEL = nls.localize('vscode/settingsLayout/debug', 'Debug'); + static LABEL = nls.localizeByDefault('Debug'); @inject(DebugViewModel) readonly model: DebugViewModel; diff --git a/packages/editor-preview/src/browser/editor-preview-contribution.ts b/packages/editor-preview/src/browser/editor-preview-contribution.ts index 3e8731e09a7a2..1b39d849991bc 100644 --- a/packages/editor-preview/src/browser/editor-preview-contribution.ts +++ b/packages/editor-preview/src/browser/editor-preview-contribution.ts @@ -21,11 +21,11 @@ import { inject, injectable } from '@theia/core/shared/inversify'; import { EditorPreviewWidget } from './editor-preview-widget'; export namespace EditorPreviewCommands { - export const PIN_PREVIEW_COMMAND = Command.toLocalizedCommand({ + export const PIN_PREVIEW_COMMAND = Command.toDefaultLocalizedCommand({ id: 'workbench.action.keepEditor', category: CommonCommands.VIEW_CATEGORY, label: 'Keep Editor', - }, 'vscode/editor.contribution/keepEditor', CommonCommands.VIEW_CATEGORY_KEY); + }); } @injectable() @@ -62,7 +62,7 @@ export class EditorPreviewContribution implements CommandContribution, MenuContr registerMenus(registry: MenuModelRegistry): void { registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, { commandId: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id, - label: nls.localize('vscode/editor.contribution/keepOpen', 'Keep Open'), + label: nls.localizeByDefault('Keep Open'), order: '6', }); } diff --git a/packages/editor-preview/src/browser/editor-preview-preferences.ts b/packages/editor-preview/src/browser/editor-preview-preferences.ts index 7b2016cea2476..35ab21ca1464b 100644 --- a/packages/editor-preview/src/browser/editor-preview-preferences.ts +++ b/packages/editor-preview/src/browser/editor-preview-preferences.ts @@ -23,7 +23,8 @@ export const EditorPreviewConfigSchema: PreferenceSchema = { properties: { 'editor.enablePreview': { type: 'boolean', - description: nls.localize('vscode/workbench.contribution/enablePreview', 'Controls whether editors are opened as previews when selected or single-clicked.'), + // eslint-disable-next-line max-len + description: nls.localizeByDefault('Controls whether opened editors show as preview. Preview editors do not keep open and are reused until explicitly set to be kept open (e.g. via double click or editing) and show up with an italic font style.'), default: true }, } diff --git a/packages/editor/src/browser/editor-command.ts b/packages/editor/src/browser/editor-command.ts index 1f50f37cc1914..7c5489465975a 100644 --- a/packages/editor/src/browser/editor-command.ts +++ b/packages/editor/src/browser/editor-command.ts @@ -28,8 +28,8 @@ import { nls } from '@theia/core/lib/common/nls'; export namespace EditorCommands { - const EDITOR_CATEGORY_KEY = 'vscode/textEditor/editor'; const EDITOR_CATEGORY = 'Editor'; + const EDITOR_CATEGORY_KEY = nls.getDefaultKey(EDITOR_CATEGORY); export const GOTO_LINE_COLUMN = Command.toLocalizedCommand({ id: 'editor.action.gotoLine', @@ -49,75 +49,75 @@ export namespace EditorCommands { id: 'textEditor.commands.configIndentation' }; - export const CONFIG_EOL = Command.toLocalizedCommand({ + export const CONFIG_EOL = Command.toDefaultLocalizedCommand({ id: 'textEditor.commands.configEol', category: EDITOR_CATEGORY, label: 'Change End of Line Sequence' - }, 'vscode/editorStatus/selectEOL', EDITOR_CATEGORY_KEY); + }); - export const INDENT_USING_SPACES = Command.toLocalizedCommand({ + export const INDENT_USING_SPACES = Command.toDefaultLocalizedCommand({ id: 'textEditor.commands.indentUsingSpaces', category: EDITOR_CATEGORY, label: 'Indent Using Spaces' - }, 'vscode/indentation/indentUsingSpaces', EDITOR_CATEGORY_KEY); - export const INDENT_USING_TABS = Command.toLocalizedCommand({ + }); + export const INDENT_USING_TABS = Command.toDefaultLocalizedCommand({ id: 'textEditor.commands.indentUsingTabs', category: EDITOR_CATEGORY, label: 'Indent Using Tabs' - }, 'vscode/indentation/indentUsingTabs', EDITOR_CATEGORY_KEY); - export const CHANGE_LANGUAGE = Command.toLocalizedCommand({ + }); + export const CHANGE_LANGUAGE = Command.toDefaultLocalizedCommand({ id: 'textEditor.change.language', category: EDITOR_CATEGORY, label: 'Change Language Mode' - }, 'vscode/editorStatus/changeMode', EDITOR_CATEGORY_KEY); - export const CHANGE_ENCODING = Command.toLocalizedCommand({ + }); + export const CHANGE_ENCODING = Command.toDefaultLocalizedCommand({ id: 'textEditor.change.encoding', category: EDITOR_CATEGORY, label: 'Change File Encoding' - }, 'vscode/editorStatus/changeEncoding', EDITOR_CATEGORY_KEY); - export const REVERT_EDITOR = Command.toLocalizedCommand({ + }); + export const REVERT_EDITOR = Command.toDefaultLocalizedCommand({ id: 'workbench.action.files.revert', category: CommonCommands.FILE_CATEGORY, label: 'Revert File', - }, 'vscode/fileActions.contribution/revert', CommonCommands.FILE_CATEGORY_KEY); - export const REVERT_AND_CLOSE = Command.toLocalizedCommand({ + }); + export const REVERT_AND_CLOSE = Command.toDefaultLocalizedCommand({ id: 'workbench.action.revertAndCloseActiveEditor', category: CommonCommands.VIEW_CATEGORY, label: 'Revert and Close Editor' - }, 'vscode/editorActions/revertAndCloseActiveEditor', EDITOR_CATEGORY_KEY); + }); /** * Command for going back to the last editor navigation location. */ - export const GO_BACK = Command.toLocalizedCommand({ + export const GO_BACK = Command.toDefaultLocalizedCommand({ id: 'textEditor.commands.go.back', category: EDITOR_CATEGORY, label: 'Go Back' - }, 'vscode/editorActions/navigatePrevious', EDITOR_CATEGORY_KEY); + }); /** * Command for going to the forthcoming editor navigation location. */ - export const GO_FORWARD = Command.toLocalizedCommand({ + export const GO_FORWARD = Command.toDefaultLocalizedCommand({ id: 'textEditor.commands.go.forward', category: EDITOR_CATEGORY, label: 'Go Forward' - }, 'vscode/editorActions/navigateNext', EDITOR_CATEGORY_KEY); + }); /** * Command that reveals the last text edit location, if any. */ - export const GO_LAST_EDIT = Command.toLocalizedCommand({ + export const GO_LAST_EDIT = Command.toDefaultLocalizedCommand({ id: 'textEditor.commands.go.lastEdit', category: EDITOR_CATEGORY, label: 'Go to Last Edit Location' - }, 'vscode/editorActions/navigateToLastEditLocation', EDITOR_CATEGORY_KEY); + }); /** * Command that clears the editor navigation history. */ - export const CLEAR_EDITOR_HISTORY = Command.toLocalizedCommand({ + export const CLEAR_EDITOR_HISTORY = Command.toDefaultLocalizedCommand({ id: 'textEditor.commands.clear.history', category: EDITOR_CATEGORY, label: 'Clear Editor History' - }, 'vscode/editorActions/clearEditorHistory', EDITOR_CATEGORY_KEY); + }); /** * Command that displays all editors that are currently opened. */ @@ -129,74 +129,74 @@ export namespace EditorCommands { /** * Command that toggles the minimap. */ - export const TOGGLE_MINIMAP = Command.toLocalizedCommand({ + export const TOGGLE_MINIMAP = Command.toDefaultLocalizedCommand({ id: 'editor.action.toggleMinimap', category: CommonCommands.VIEW_CATEGORY, label: 'Toggle Minimap' - }, 'vscode/toggleMinimap/toggleMinimap', EDITOR_CATEGORY_KEY); + }); /** * Command that toggles the rendering of whitespace characters in the editor. */ - export const TOGGLE_RENDER_WHITESPACE = Command.toLocalizedCommand({ + export const TOGGLE_RENDER_WHITESPACE = Command.toDefaultLocalizedCommand({ id: 'editor.action.toggleRenderWhitespace', category: CommonCommands.VIEW_CATEGORY, label: 'Toggle Render Whitespace' - }, 'vscode/toggleRenderWhitespace/toggleRenderWhitespace', EDITOR_CATEGORY_KEY); + }); /** * Command that toggles the word wrap. */ - export const TOGGLE_WORD_WRAP = Command.toLocalizedCommand({ + export const TOGGLE_WORD_WRAP = Command.toDefaultLocalizedCommand({ id: 'editor.action.toggleWordWrap', category: CommonCommands.VIEW_CATEGORY, label: 'Toggle Word Wrap' - }, 'vscode/toggleWordWrap/miToggleWordWrap', EDITOR_CATEGORY_KEY); + }); /** * Command that re-opens the last closed editor. */ - export const REOPEN_CLOSED_EDITOR = Command.toLocalizedCommand({ + export const REOPEN_CLOSED_EDITOR = Command.toDefaultLocalizedCommand({ id: 'workbench.action.reopenClosedEditor', category: CommonCommands.VIEW_CATEGORY, label: 'Reopen Closed Editor' - }, 'vscode/editorActions/reopenClosedEditor', EDITOR_CATEGORY_KEY); + }); /** * Opens a second instance of the current editor, splitting the view in the direction specified. */ - export const SPLIT_EDITOR_RIGHT = Command.toLocalizedCommand({ + export const SPLIT_EDITOR_RIGHT = Command.toDefaultLocalizedCommand({ id: 'workbench.action.splitEditorRight', category: CommonCommands.VIEW_CATEGORY, label: 'Split Editor Right' - }, 'vscode/editorActions/splitEditorGroupRight', EDITOR_CATEGORY_KEY); - export const SPLIT_EDITOR_DOWN = Command.toLocalizedCommand({ + }); + export const SPLIT_EDITOR_DOWN = Command.toDefaultLocalizedCommand({ id: 'workbench.action.splitEditorDown', category: CommonCommands.VIEW_CATEGORY, label: 'Split Editor Down' - }, 'vscode/editorActions/splitEditorGroupDown', EDITOR_CATEGORY_KEY); - export const SPLIT_EDITOR_UP = Command.toLocalizedCommand({ + }); + export const SPLIT_EDITOR_UP = Command.toDefaultLocalizedCommand({ id: 'workbench.action.splitEditorUp', category: CommonCommands.VIEW_CATEGORY, label: 'Split Editor Up' - }, 'vscode/editorActions/splitEditorGroupUp', EDITOR_CATEGORY_KEY); - export const SPLIT_EDITOR_LEFT = Command.toLocalizedCommand({ + }); + export const SPLIT_EDITOR_LEFT = Command.toDefaultLocalizedCommand({ id: 'workbench.action.splitEditorLeft', category: CommonCommands.VIEW_CATEGORY, label: 'Split Editor Left' - }, 'vscode/editorActions/splitEditorGroupLeft', EDITOR_CATEGORY_KEY); + }); /** * Default horizontal split: right. */ - export const SPLIT_EDITOR_HORIZONTAL = Command.toLocalizedCommand({ + export const SPLIT_EDITOR_HORIZONTAL = Command.toDefaultLocalizedCommand({ id: 'workbench.action.splitEditor', category: CommonCommands.VIEW_CATEGORY, label: 'Split Editor' - }, 'vscode/editorActions/splitEditor', EDITOR_CATEGORY_KEY); + }); /** * Default vertical split: down. */ - export const SPLIT_EDITOR_VERTICAL = Command.toLocalizedCommand({ + export const SPLIT_EDITOR_VERTICAL = Command.toDefaultLocalizedCommand({ id: 'workbench.action.splitEditorOrthogonal', category: CommonCommands.VIEW_CATEGORY, label: 'Split Editor Orthogonal' - }, 'vscode/editorActions/splitEditorOrthogonal', EDITOR_CATEGORY_KEY); + }); } @injectable() @@ -286,11 +286,11 @@ export class EditorCommandContribution implements CommandContribution { } const current = editor.document.languageId; const items: Array | QuickPickItem> = [ - { label: nls.localize('vscode/editorStatus/autoDetect', 'Auto Detect'), value: 'autoDetect' }, - { type: 'separator', label: nls.localize('vscode/editorStatus/languagesPicks', 'languages (identifier)') }, + { label: nls.localizeByDefault('Auto Detect'), value: 'autoDetect' }, + { type: 'separator', label: nls.localizeByDefault('languages (identifier)') }, ... (this.languages.languages.map(language => this.toQuickPickLanguage(language, current))).sort((e, e2) => e.label.localeCompare(e2.label)) ]; - const selectedMode = await this.quickInputService?.showQuickPick(items, { placeholder: nls.localize('vscode/editorStatus/selectLanguageMode', 'Select Language Mode') }); + const selectedMode = await this.quickInputService?.showQuickPick(items, { placeholder: nls.localizeByDefault('Select Language Mode') }); if (selectedMode && ('value' in selectedMode)) { if (selectedMode.value === 'autoDetect') { editor.detectLanguage(); @@ -311,13 +311,13 @@ export class EditorCommandContribution implements CommandContribution { if (!editor) { return; } - const reopenWithEncodingPick = { label: nls.localize('vscode/editorStatus/reopenWithEncoding', 'Reopen with Encoding'), value: 'reopen' }; - const saveWithEncodingPick = { label: nls.localize('vscode/editorStatus/saveWithEncoding', 'Save with Encoding'), value: 'save' }; + const reopenWithEncodingPick = { label: nls.localizeByDefault('Reopen with Encoding'), value: 'reopen' }; + const saveWithEncodingPick = { label: nls.localizeByDefault('Save with Encoding'), value: 'save' }; const actionItems: QuickPickValue[] = [ reopenWithEncodingPick, saveWithEncodingPick ]; - const selectedEncoding = await this.quickInputService?.showQuickPick(actionItems, { placeholder: nls.localize('vscode/editorStatus/pickAction', 'Select Action') }); + const selectedEncoding = await this.quickInputService?.showQuickPick(actionItems, { placeholder: nls.localizeByDefault('Select Action') }); if (!selectedEncoding) { return; } @@ -350,14 +350,14 @@ export class EditorCommandContribution implements CommandContribution { // Insert guessed encoding if (guessedEncoding && configuredEncoding !== guessedEncoding && SUPPORTED_ENCODINGS[guessedEncoding]) { encodingItems.unshift({ - label: `${nls.localize('vscode/editorStatus/guessedEncoding', 'Guessed from content')}: ${SUPPORTED_ENCODINGS[guessedEncoding].labelLong}`, + label: `${nls.localizeByDefault('Guessed from content')}: ${SUPPORTED_ENCODINGS[guessedEncoding].labelLong}`, value: { id: guessedEncoding, description: guessedEncoding } }); } const selectedFileEncoding = await this.quickInputService?.showQuickPick>(encodingItems, { placeholder: isReopenWithEncoding ? - nls.localize('vscode/editorStatus/pickEncodingForReopen', 'Select File Encoding to Reopen File') : - nls.localize('vscode/editorStatus/pickEncodingForSave', 'Select File Encoding to Save with') + nls.localizeByDefault('Select File Encoding to Reopen File') : + nls.localizeByDefault('Select File Encoding to Save with') }); if (!selectedFileEncoding) { @@ -379,7 +379,7 @@ export class EditorCommandContribution implements CommandContribution { return { value, label: value.name, - description: nls.localize(`vscode/editorStatus/languageDescription${configured ? '' : 'Configured'}`, `({0})${configured ? ' - Configured Language' : ''}`), + description: nls.localizeByDefault(`({0})${configured ? ' - Configured Language' : ''}`), iconClasses }; } diff --git a/packages/editor/src/browser/editor-contribution.ts b/packages/editor/src/browser/editor-contribution.ts index 4f2935e2fad62..c48e4a5c4de4f 100644 --- a/packages/editor/src/browser/editor-contribution.ts +++ b/packages/editor/src/browser/editor-contribution.ts @@ -95,7 +95,7 @@ export class EditorContribution implements FrontendApplicationContribution, Comm alignment: StatusBarAlignment.RIGHT, priority: 1, command: EditorCommands.CHANGE_LANGUAGE.id, - tooltip: nls.localize('vscode/editorStatus/selectLanguageMode', 'Select Language Mode') + tooltip: nls.localizeByDefault('Select Language Mode') }); } @@ -109,7 +109,7 @@ export class EditorContribution implements FrontendApplicationContribution, Comm alignment: StatusBarAlignment.RIGHT, priority: 10, command: EditorCommands.CHANGE_ENCODING.id, - tooltip: nls.localize('vscode/editorStatus/selectEncoding', 'Select Encoding') + tooltip: nls.localizeByDefault('Select Encoding') }); } @@ -120,7 +120,7 @@ export class EditorContribution implements FrontendApplicationContribution, Comm } const { cursor } = editor; this.statusBar.setElement('editor-status-cursor-position', { - text: nls.localize('vscode/editorStatus/singleSelection', 'Ln {0}, Col {1}', (cursor.line + 1).toString(), editor.getVisibleColumn(cursor).toString()), + text: nls.localizeByDefault('Ln {0}, Col {1}', cursor.line + 1, editor.getVisibleColumn(cursor)), alignment: StatusBarAlignment.RIGHT, priority: 100, tooltip: EditorCommands.GOTO_LINE_COLUMN.label, diff --git a/packages/editor/src/browser/editor-menu.ts b/packages/editor/src/browser/editor-menu.ts index 2a331b689f33c..004c76ee189b2 100644 --- a/packages/editor/src/browser/editor-menu.ts +++ b/packages/editor/src/browser/editor-menu.ts @@ -87,7 +87,7 @@ export class EditorMenuContribution implements MenuContribution { }); // Editor navigation. Go > Back and Go > Forward. - registry.registerSubmenu(EditorMainMenu.GO, nls.localize('vscode/menubar/mGoto', 'Go')); + registry.registerSubmenu(EditorMainMenu.GO, nls.localizeByDefault('Go')); registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, { commandId: EditorCommands.GO_BACK.id, label: EditorCommands.GO_BACK.label, @@ -100,7 +100,7 @@ export class EditorMenuContribution implements MenuContribution { }); registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, { commandId: EditorCommands.GO_LAST_EDIT.id, - label: nls.localize('vscode/editor.contribution/miLastEditLocation', 'Last Edit Location'), + label: nls.localizeByDefault('Last Edit Location'), order: '3' }); @@ -127,7 +127,7 @@ export class EditorMenuContribution implements MenuContribution { }); registry.registerMenuAction(CommonMenus.FILE_CLOSE, { commandId: CommonCommands.CLOSE_MAIN_TAB.id, - label: nls.localize('vscode/editor.contribution/closeEditor', 'Close Editor'), + label: nls.localizeByDefault('Close Editor'), order: '1' }); } diff --git a/packages/editor/src/browser/editor-preferences.ts b/packages/editor/src/browser/editor-preferences.ts index 430fc62a3b28d..2507e23e3ef98 100644 --- a/packages/editor/src/browser/editor-preferences.ts +++ b/packages/editor/src/browser/editor-preferences.ts @@ -78,7 +78,7 @@ const codeEditorPreferenceProperties = { 'type': 'number', 'default': EDITOR_MODEL_DEFAULTS.tabSize, 'minimum': 1, - 'markdownDescription': nls.localize('vscode/commonEditorConfig/tabSize', 'The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.') + 'markdownDescription': nls.localizeByDefault('The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.') }, 'editor.defaultFormatter': { 'type': 'string', @@ -88,105 +88,105 @@ const codeEditorPreferenceProperties = { 'editor.insertSpaces': { 'type': 'boolean', 'default': EDITOR_MODEL_DEFAULTS.insertSpaces, - 'markdownDescription': nls.localize('vscode/commonEditorConfig/insertSpaces', 'Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.') + 'markdownDescription': nls.localizeByDefault('Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.') }, 'editor.detectIndentation': { 'type': 'boolean', 'default': EDITOR_MODEL_DEFAULTS.detectIndentation, - 'markdownDescription': nls.localize('vscode/commonEditorConfig/detectIndentation', 'Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.') + 'markdownDescription': nls.localizeByDefault('Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.') }, 'editor.trimAutoWhitespace': { 'type': 'boolean', 'default': EDITOR_MODEL_DEFAULTS.trimAutoWhitespace, - 'description': nls.localize('vscode/commonEditorConfig/trimAutoWhitespace', 'Remove trailing auto inserted whitespace.') + 'description': nls.localizeByDefault('Remove trailing auto inserted whitespace.') }, 'editor.largeFileOptimizations': { 'type': 'boolean', 'default': EDITOR_MODEL_DEFAULTS.largeFileOptimizations, - 'description': nls.localize('vscode/commonEditorConfig/largeFileOptimizations', 'Special handling for large files to disable certain memory intensive features.') + 'description': nls.localizeByDefault('Special handling for large files to disable certain memory intensive features.') }, 'editor.wordBasedSuggestions': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/commonEditorConfig/wordBasedSuggestions', 'Controls whether completions should be computed based on words in the document.') + 'description': nls.localizeByDefault('Controls whether completions should be computed based on words in the document.') }, 'editor.wordBasedSuggestionsMode': { 'enum': ['currentDocument', 'matchingDocuments', 'allDocuments'], 'default': 'matchingDocuments', 'enumDescriptions': [ - nls.localize('vscode/commonEditorConfig/wordBasedSuggestionsMode.currentDocument', 'Only suggest words from the active document.'), - nls.localize('vscode/commonEditorConfig/wordBasedSuggestionsMode.matchingDocuments', 'Suggest words from all open documents of the same language.'), - nls.localize('vscode/commonEditorConfig/wordBasedSuggestionsMode.allDocuments', 'Suggest words from all open documents.') + nls.localizeByDefault('Only suggest words from the active document.'), + nls.localizeByDefault('Suggest words from all open documents of the same language.'), + nls.localizeByDefault('Suggest words from all open documents.') ], - 'description': nls.localize('vscode/commonEditorConfig/wordBasedSuggestionsMode', 'Controls form what documents word based completions are computed.') + 'description': nls.localizeByDefault('Controls form what documents word based completions are computed.') }, 'editor.semanticHighlighting.enabled': { 'enum': [true, false, 'configuredByTheme'], 'enumDescriptions': [ - nls.localize('vscode/commonEditorConfig/semanticHighlighting.true', 'Semantic highlighting enabled for all color themes.'), - nls.localize('vscode/commonEditorConfig/semanticHighlighting.false', 'Semantic highlighting disabled for all color themes.'), - nls.localize('vscode/commonEditorConfig/semanticHighlighting.configuredByTheme', 'Semantic highlighting is configured by the current color theme\'s `semanticHighlighting` setting.') + nls.localizeByDefault('Semantic highlighting enabled for all color themes.'), + nls.localizeByDefault('Semantic highlighting disabled for all color themes.'), + nls.localizeByDefault('Semantic highlighting is configured by the current color theme\'s `semanticHighlighting` setting.') ], 'default': 'configuredByTheme', - 'description': nls.localize('vscode/commonEditorConfig/emanticHighlighting.enabled', 'Controls whether the semanticHighlighting is shown for the languages that support it.') + 'description': nls.localizeByDefault('Controls whether the semanticHighlighting is shown for the languages that support it.') }, 'editor.stablePeek': { 'type': 'boolean', 'default': false, - 'markdownDescription': nls.localize('vscode/commonEditorConfig/stablePeek', 'Keep peek editors open even when double clicking their content or when hitting `Escape`.') + 'markdownDescription': nls.localizeByDefault('Keep peek editors open even when double clicking their content or when hitting `Escape`.') }, 'editor.maxTokenizationLineLength': { 'type': 'integer', 'default': 400, - 'description': nls.localize('vscode/commonEditorConfig/maxTokenizationLineLength', 'Lines above this length will not be tokenized for performance reasons.') + 'description': nls.localizeByDefault('Lines above this length will not be tokenized for performance reasons') }, 'diffEditor.maxComputationTime': { 'type': 'number', 'default': 5000, - 'description': nls.localize('vscode/commonEditorConfig/maxComputationTime', 'Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.') + 'description': nls.localizeByDefault('Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.') }, 'diffEditor.renderSideBySide': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/commonEditorConfig/sideBySide', 'Controls whether the diff editor shows the diff side by side or inline.') + 'description': nls.localizeByDefault('Controls whether the diff editor shows the diff side by side or inline.') }, 'diffEditor.ignoreTrimWhitespace': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/commonEditorConfig/ignoreTrimWhitespace', 'When enabled, the diff editor ignores changes in leading or trailing whitespace.') + 'description': nls.localizeByDefault('When enabled, the diff editor ignores changes in leading or trailing whitespace.') }, 'diffEditor.renderIndicators': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/commonEditorConfig/renderIndicators', 'Controls whether the diff editor shows +/- indicators for added/removed changes.') + 'description': nls.localizeByDefault('Controls whether the diff editor shows +/- indicators for added/removed changes.') }, 'diffEditor.codeLens': { 'type': 'boolean', 'default': false, - 'description': nls.localize('vscode/commonEditorConfig/codeLens', 'Controls whether the editor shows CodeLens.') + 'description': nls.localizeByDefault('Controls whether the editor shows CodeLens.') }, 'diffEditor.wordWrap': { 'type': 'string', 'enum': ['off', 'on', 'inherit'], 'default': 'inherit', 'markdownEnumDescriptions': [ - nls.localize('vscode/commonEditorConfig/wordWrap.off', 'Lines will never wrap.'), - nls.localize('vscode/commonEditorConfig/wordWrap.on', 'Lines will wrap at the viewport width.'), - nls.localize('vscode/commonEditorConfig/wordWrap.inherit', 'Lines will wrap according to the `#editor.wordWrap#` setting.') + nls.localizeByDefault('Lines will never wrap.'), + nls.localizeByDefault('Lines will wrap at the viewport width.'), + nls.localizeByDefault('Lines will wrap according to the `#editor.wordWrap#` setting.') ] }, 'editor.acceptSuggestionOnCommitCharacter': { - 'markdownDescription': nls.localize('vscode/editorOptions/acceptSuggestionOnCommitCharacter', 'Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.'), + 'markdownDescription': nls.localizeByDefault('Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.'), 'type': 'boolean', 'default': true }, 'editor.acceptSuggestionOnEnter': { 'markdownEnumDescriptions': [ '', - nls.localize('vscode/editorOptions/acceptSuggestionOnEnterSmart', 'Only accept a suggestion with `Enter` when it makes a textual change.'), + nls.localizeByDefault('Only accept a suggestion with `Enter` when it makes a textual change.'), '' ], - 'markdownDescription': nls.localize('vscode/editorOptions/acceptSuggestionOnEnter', 'Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.'), + 'markdownDescription': nls.localizeByDefault('Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.'), 'type': 'string', 'enum': [ 'on', @@ -203,15 +203,15 @@ const codeEditorPreferenceProperties = { 'off' ], 'enumDescriptions': [ - nls.localize('vscode/editorOptions/accessibilitySupport.auto', 'The editor will use platform APIs to detect when a Screen Reader is attached.'), - nls.localize('vscode/editorOptions/accessibilitySupport.on', 'The editor will be permanently optimized for usage with a Screen Reader.'), - nls.localize('vscode/editorOptions/accessibilitySupport.off', 'The editor will never be optimized for usage with a Screen Reader.') + nls.localizeByDefault('The editor will use platform APIs to detect when a Screen Reader is attached.'), + nls.localizeByDefault('The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled.'), + nls.localizeByDefault('The editor will never be optimized for usage with a Screen Reader.') ], 'default': 'auto', - 'description': nls.localize('vscode/editorOptions/accessibilitySupport', 'Controls whether the editor should run in a mode where it is optimized for screen readers.') + 'description': nls.localizeByDefault('Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.') }, 'editor.accessibilityPageSize': { - 'description': nls.localize('vscode/editorOptions/accessibilityPageSize', 'Controls the number of lines in the editor that can be read out by a screen reader. Warning: this has a performance implication for numbers larger than the default.'), + 'description': nls.localizeByDefault('Controls the number of lines in the editor that can be read out by a screen reader. Warning: this has a performance implication for numbers larger than the default.'), 'type': 'integer', 'default': 10, 'minimum': 1, @@ -220,11 +220,11 @@ const codeEditorPreferenceProperties = { 'editor.autoClosingBrackets': { 'enumDescriptions': [ '', - nls.localize('vscode/editorOptions/languageDefined', 'Use language configurations to determine when to autoclose brackets.'), - nls.localize('vscode/editorOptions/beforeWhitespace', 'Autoclose brackets only when the cursor is to the left of whitespace.'), + nls.localizeByDefault('Use language configurations to determine when to autoclose brackets.'), + nls.localizeByDefault('Autoclose brackets only when the cursor is to the left of whitespace.'), '' ], - 'description': nls.localize('vscode/editorOptions/autoClosingBrackets', 'Controls whether the editor should automatically close brackets after the user adds an opening bracket.'), + 'description': nls.localizeByDefault('Controls whether the editor should automatically close brackets after the user adds an opening bracket.'), 'type': 'string', 'enum': [ 'always', @@ -237,10 +237,10 @@ const codeEditorPreferenceProperties = { 'editor.autoClosingOvertype': { 'enumDescriptions': [ '', - nls.localize('vscode/editorOptions/editor.autoClosingDelete.auto', 'Type over closing quotes or brackets only if they were automatically inserted.'), + nls.localizeByDefault('Type over closing quotes or brackets only if they were automatically inserted.'), '' ], - 'description': nls.localize('vscode/editorOptions/autoClosingDelete', 'Controls whether the editor should type over closing quotes or brackets.'), + 'description': nls.localizeByDefault('Controls whether the editor should type over closing quotes or brackets.'), 'type': 'string', 'enum': [ 'always', @@ -252,11 +252,11 @@ const codeEditorPreferenceProperties = { 'editor.autoClosingQuotes': { 'enumDescriptions': [ '', - nls.localize('vscode/editorOptions/editor.autoClosingQuotes.languageDefined', 'Use language configurations to determine when to autoclose quotes.'), - nls.localize('vscode/editorOptions/editor.autoClosingQuotes.beforeWhitespace', 'Autoclose quotes only when the cursor is to the left of whitespace.'), + nls.localizeByDefault('Use language configurations to determine when to autoclose quotes.'), + nls.localizeByDefault('Autoclose quotes only when the cursor is to the left of whitespace.'), '' ], - 'description': nls.localize('vscode/editorOptions/autoClosingQuotes', 'Controls whether the editor should automatically close quotes after the user adds an opening quote.'), + 'description': nls.localizeByDefault('Controls whether the editor should automatically close quotes after the user adds an opening quote.'), 'type': 'string', 'enum': [ 'always', @@ -268,13 +268,13 @@ const codeEditorPreferenceProperties = { }, 'editor.autoIndent': { 'enumDescriptions': [ - nls.localize('vscode/editorOptions/editor.autoIndent.none', 'The editor will not insert indentation automatically.'), - nls.localize('vscode/editorOptions/editor.autoIndent.keep', 'The editor will keep the current line\'s indentation.'), - nls.localize('vscode/editorOptions/editor.autoIndent.brackets', 'The editor will keep the current line\'s indentation and honor language defined brackets.'), - nls.localize('vscode/editorOptions/editor.autoIndent.advanced', 'The editor will keep the current line\'s indentation, honor language defined brackets and invoke special onEnterRules defined by languages.'), - nls.localize('vscode/editorOptions/editor.autoIndent.full', 'The editor will keep the current line\'s indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.') + nls.localizeByDefault('The editor will not insert indentation automatically.'), + nls.localizeByDefault('The editor will keep the current line\'s indentation.'), + nls.localizeByDefault('The editor will keep the current line\'s indentation and honor language defined brackets.'), + nls.localizeByDefault('The editor will keep the current line\'s indentation, honor language defined brackets and invoke special onEnterRules defined by languages.'), + nls.localizeByDefault('The editor will keep the current line\'s indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.') ], - 'description': nls.localize('vscode/editorOptions/autoIndent', 'Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.'), + 'description': nls.localizeByDefault('Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.'), 'type': 'string', 'enum': [ 'none', @@ -287,12 +287,12 @@ const codeEditorPreferenceProperties = { }, 'editor.autoSurround': { 'enumDescriptions': [ - nls.localize('vscode/editorOptions/editor.autoSurround.languageDefined', 'Use language configurations to determine when to automatically surround selections.'), - nls.localize('vscode/editorOptions/editor.autoSurround.quotes', 'Surround with quotes but not brackets.'), - nls.localize('vscode/editorOptions/editor.autoSurround.brackets', 'Surround with brackets but not quotes.'), + nls.localizeByDefault('Use language configurations to determine when to automatically surround selections.'), + nls.localizeByDefault('Surround with quotes but not brackets.'), + nls.localizeByDefault('Surround with brackets but not quotes.'), '' ], - 'description': nls.localize('vscode/editorOptions/autoSurround', 'Controls whether the editor should automatically surround selections.'), + 'description': nls.localizeByDefault('Controls whether the editor should automatically surround selections when typing quotes or brackets.'), 'type': 'string', 'enum': [ 'languageDefined', @@ -313,12 +313,12 @@ const codeEditorPreferenceProperties = { 'description': nls.localize('theia/editor/automaticLayout', 'Enable that the editor will install an interval to check if its container dom node size has changed. Enabling this might have a severe performance impact.') }, 'editor.codeLens': { - 'description': nls.localize('vscode/editorOptions/codeLens', 'Controls whether the editor shows CodeLens.'), + 'description': nls.localizeByDefault('Controls whether the editor shows CodeLens.'), 'type': 'boolean', 'default': true }, 'editor.codeLensFontFamily': { - 'description': nls.localize('vscode/editorOptions/codeLensFontFamily', 'Controls the font family for CodeLens.'), + 'description': nls.localizeByDefault('Controls the font family for CodeLens.'), 'type': 'string', 'default': true }, @@ -327,22 +327,22 @@ const codeEditorPreferenceProperties = { 'default': 0, 'minimum': 0, 'maximum': 100, - 'description': nls.localize('vscode/editorOptions/codeLensFontSize', 'Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.') + 'description': nls.localizeByDefault('Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.') }, 'editor.colorDecorators': { - 'description': nls.localize('vscode/editorOptions/colorDecorators', 'Controls whether the editor should render the inline color decorators and color picker.'), + 'description': nls.localizeByDefault('Controls whether the editor should render the inline color decorators and color picker.'), 'type': 'boolean', 'default': true }, 'editor.comments.insertSpace': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/comments.insertSpace', 'Controls whether a space character is inserted when commenting.') + 'description': nls.localizeByDefault('Controls whether a space character is inserted when commenting.') }, 'editor.comments.ignoreEmptyLines': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/comments.ignoreEmptyLines', 'Controls if empty lines should be ignored with toggle, add or remove actions for line comments.') + 'description': nls.localizeByDefault('Controls if empty lines should be ignored with toggle, add or remove actions for line comments.') }, 'editor.contextmenu': { 'description': nls.localize('theia/editor/contextmenu', 'Controls whether to enable the custom contextmenu.'), @@ -350,12 +350,12 @@ const codeEditorPreferenceProperties = { 'default': true, }, 'editor.copyWithSyntaxHighlighting': { - 'description': nls.localize('vscode/editorOptions/copyWithSyntaxHighlighting', 'Controls whether syntax highlighting should be copied into the clipboard.'), + 'description': nls.localizeByDefault('Controls whether syntax highlighting should be copied into the clipboard.'), 'type': 'boolean', 'default': true }, 'editor.cursorBlinking': { - 'description': nls.localize('vscode/editorOptions/cursorBlinking', 'Control the cursor animation style.'), + 'description': nls.localizeByDefault('Control the cursor animation style.'), 'type': 'string', 'enum': [ 'blink', @@ -367,12 +367,12 @@ const codeEditorPreferenceProperties = { 'default': 'blink' }, 'editor.cursorSmoothCaretAnimation': { - 'description': nls.localize('vscode/editorOptions/cursorSmoothCaretAnimation', 'Controls whether the smooth caret animation should be enabled.'), + 'description': nls.localizeByDefault('Controls whether the smooth caret animation should be enabled.'), 'type': 'boolean', 'default': false }, 'editor.cursorStyle': { - 'description': nls.localize('vscode/editorOptions/cursorStyle', 'Controls the cursor style.'), + 'description': nls.localizeByDefault('Controls the cursor style.'), 'type': 'string', 'enum': [ 'line', @@ -385,7 +385,7 @@ const codeEditorPreferenceProperties = { 'default': 'line' }, 'editor.cursorSurroundingLines': { - 'description': nls.localize('vscode/editorOptions/cursorSurroundingLines', 'Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as `scrollOff` or `scrollOffset` in some other editors.'), + 'description': nls.localizeByDefault("Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors."), 'type': 'integer', 'default': 0, 'minimum': 0, @@ -393,10 +393,10 @@ const codeEditorPreferenceProperties = { }, 'editor.cursorSurroundingLinesStyle': { 'enumDescriptions': [ - nls.localize('vscode/editorOptions/cursorSurroundingLinesStyle.default', '`cursorSurroundingLines` is enforced only when triggered via the keyboard or API.'), - nls.localize('vscode/editorOptions/cursorSurroundingLinesStyle.all', '`cursorSurroundingLines` is enforced always.') + nls.localizeByDefault('`cursorSurroundingLines` is enforced only when triggered via the keyboard or API.'), + nls.localizeByDefault('`cursorSurroundingLines` is enforced always.') ], - 'description': nls.localize('vscode/editorOptions/cursorSurroundingLinesStyle', 'Controls when `cursorSurroundingLines` should be enforced.'), + 'description': nls.localizeByDefault('Controls when `cursorSurroundingLines` should be enforced.'), 'type': 'string', 'enum': [ 'default', @@ -405,7 +405,7 @@ const codeEditorPreferenceProperties = { 'default': 'default' }, 'editor.cursorWidth': { - 'markdownDescription': nls.localize('vscode/editorOptions/cursorWidth', 'Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.'), + 'markdownDescription': nls.localizeByDefault('Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.'), 'type': 'integer', 'default': 0, 'minimum': 0, @@ -422,12 +422,12 @@ const codeEditorPreferenceProperties = { 'default': false }, 'editor.dragAndDrop': { - 'description': nls.localize('vscode/editorOptions/dragAndDrop', 'Controls whether the editor should allow moving selections via drag and drop.'), + 'description': nls.localizeByDefault('Controls whether the editor should allow moving selections via drag and drop.'), 'type': 'boolean', 'default': true }, 'editor.emptySelectionClipboard': { - 'description': nls.localize('vscode/editorOptions/emptySelectionClipboard', 'Controls whether copying without a selection copies the current line.'), + 'description': nls.localizeByDefault('Controls whether copying without a selection copies the current line.'), 'type': 'boolean', 'default': true }, @@ -437,19 +437,19 @@ const codeEditorPreferenceProperties = { 'default': '' }, 'editor.fastScrollSensitivity': { - 'markdownDescription': nls.localize('vscode/editorOptions/fastScrollSensitivity', 'Scrolling speed multiplier when pressing `Alt`.'), + 'markdownDescription': nls.localizeByDefault('Scrolling speed multiplier when pressing `Alt`.'), 'type': 'number', 'default': 5 }, 'editor.find.cursorMoveOnType': { - 'description': nls.localize('vscode/editorOptions/find.cursorMoveOnType', 'Controls whether the cursor should jump to find matches while typing.'), + 'description': nls.localizeByDefault('Controls whether the cursor should jump to find matches while typing.'), 'type': 'boolean', 'default': true }, 'editor.find.seedSearchStringFromSelection': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/find.seedSearchStringFromSelection', 'Controls whether the search string in the Find Widget is seeded from the editor selection.') + 'description': nls.localizeByDefault('Controls whether the search string in the Find Widget is seeded from the editor selection.') }, 'editor.find.autoFindInSelection': { 'type': 'string', @@ -460,27 +460,27 @@ const codeEditorPreferenceProperties = { ], 'default': 'never', 'enumDescriptions': [ - nls.localize('vscode/editorOptions/editor.find.autoFindInSelection.never', 'Never turn on Find in selection automatically (default)'), - nls.localize('vscode/editorOptions/editor.find.autoFindInSelection.always', 'Always turn on Find in selection automatically'), - nls.localize('vscode/editorOptions/editor.find.autoFindInSelection.multiline', 'Turn on Find in selection automatically when multiple lines of content are selected.') + nls.localizeByDefault('Never turn on Find in selection automatically (default)'), + nls.localizeByDefault('Always turn on Find in selection automatically'), + nls.localizeByDefault('Turn on Find in selection automatically when multiple lines of content are selected.') ], - 'description': nls.localize('vscode/editorOptions/find.autoFindInSelection', 'Controls whether the find operation is carried out on selected text or the entire file in the editor.') + 'description': nls.localizeByDefault('Controls the condition for turning on find in selection automatically.') }, 'editor.find.globalFindClipboard': { 'type': 'boolean', 'default': false, - 'description': nls.localize('vscode/editorOptions/find.globalFindClipboard', 'Controls whether the Find Widget should read or modify the shared find clipboard on macOS.'), + 'description': nls.localizeByDefault('Controls whether the Find Widget should read or modify the shared find clipboard on macOS.'), 'included': isOSX }, 'editor.find.addExtraSpaceOnTop': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/find.addExtraSpaceOnTop', 'Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.') + 'description': nls.localizeByDefault('Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.') }, 'editor.find.loop': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/find.loop', 'Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.') + 'description': nls.localizeByDefault('Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.') }, 'editor.fixedOverflowWidgets': { 'markdownDescription': nls.localize('theia/editor/fixedOverflowWidgets', 'Controls whether to display overflow widgets as `fixed`.'), @@ -488,35 +488,35 @@ const codeEditorPreferenceProperties = { 'default': false, }, 'editor.folding': { - 'description': nls.localize('vscode/editorOptions/folding', 'Controls whether the editor has code folding enabled.'), + 'description': nls.localizeByDefault('Controls whether the editor has code folding enabled.'), 'type': 'boolean', 'default': true }, 'editor.foldingStrategy': { - 'markdownDescription': nls.localize('vscode/editorOptions/foldingStrategy', 'Controls the strategy for computing folding ranges. `auto` uses a language specific folding strategy, if available. `indentation` uses the indentation based folding strategy.'), + 'markdownDescription': nls.localizeByDefault('Controls the strategy for computing folding ranges.'), 'type': 'string', 'enum': [ 'auto', 'indentation' ], 'enumDescriptions': [ - nls.localize('vscode/editorOptions/foldingStrategy.auto', 'Use a language-specific folding strategy if available, else the indentation-based one.'), - nls.localize('vscode/editorOptions/foldingStrategy.indentation', 'Use the indentation-based folding strategy.'), + nls.localizeByDefault('Use a language-specific folding strategy if available, else the indentation-based one.'), + nls.localizeByDefault('Use the indentation-based folding strategy.'), ], 'default': 'auto' }, 'editor.foldingHighlight': { - 'description': nls.localize('vscode/editorOptions/foldingHighlight', 'Controls whether the editor should highlight folded ranges.'), + 'description': nls.localizeByDefault('Controls whether the editor should highlight folded ranges.'), 'type': 'boolean', 'default': true }, 'editor.unfoldOnClickAfterEndOfLine': { - 'description': nls.localize('vscode/editorOptions/unfoldOnClickAfterEndOfLine', 'Controls whether clicking on the empty content after a folded line will unfold the line.'), + 'description': nls.localizeByDefault('Controls whether clicking on the empty content after a folded line will unfold the line.'), 'type': 'boolean', 'default': false }, 'editor.fontFamily': { - 'description': nls.localize('vscode/editorOptions/fontFamily', 'Controls the font family.'), + 'description': nls.localizeByDefault('Controls the font family.'), 'type': 'string', 'default': EDITOR_FONT_DEFAULTS.fontFamily }, @@ -524,14 +524,14 @@ const codeEditorPreferenceProperties = { 'anyOf': [ { 'type': 'boolean', - 'description': nls.localize('vscode/editorOptions/fontLigatures', 'Enables/Disables font ligatures.') + 'description': nls.localizeByDefault("Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.") }, { 'type': 'string', - 'description': nls.localize('vscode/editorOptions/fontFeatureSettings', 'Explicit font-feature-settings.') + 'description': nls.localizeByDefault("Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.") } ], - 'description': nls.localize('vscode/editorOptions/fontLigaturesGeneral', 'Configures font ligatures.'), + 'description': nls.localizeByDefault("Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."), 'default': false }, 'editor.fontSize': { @@ -539,7 +539,7 @@ const codeEditorPreferenceProperties = { 'minimum': 6, 'maximum': 100, 'default': EDITOR_FONT_DEFAULTS.fontSize, - 'description': nls.localize('vscode/editorOptions/fontSize', 'Controls the font size in pixels.') + 'description': nls.localizeByDefault('Controls the font size in pixels.') }, 'editor.fontWeight': { 'enum': [ @@ -555,32 +555,32 @@ const codeEditorPreferenceProperties = { '800', '900' ], - 'description': nls.localize('vscode/editorOptions/fontWeight', 'Controls the font weight.'), + 'description': nls.localizeByDefault('Controls the font weight. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.'), 'type': 'string', 'default': EDITOR_FONT_DEFAULTS.fontWeight }, 'editor.formatOnPaste': { - 'description': nls.localize('vscode/editorOptions/formatOnPaste', 'Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.'), + 'description': nls.localizeByDefault('Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.'), 'type': 'boolean', 'default': false }, 'editor.formatOnType': { - 'description': nls.localize('vscode/editorOptions/formatOnType', 'Controls whether the editor should automatically format the line after typing.'), + 'description': nls.localizeByDefault('Controls whether the editor should automatically format the line after typing.'), 'type': 'boolean', 'default': false }, 'editor.glyphMargin': { - 'description': nls.localize('vscode/editorOptions/glyphMargin', 'Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.'), + 'description': nls.localizeByDefault('Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.'), 'type': 'boolean', 'default': true }, 'editor.gotoLocation.multiple': { 'type': 'string', 'default': '', - 'deprecationMessage': nls.localize('vscode/editorOptions/insertSpaces', 'This setting is deprecated, please use separate settings like `editor.editor.gotoLocation.multipleDefinitions` or `editor.editor.gotoLocation.multipleImplementations` instead.') + 'deprecationMessage': nls.localizeByDefault("This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.") }, 'editor.gotoLocation.multipleDefinitions': { - 'description': nls.localize('vscode/editorOptions/editor.editor.gotoLocation.multipleDefinitions', 'Controls the behavior the `Go to Definition`-command when multiple target locations exist.'), + 'description': nls.localizeByDefault("Controls the behavior the 'Go to Definition'-command when multiple target locations exist."), 'type': 'string', 'enum': [ 'peek', @@ -589,13 +589,13 @@ const codeEditorPreferenceProperties = { ], 'default': 'peek', 'enumDescriptions': [ - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others') + nls.localizeByDefault('Show peek view of the results (default)'), + nls.localizeByDefault('Go to the primary result and show a peek view'), + nls.localizeByDefault('Go to the primary result and enable peek-less navigation to others') ] }, 'editor.gotoLocation.multipleTypeDefinitions': { - 'description': nls.localize('vscode/editorOptions/editor.editor.gotoLocation.multipleTypeDefinitions', 'Controls the behavior the `Go to Type Definition`-command when multiple target locations exist.'), + 'description': nls.localizeByDefault("Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."), 'type': 'string', 'enum': [ 'peek', @@ -604,13 +604,13 @@ const codeEditorPreferenceProperties = { ], 'default': 'peek', 'enumDescriptions': [ - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others') + nls.localizeByDefault('Show peek view of the results (default)'), + nls.localizeByDefault('Go to the primary result and show a peek view'), + nls.localizeByDefault('Go to the primary result and enable peek-less navigation to others') ] }, 'editor.gotoLocation.multipleDeclarations': { - 'description': nls.localize('vscode/editorOptions/editor.editor.gotoLocation.multipleDeclarations', 'Controls the behavior the `Go to Declaration`-command when multiple target locations exist.'), + 'description': nls.localizeByDefault("Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."), 'type': 'string', 'enum': [ 'peek', @@ -619,13 +619,13 @@ const codeEditorPreferenceProperties = { ], 'default': 'peek', 'enumDescriptions': [ - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others') + nls.localizeByDefault('Show peek view of the results (default)'), + nls.localizeByDefault('Go to the primary result and show a peek view'), + nls.localizeByDefault('Go to the primary result and enable peek-less navigation to others') ] }, 'editor.gotoLocation.multipleImplementations': { - 'description': nls.localize('vscode/editorOptions/editor.editor.gotoLocation.multipleImplemenattions', 'Controls the behavior the `Go to Implementations`-command when multiple target locations exist.'), + 'description': nls.localizeByDefault("Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."), 'type': 'string', 'enum': [ 'peek', @@ -634,13 +634,13 @@ const codeEditorPreferenceProperties = { ], 'default': 'peek', 'enumDescriptions': [ - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others') + nls.localizeByDefault('Show peek view of the results (default)'), + nls.localizeByDefault('Go to the primary result and show a peek view'), + nls.localizeByDefault('Go to the primary result and enable peek-less navigation to others') ] }, 'editor.gotoLocation.multipleReferences': { - 'description': nls.localize('vscode/editorOptions/editor.editor.gotoLocation.multipleReferences', 'Controls the behavior the `Go to References`-command when multiple target locations exist.'), + 'description': nls.localizeByDefault("Controls the behavior the 'Go to References'-command when multiple target locations exist."), 'type': 'string', 'enum': [ 'peek', @@ -649,38 +649,38 @@ const codeEditorPreferenceProperties = { ], 'default': 'peek', 'enumDescriptions': [ - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'), - nls.localize('vscode/editorOptions/editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others') + nls.localizeByDefault('Show peek view of the results (default)'), + nls.localizeByDefault('Go to the primary result and show a peek view'), + nls.localizeByDefault('Go to the primary result and enable peek-less navigation to others') ] }, 'editor.gotoLocation.alternativeDefinitionCommand': { 'type': 'string', 'default': 'editor.action.goToReferences', - 'description': nls.localize('vscode/editorOptions/alternativeDefinitionCommand', 'Alternative command id that is being executed when the result of `Go to Definition` is the current location.') + 'description': nls.localizeByDefault("Alternative command id that is being executed when the result of 'Go to Definition' is the current location.") }, 'editor.gotoLocation.alternativeTypeDefinitionCommand': { 'type': 'string', 'default': 'editor.action.goToReferences', - 'description': nls.localize('vscode/editorOptions/alternativeTypeDefinitionCommand', 'Alternative command id that is being executed when the result of `Go to Type Definition` is the current location.') + 'description': nls.localizeByDefault("Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.") }, 'editor.gotoLocation.alternativeDeclarationCommand': { 'type': 'string', 'default': 'editor.action.goToReferences', - 'description': nls.localize('vscode/editorOptions/alternativeDeclarationCommand', 'Alternative command id that is being executed when the result of `Go to Declaration` is the current location.') + 'description': nls.localizeByDefault("Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.") }, 'editor.gotoLocation.alternativeImplementationCommand': { 'type': 'string', 'default': '', - 'description': nls.localize('vscode/editorOptions/alternativeImplementationCommand', 'Alternative command id that is being executed when the result of `Go to Implementation` is the current location.') + 'description': nls.localizeByDefault("Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.") }, 'editor.gotoLocation.alternativeReferenceCommand': { 'type': 'string', 'default': '', - 'description': nls.localize('vscode/editorOptions/alternativeReferenceCommand', 'Alternative command id that is being executed when the result of `Go to Reference` is the current location.') + 'description': nls.localizeByDefault("Alternative command id that is being executed when the result of 'Go to Reference' is the current location.") }, 'editor.hideCursorInOverviewRuler': { - 'description': nls.localize('vscode/editorOptions/hideCursorInOverviewRuler', 'Controls whether the cursor should be hidden in the overview ruler.'), + 'description': nls.localizeByDefault('Controls whether the cursor should be hidden in the overview ruler.'), 'type': 'boolean', 'default': false }, @@ -692,34 +692,34 @@ const codeEditorPreferenceProperties = { 'editor.hover.enabled': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/hover.enabled', 'Controls whether the hover is shown.') + 'description': nls.localizeByDefault('Controls whether the hover is shown.') }, 'editor.hover.delay': { 'type': 'number', 'default': 300, - 'description': nls.localize('vscode/editorOptions/hover.delay', 'Controls the delay in milliseconds after which the hover is shown.') + 'description': nls.localizeByDefault('Controls the delay in milliseconds after which the hover is shown.') }, 'editor.hover.sticky': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/hover.sticky', 'Controls whether the hover should remain visible when mouse is moved over it.') + 'description': nls.localizeByDefault('Controls whether the hover should remain visible when mouse is moved over it.') }, 'editor.inDiffEditor': { 'type': 'boolean', 'default': true, }, 'editor.letterSpacing': { - 'description': nls.localize('vscode/editorOptions/letterSpacing', 'Controls the letter spacing in pixels.'), + 'description': nls.localizeByDefault('Controls the letter spacing in pixels.'), 'type': 'number', 'default': EDITOR_FONT_DEFAULTS.letterSpacing }, 'editor.lightbulb.enabled': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/codeActions', 'Enables the code action lightbulb in the editor.') + 'description': nls.localizeByDefault('Enables the code action lightbulb in the editor.') }, 'editor.lineHeight': { - 'description': nls.localize('vscode/editorOptions/lineHeight', 'Controls the line height. Use 0 to compute the line height from the font size.'), + 'description': nls.localizeByDefault('Controls the line height. Use 0 to compute the line height from the font size.'), 'type': 'integer', 'default': EDITOR_FONT_DEFAULTS.lineHeight, 'minimum': 0, @@ -734,13 +734,13 @@ const codeEditorPreferenceProperties = { 'interval' ], 'enumDescriptions': [ - nls.localize('vscode/editorOptions/lineNumbers.off', 'Line numbers are not rendered.'), - nls.localize('vscode/editorOptions/lineNumbers.on', 'Line numbers are rendered as absolute number.'), - nls.localize('vscode/editorOptions/lineNumbers.relative', 'Line numbers are rendered as distance in lines to cursor position.'), - nls.localize('vscode/editorOptions/lineNumbers.interval', 'Line numbers are rendered every 10 lines.') + nls.localizeByDefault('Line numbers are not rendered.'), + nls.localizeByDefault('Line numbers are rendered as absolute number.'), + nls.localizeByDefault('Line numbers are rendered as distance in lines to cursor position.'), + nls.localizeByDefault('Line numbers are rendered every 10 lines.') ], 'default': 'on', - 'description': nls.localize('vscode/editorOptions/lineNumbers', 'Controls the display of line numbers.') + 'description': nls.localizeByDefault('Controls the display of line numbers.') }, 'editor.lineNumbersMinChars': { 'description': nls.localize('theia/editor/lineNumbersMinChars', 'Controls the line height. Use 0 to compute the line height from the font size.'), @@ -750,17 +750,17 @@ const codeEditorPreferenceProperties = { 'maximum': 300 }, 'editor.linkedEditing': { - 'description': nls.localize('vscode/editorOptions/linkedEditing', 'Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.'), + 'description': nls.localizeByDefault('Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.'), 'type': 'boolean', 'default': false }, 'editor.links': { - 'description': nls.localize('vscode/editorOptions/links', 'Controls whether the editor should detect links and make them clickable.'), + 'description': nls.localizeByDefault('Controls whether the editor should detect links and make them clickable.'), 'type': 'boolean', 'default': true }, 'editor.matchBrackets': { - 'description': nls.localize('vscode/editorOptions/matchBrackets', 'Highlight matching brackets.'), + 'description': nls.localizeByDefault('Highlight matching brackets.'), 'type': 'string', 'enum': [ 'always', @@ -772,7 +772,7 @@ const codeEditorPreferenceProperties = { 'editor.minimap.enabled': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/minimap.enabled', 'Controls whether the minimap is shown.') + 'description': nls.localizeByDefault('Controls whether the minimap is shown.') }, 'editor.minimap.side': { 'type': 'string', @@ -781,7 +781,7 @@ const codeEditorPreferenceProperties = { 'right' ], 'default': 'right', - 'description': nls.localize('vscode/editorOptions/minimap.side', 'Controls the side where to render the minimap.') + 'description': nls.localizeByDefault('Controls the side where to render the minimap.') }, 'editor.minimap.showSlider': { 'type': 'string', @@ -790,24 +790,24 @@ const codeEditorPreferenceProperties = { 'mouseover' ], 'default': 'mouseover', - 'description': nls.localize('vscode/editorOptions/minimap.showSlider', 'Controls when the minimap slider is shown.') + 'description': nls.localizeByDefault('Controls when the minimap slider is shown.') }, 'editor.minimap.scale': { 'type': 'number', 'default': 1, 'minimum': 1, 'maximum': 3, - 'description': nls.localize('vscode/editorOptions/minimap.scale', 'Scale of content drawn in the minimap.') + 'description': nls.localizeByDefault('Scale of content drawn in the minimap: 1, 2 or 3.') }, 'editor.minimap.renderCharacters': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/minimap.renderCharacters', 'Render the actual characters on a line as opposed to color blocks.') + 'description': nls.localizeByDefault('Render the actual characters on a line as opposed to color blocks.') }, 'editor.minimap.maxColumn': { 'type': 'number', 'default': 120, - 'description': nls.localize('vscode/editorOptions/minimap.maxColumn', 'Limit the width of the minimap to render at most a certain number of columns.') + 'description': nls.localizeByDefault('Limit the width of the minimap to render at most a certain number of columns.') }, 'editor.mouseStyle': { 'description': nls.localize('theia/editor/mouseStyle', 'Controls the mouse pointer style.'), @@ -816,26 +816,26 @@ const codeEditorPreferenceProperties = { 'default': 'text' }, 'editor.mouseWheelScrollSensitivity': { - 'markdownDescription': nls.localize('vscode/editorOptions/mouseWheelScrollSensitivity', 'A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.'), + 'markdownDescription': nls.localizeByDefault('A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.'), 'type': 'number', 'default': 1 }, 'editor.mouseWheelZoom': { - 'markdownDescription': nls.localize('vscode/editorOptions/mouseWheelZoom', 'Zoom the font of the editor when using mouse wheel and holding `Ctrl`.'), + 'markdownDescription': nls.localizeByDefault('Zoom the font of the editor when using mouse wheel and holding `Ctrl`.'), 'type': 'boolean', 'default': false }, 'editor.multiCursorMergeOverlapping': { - 'description': nls.localize('vscode/editorOptions/multiCursorMergeOverlapping', 'Merge multiple cursors when they are overlapping.'), + 'description': nls.localizeByDefault('Merge multiple cursors when they are overlapping.'), 'type': 'boolean', 'default': true }, 'editor.multiCursorModifier': { 'markdownEnumDescriptions': [ - nls.localize('vscode/editorOptions/multiCursorModifier.ctrlCmd', 'Maps to `Control` on Windows and Linux and to `Command` on macOS.'), - nls.localize('vscode/editorOptions/multiCursorModifier.alt', 'Maps to `Alt` on Windows and Linux and to `Option` on macOS.') + nls.localizeByDefault('Maps to `Control` on Windows and Linux and to `Command` on macOS.'), + nls.localizeByDefault('Maps to `Alt` on Windows and Linux and to `Option` on macOS.') ], - 'markdownDescription': nls.localize('vscode/editorOptions/multiCursorModifier', 'The modifier to be used to add multiple cursors with the mouse. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).'), + 'markdownDescription': nls.localizeByDefault('The modifier to be used to add multiple cursors with the mouse. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).'), 'type': 'string', 'enum': [ 'ctrlCmd', @@ -845,10 +845,10 @@ const codeEditorPreferenceProperties = { }, 'editor.multiCursorPaste': { 'markdownEnumDescriptions': [ - nls.localize('vscode/editorOptions/multiCursorPaste.spread', 'Each cursor pastes a single line of the text.'), - nls.localize('vscode/editorOptions/multiCursorPaste.full', 'Each cursor pastes the full text.') + nls.localizeByDefault('Each cursor pastes a single line of the text.'), + nls.localizeByDefault('Each cursor pastes the full text.') ], - 'markdownDescription': nls.localize('vscode/editorOptions/multiCursorPaste', 'Controls pasting when the line count of the pasted text matches the cursor count.'), + 'markdownDescription': nls.localizeByDefault('Controls pasting when the line count of the pasted text matches the cursor count.'), 'type': 'string', 'enum': [ 'spread', @@ -857,12 +857,12 @@ const codeEditorPreferenceProperties = { 'default': 'spread' }, 'editor.occurrencesHighlight': { - 'description': nls.localize('vscode/editorOptions/occurrencesHighlight', 'Controls whether the editor should highlight semantic symbol occurrences.'), + 'description': nls.localizeByDefault('Controls whether the editor should highlight semantic symbol occurrences.'), 'type': 'boolean', 'default': true }, 'editor.overviewRulerBorder': { - 'description': nls.localize('vscode/editorOptions/overviewRulerBorder', 'Controls whether a border should be drawn around the overview ruler.'), + 'description': nls.localizeByDefault('Controls whether a border should be drawn around the overview ruler.'), 'type': 'boolean', 'default': true }, @@ -878,31 +878,31 @@ const codeEditorPreferenceProperties = { 'default': 0, 'minimum': 0, 'maximum': 1000, - 'description': nls.localize('vscode/editorOptions/padding.top', 'Controls the amount of space between the top edge of the editor and the first line.') + 'description': nls.localizeByDefault('Controls the amount of space between the top edge of the editor and the first line.') }, 'editor.padding.bottom': { 'type': 'number', 'default': 0, 'minimum': 0, 'maximum': 1000, - 'description': nls.localize('vscode/editorOptions/padding.bottom', 'Controls the amount of space between the bottom edge of the editor and the last line.') + 'description': nls.localizeByDefault('Controls the amount of space between the bottom edge of the editor and the last line.') }, 'editor.parameterHints.enabled': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/parameterHints.enabled', 'Enables a pop-up that shows parameter documentation and type information as you type.') + 'description': nls.localizeByDefault('Enables a pop-up that shows parameter documentation and type information as you type.') }, 'editor.parameterHints.cycle': { 'type': 'boolean', 'default': false, - 'description': nls.localize('vscode/editorOptions/parameterHints.cycle', 'Controls whether the parameter hints menu cycles or closes when reaching the end of the list.') + 'description': nls.localizeByDefault('Controls whether the parameter hints menu cycles or closes when reaching the end of the list.') }, 'editor.peekWidgetDefaultFocus': { 'enumDescriptions': [ - nls.localize('vscode/editorOptions/peekWidgetDefaultFocus.tree', 'Focus the tree when opening peek'), - nls.localize('vscode/editorOptions/peekWidgetDefaultFocus.editor', 'Focus the editor when opening peek') + nls.localizeByDefault('Focus the tree when opening peek'), + nls.localizeByDefault('Focus the editor when opening peek') ], - 'description': nls.localize('vscode/editorOptions/peekWidgetDefaultFocus', 'Controls whether to focus the inline editor or the tree in the peek widget.'), + 'description': nls.localizeByDefault('Controls whether to focus the inline editor or the tree in the peek widget.'), 'type': 'string', 'enum': [ 'tree', @@ -913,7 +913,7 @@ const codeEditorPreferenceProperties = { 'editor.definitionLinkOpensInPeek': { 'type': 'boolean', 'default': false, - 'description': nls.localize('vscode/editorOptions/definitionLinkOpensInPeek', 'Controls whether the Go to Definition mouse gesture always opens the peek widget.') + 'description': nls.localizeByDefault('Controls whether the Go to Definition mouse gesture always opens the peek widget.') }, 'editor.quickSuggestions': { 'anyOf': [ @@ -926,17 +926,17 @@ const codeEditorPreferenceProperties = { 'strings': { 'type': 'boolean', 'default': false, - 'description': nls.localize('vscode/editorOptions/quickSuggestions.strings', 'Enable quick suggestions inside strings.') + 'description': nls.localizeByDefault('Enable quick suggestions inside strings.') }, 'comments': { 'type': 'boolean', 'default': false, - 'description': nls.localize('vscode/editorOptions/quickSuggestions.comments', 'Enable quick suggestions inside comments.') + 'description': nls.localizeByDefault('Enable quick suggestions inside comments.') }, 'other': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/quickSuggestions.other', 'Enable quick suggestions outside of strings and comments.') + 'description': nls.localizeByDefault('Enable quick suggestions outside of strings and comments.') } } } @@ -946,10 +946,10 @@ const codeEditorPreferenceProperties = { 'comments': false, 'strings': false }, - 'description': nls.localize('vscode/editorOptions/quickSuggestions', 'Controls whether suggestions should automatically show up while typing.') + 'description': nls.localizeByDefault('Controls whether suggestions should automatically show up while typing.') }, 'editor.quickSuggestionsDelay': { - 'description': nls.localize('vscode/editorOptions/quickSuggestionsDelay', 'Controls the delay in milliseconds after which quick suggestions will show up.'), + 'description': nls.localizeByDefault('Controls the delay in milliseconds after which quick suggestions will show up.'), 'type': 'integer', 'default': 10, 'minimum': 0, @@ -961,22 +961,22 @@ const codeEditorPreferenceProperties = { 'default': false }, 'editor.rename.enablePreview': { - 'description': nls.localize('vscode/rename/enablePreview', 'Controls whether the editor should display refactor preview pane for rename.'), + 'description': nls.localizeByDefault('Enable/disable the ability to preview changes before renaming'), 'type': 'boolean', 'default': true }, 'editor.renderControlCharacters': { - 'description': nls.localize('vscode/editorOptions/renderControlCharacters', 'Controls whether the editor should render control characters.'), + 'description': nls.localizeByDefault('Controls whether the editor should render control characters.'), 'type': 'boolean', 'default': false }, 'editor.renderIndentGuides': { - 'description': nls.localize('vscode/editorOptions/editor.guides.indentation', 'Controls whether the editor should render indent guides.'), + 'description': nls.localizeByDefault('Controls whether the editor should render indent guides.'), 'type': 'boolean', 'default': true }, 'editor.renderFinalNewline': { - 'description': nls.localize('vscode/editorOptions/renderFinalNewline', 'Render last line number when the file ends with a newline.'), + 'description': nls.localizeByDefault('Render last line number when the file ends with a newline.'), 'type': 'boolean', 'default': true }, @@ -985,9 +985,9 @@ const codeEditorPreferenceProperties = { '', '', '', - nls.localize('vscode/editorOptions/renderLineHighlight.all', 'Highlights both the gutter and the current line.') + nls.localizeByDefault('Highlights both the gutter and the current line.') ], - 'description': nls.localize('vscode/editorOptions/renderLineHighlight', 'Controls how the editor should render the current line highlight.'), + 'description': nls.localizeByDefault('Controls how the editor should render the current line highlight.'), 'type': 'string', 'enum': [ 'none', @@ -998,7 +998,7 @@ const codeEditorPreferenceProperties = { 'default': 'line' }, 'editor.renderLineHighlightOnlyWhenFocus': { - 'description': nls.localize('vscode/editorOptions/renderLineHighlightOnlyWhenFocus', 'Controls if the editor should render the current line highlight only when the editor is focused.'), + 'description': nls.localizeByDefault('Controls if the editor should render the current line highlight only when the editor is focused'), 'type': 'boolean', 'default': false }, @@ -1011,12 +1011,12 @@ const codeEditorPreferenceProperties = { 'editor.renderWhitespace': { 'enumDescriptions': [ '', - nls.localize('vscode/editorOptions/renderWhitespace.boundary', 'Render whitespace characters except for single spaces between words.'), - nls.localize('vscode/editorOptions/renderWhitespace.selection', 'Render whitespace characters only on selected text.'), - nls.localize('vscode/editorOptions/renderWhitespace.trailing', 'Render only trailing whitespace characters.'), + nls.localizeByDefault('Render whitespace characters except for single spaces between words.'), + nls.localizeByDefault('Render whitespace characters only on selected text.'), + nls.localizeByDefault('Render only trailing whitespace characters'), '' ], - 'description': nls.localize('vscode/editorOptions/renderWhitespace', 'Controls how the editor should render whitespace characters.'), + 'description': nls.localizeByDefault('Controls how the editor should render whitespace characters.'), 'type': 'string', 'enum': [ 'none', @@ -1035,7 +1035,7 @@ const codeEditorPreferenceProperties = { 'maximum': 1000 }, 'editor.roundedSelection': { - 'description': nls.localize('vscode/editorOptions/roundedSelection', 'Controls whether selections should have rounded corners.'), + 'description': nls.localizeByDefault('Controls whether selections should have rounded corners.'), 'type': 'boolean', 'default': true }, @@ -1045,87 +1045,87 @@ const codeEditorPreferenceProperties = { 'type': 'number' }, 'default': [], - 'description': nls.localize('vscode/editorOptions/rulers', 'Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.') + 'description': nls.localizeByDefault('Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.') }, 'editor.scrollBeyondLastColumn': { - 'description': nls.localize('vscode/editorOptions/scrollBeyondLastColumn', 'Controls the number of extra characters beyond which the editor will scroll horizontally.'), + 'description': nls.localizeByDefault('Controls the number of extra characters beyond which the editor will scroll horizontally.'), 'type': 'integer', 'default': 5, 'minimum': 0, 'maximum': 1073741824 }, 'editor.scrollBeyondLastLine': { - 'description': nls.localize('vscode/editorOptions/scrollBeyondLastLine', 'Controls whether the editor will scroll beyond the last line.'), + 'description': nls.localizeByDefault('Controls whether the editor will scroll beyond the last line.'), 'type': 'boolean', 'default': true }, 'editor.scrollPredominantAxis': { - 'description': nls.localize('vscode/editorOptions/scrollPredominantAxis', 'Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.'), + 'description': nls.localizeByDefault('Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.'), 'type': 'boolean', 'default': true }, 'editor.selectionClipboard': { - 'description': nls.localize('vscode/editorOptions/selectionClipboard', 'Controls whether the Linux primary clipboard should be supported.'), + 'description': nls.localizeByDefault('Controls whether the Linux primary clipboard should be supported.'), 'included': platform.isLinux, 'type': 'boolean', 'default': true }, 'editor.selectionHighlight': { - 'description': nls.localize('vscode/editorOptions/selectionHighlight', 'Controls whether the editor should highlight matches similar to the selection.'), + 'description': nls.localizeByDefault('Controls whether the editor should highlight matches similar to the selection.'), 'type': 'boolean', 'default': true }, 'editor.selectOnLineNumbers': { - 'description': nls.localize('vscode/editorOptions/selectOnLineNumbers', 'Controls whether to select the corresponding line when clicking on the line number'), + 'description': nls.localize('theia/editor/selectOnLineNumbers', 'Controls whether to select the corresponding line when clicking on the line number'), 'type': 'boolean', 'default': true }, 'editor.showFoldingControls': { - 'description': nls.localize('vscode/editorOptions/showFoldingControls', 'Controls whether the fold controls on the gutter are automatically hidden.'), + 'description': nls.localizeByDefault('Controls when the folding controls on the gutter are shown.'), 'type': 'string', 'enum': [ 'always', 'mouseover' ], 'enumDescriptions': [ - nls.localize('vscode/editorOptions/showFoldingControls.always', 'Always show the folding controls.'), - nls.localize('vscode/editorOptions/showFoldingControls.mouseover', 'Only show the folding controls when the mouse is over the gutter.'), + nls.localizeByDefault('Always show the folding controls.'), + nls.localizeByDefault('Only show the folding controls when the mouse is over the gutter.'), ], 'default': 'mouseover' }, 'editor.showUnused': { - 'description': nls.localize('vscode/editorOptions/showUnused', 'Controls fading out of unused code.'), + 'description': nls.localizeByDefault('Controls fading out of unused code.'), 'type': 'boolean', 'default': true }, 'editor.showDeprecated': { - 'description': nls.localize('vscode/editorOptions/showDeprecated', 'Controls strikethrough deprecated variables.'), + 'description': nls.localizeByDefault('Controls strikethrough deprecated variables.'), 'type': 'boolean', 'default': true }, 'editor.inlineHints.enabled': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/editor.inlayHints.enabled', 'Enables the inline hints in the editor.') + 'description': nls.localizeByDefault('Enables the inline hints in the editor.') }, 'editor.inlineHints.fontSize': { 'type': 'number', 'default': EDITOR_FONT_DEFAULTS.fontSize, - description: nls.localize('vscode/editorOptions/editor.inlayHints.fontSize', 'Controls font size of inline hints in the editor. When set to `0`, the 90% of `#editor.fontSize#` is used.') + description: nls.localizeByDefault('Controls font size of inline hints in the editor. When set to `0`, the 90% of `#editor.fontSize#` is used.') }, 'editor.inlineHints.fontFamily': { 'type': 'string', 'default': EDITOR_FONT_DEFAULTS.fontFamily, - 'description': nls.localize('vscode/editorOptions/inlayHints.fontFamily', 'Controls font family of inline hints in the editor.') + 'description': nls.localizeByDefault('Controls font family of inline hints in the editor.') }, 'editor.snippetSuggestions': { 'enumDescriptions': [ - nls.localize('vscode/editorOptions/snippetSuggestions.top', 'Show snippet suggestions on top of other suggestions.'), - nls.localize('vscode/editorOptions/snippetSuggestions.bottom', 'Show snippet suggestions below other suggestions.'), - nls.localize('vscode/editorOptions/snippetSuggestions.inline', 'Show snippets suggestions with other suggestions.'), - nls.localize('vscode/editorOptions/snippetSuggestions.none', 'Do not show snippet suggestions.') + nls.localizeByDefault('Show snippet suggestions on top of other suggestions.'), + nls.localizeByDefault('Show snippet suggestions below other suggestions.'), + nls.localizeByDefault('Show snippets suggestions with other suggestions.'), + nls.localizeByDefault('Do not show snippet suggestions.') ], - 'description': nls.localize('vscode/editorOptions/snippetSuggestions', 'Controls whether snippets are shown with other suggestions and how they are sorted.'), + 'description': nls.localizeByDefault('Controls whether snippets are shown with other suggestions and how they are sorted.'), 'type': 'string', 'enum': [ 'top', @@ -1136,17 +1136,17 @@ const codeEditorPreferenceProperties = { 'default': 'inline' }, 'editor.smartSelect.selectLeadingAndTrailingWhitespace': { - 'description': nls.localize('vscode/editorOptions/selectLeadingAndTrailingWhitespace', 'Whether leading and trailing whitespace should always be selected.'), + 'description': nls.localizeByDefault('Whether leading and trailing whitespace should always be selected.'), 'default': true, 'type': 'boolean' }, 'editor.smoothScrolling': { - 'description': nls.localize('vscode/editorOptions/smoothScrolling', 'Controls whether the editor will scroll using an animation.'), + 'description': nls.localizeByDefault('Controls whether the editor will scroll using an animation.'), 'type': 'boolean', 'default': false }, 'editor.stickyTabStops': { - 'description': nls.localize('vscode/editorOptions/stickyTabStops', 'Emulate selection behaviour of tab characters when using spaces for indentation. Selection will stick to tab stops.'), + 'description': nls.localizeByDefault('Emulate selection behaviour of tab characters when using spaces for indentation. Selection will stick to tab stops.'), 'type': 'boolean', 'default': false }, @@ -1164,11 +1164,11 @@ const codeEditorPreferenceProperties = { 'replace' ], 'enumDescriptions': [ - nls.localize('vscode/editorOptions/suggest.insertMode.insert', 'Insert suggestion without overwriting text right of the cursor.'), - nls.localize('vscode/editorOptions/suggest.insertMode.replace', 'Insert suggestion and overwrite text right of the cursor.') + nls.localizeByDefault('Insert suggestion without overwriting text right of the cursor.'), + nls.localizeByDefault('Insert suggestion and overwrite text right of the cursor.') ], 'default': 'insert', - 'description': nls.localize('vscode/editorOptions/suggest.insertMode', 'Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.') + 'description': nls.localizeByDefault('Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.') }, 'editor.suggest.insertHighlight': { 'type': 'boolean', @@ -1178,201 +1178,201 @@ const codeEditorPreferenceProperties = { 'editor.suggest.filterGraceful': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/suggest.filterGraceful', 'Controls whether filtering and sorting suggestions accounts for small typos.') + 'description': nls.localizeByDefault('Controls whether filtering and sorting suggestions accounts for small typos.') }, 'editor.suggest.localityBonus': { 'type': 'boolean', 'default': false, - 'description': nls.localize('vscode/editorOptions/suggest.localityBonus', 'Controls whether sorting favours words that appear close to the cursor.') + 'description': nls.localizeByDefault('Controls whether sorting favours words that appear close to the cursor.') }, 'editor.suggest.shareSuggestSelections': { 'type': 'boolean', 'default': false, - 'markdownDescription': nls.localize('vscode/editorOptions/suggest.shareSuggestSelections', 'Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).') + 'markdownDescription': nls.localizeByDefault('Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).') }, 'editor.suggest.snippetsPreventQuickSuggestions': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/suggest.snippetsPreventQuickSuggestions', 'Controls whether an active snippet prevents quick suggestions.') + 'description': nls.localizeByDefault('Controls whether an active snippet prevents quick suggestions.') }, 'editor.suggest.showIcons': { 'type': 'boolean', 'default': true, - 'description': nls.localize('vscode/editorOptions/suggest.showIcons', 'Controls whether to show or hide icons in suggestions.') + 'description': nls.localizeByDefault('Controls whether to show or hide icons in suggestions.') }, 'editor.suggest.maxVisibleSuggestions': { 'type': 'number', 'default': 12, 'minimum': 1, 'maximum': 15, - 'description': nls.localize('vscode/editorOptions/suggest.maxVisibleSuggestions.dep', 'Controls how many suggestions IntelliSense will show before showing a scrollbar (maximum 15).') + 'description': nls.localizeByDefault('This setting is deprecated. The suggest widget can now be resized.') }, 'editor.suggest.filteredTypes': { 'type': 'object', 'default': {}, - 'deprecationMessage': nls.localize('vscode/editorOptions/deprecated', 'This setting is deprecated, please use separate settings like `editor.suggest.showKeywords` or `editor.suggest.showSnippets` instead.') + 'deprecationMessage': nls.localizeByDefault("This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.") }, 'editor.suggest.showMethods': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showMethods', 'When enabled IntelliSense shows `method`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `method`-suggestions.') }, 'editor.suggest.showFunctions': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showFunctions', 'When enabled IntelliSense shows `function`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `function`-suggestions.') }, 'editor.suggest.showConstructors': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showConstructors', 'When enabled IntelliSense shows `constructor`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `constructor`-suggestions.') }, 'editor.suggest.showFields': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showFields', 'When enabled IntelliSense shows `field`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `field`-suggestions.') }, 'editor.suggest.showVariables': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showVariables', 'When enabled IntelliSense shows `variable`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `variable`-suggestions.') }, 'editor.suggest.showClasses': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showClasss', 'When enabled IntelliSense shows `class`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `class`-suggestions.') }, 'editor.suggest.showStructs': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showStructs', 'When enabled IntelliSense shows `struct`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `struct`-suggestions.') }, 'editor.suggest.showInterfaces': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showInterfaces', 'When enabled IntelliSense shows `interface`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `interface`-suggestions.') }, 'editor.suggest.showModules': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showModules', 'When enabled IntelliSense shows `module`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `module`-suggestions.') }, 'editor.suggest.showProperties': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showPropertys', 'When enabled IntelliSense shows `property`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `property`-suggestions.') }, 'editor.suggest.showEvents': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showEvents', 'When enabled IntelliSense shows `event`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `event`-suggestions.') }, 'editor.suggest.showOperators': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showOperators', 'When enabled IntelliSense shows `operator`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `operator`-suggestions.') }, 'editor.suggest.showUnits': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showUnits', 'When enabled IntelliSense shows `unit`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `unit`-suggestions.') }, 'editor.suggest.showValues': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showValues', 'When enabled IntelliSense shows `value`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `value`-suggestions.') }, 'editor.suggest.showConstants': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showConstants', 'When enabled IntelliSense shows `constant`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `constant`-suggestions.') }, 'editor.suggest.showEnums': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showEnums', 'When enabled IntelliSense shows `enum`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `enum`-suggestions.') }, 'editor.suggest.showEnumMembers': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showEnumMembers', 'When enabled IntelliSense shows `enumMember`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `enumMember`-suggestions.') }, 'editor.suggest.showKeywords': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showKeywords', 'When enabled IntelliSense shows `keyword`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `keyword`-suggestions.') }, 'editor.suggest.showWords': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showTexts', 'When enabled IntelliSense shows `text`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `text`-suggestions.') }, 'editor.suggest.showColors': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showColors', 'When enabled IntelliSense shows `color`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `color`-suggestions.') }, 'editor.suggest.showFiles': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showFiles', 'When enabled IntelliSense shows `file`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `file`-suggestions.') }, 'editor.suggest.showReferences': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showReferences', 'When enabled IntelliSense shows `reference`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `reference`-suggestions.') }, 'editor.suggest.showCustomcolors': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showCustomcolors', 'When enabled IntelliSense shows `customcolor`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `customcolor`-suggestions.') }, 'editor.suggest.showFolders': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/ineditor.suggest.showFolderssertSpaces', 'When enabled IntelliSense shows `folder`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `folder`-suggestions.') }, 'editor.suggest.showTypeParameters': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showTypeParameters', 'When enabled IntelliSense shows `typeParameter`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `typeParameter`-suggestions.') }, 'editor.suggest.showSnippets': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/editor.suggest.showSnippets', 'When enabled IntelliSense shows `snippet`-suggestions.') + 'markdownDescription': nls.localizeByDefault('When enabled IntelliSense shows `snippet`-suggestions.') }, 'editor.suggest.hideStatusBar': { 'type': 'boolean', 'default': true, - 'markdownDescription': nls.localize('vscode/editorOptions/suggest.showStatusBar', 'Controls the visibility of the status bar at the bottom of the suggest widget.') + 'markdownDescription': nls.localizeByDefault('Controls the visibility of the status bar at the bottom of the suggest widget.') }, 'editor.suggestFontSize': { - 'markdownDescription': nls.localize('vscode/editorOptions/suggestFontSize', 'Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.'), + 'markdownDescription': nls.localizeByDefault('Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.'), 'type': 'integer', 'default': 0, 'minimum': 0, 'maximum': 1000 }, 'editor.suggestLineHeight': { - 'markdownDescription': nls.localize('vscode/editorOptions/suggestLineHeight', 'Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.'), + 'markdownDescription': nls.localizeByDefault('Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.'), 'type': 'integer', 'default': 0, 'minimum': 0, 'maximum': 1000 }, 'editor.suggestOnTriggerCharacters': { - 'description': nls.localize('vscode/editorOptions/suggestOnTriggerCharacters', 'Controls whether suggestions should automatically show up when typing trigger characters.'), + 'description': nls.localizeByDefault('Controls whether suggestions should automatically show up when typing trigger characters.'), 'type': 'boolean', 'default': true }, 'editor.suggestSelection': { 'markdownEnumDescriptions': [ - nls.localize('vscode/editorOptions/suggestSelection.first', 'Always select the first suggestion.'), - nls.localize('vscode/editorOptions/suggestSelection.recentlyUsed', 'Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently.'), - nls.localize('vscode/editorOptions/suggestSelection.recentlyUsedByPrefix', 'Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.') + nls.localizeByDefault('Always select the first suggestion.'), + nls.localizeByDefault('Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently.'), + nls.localizeByDefault('Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.') ], - 'description': nls.localize('vscode/editorOptions/suggestSelection', 'Controls how suggestions are pre-selected when showing the suggest list.'), + 'description': nls.localizeByDefault('Controls how suggestions are pre-selected when showing the suggest list.'), 'type': 'string', 'enum': [ 'first', @@ -1383,11 +1383,11 @@ const codeEditorPreferenceProperties = { }, 'editor.tabCompletion': { 'enumDescriptions': [ - nls.localize('vscode/editorOptions/tabCompletion.on', 'Tab complete will insert the best matching suggestion when pressing tab.'), - nls.localize('vscode/editorOptions/tabCompletion.off', 'Disable tab completions.'), - nls.localize('vscode/editorOptions/tabCompletion.onlySnippets', 'Tab complete snippets when their prefix match. Works best when `quickSuggestions` aren\'t enabled.') + nls.localizeByDefault('Tab complete will insert the best matching suggestion when pressing tab.'), + nls.localizeByDefault('Disable tab completions.'), + nls.localizeByDefault("Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.") ], - 'description': nls.localize('vscode/editorOptions/tabCompletion', 'Enables tab completions.'), + 'description': nls.localizeByDefault('Enables tab completions.'), 'type': 'string', 'enum': [ 'on', @@ -1409,29 +1409,29 @@ const codeEditorPreferenceProperties = { nls.localize('unusualLineTerminators.off', 'Unusual line terminators are ignored.'), nls.localize('unusualLineTerminators.prompt', 'Unusual line terminators prompt to be removed.') ], - 'description': nls.localize('vscode/editorOptions/unusualLineTerminators', 'Remove unusual line terminators that might cause problems.'), + 'description': nls.localizeByDefault('Remove unusual line terminators that might cause problems.'), 'type': 'string', 'enum': ['auto', 'off', 'prompt'], 'default': 'prompt' }, 'editor.useTabStops': { - 'description': nls.localize('vscode/editorOptions/useTabStops', 'Inserting and deleting whitespace follows tab stops.'), + 'description': nls.localizeByDefault('Inserting and deleting whitespace follows tab stops.'), 'type': 'boolean', 'default': true }, 'editor.wordSeparators': { - 'description': nls.localize('vscode/editorOptions/wordSeparators', 'Characters that will be used as word separators when doing word related navigations or operations.'), + 'description': nls.localizeByDefault('Characters that will be used as word separators when doing word related navigations or operations.'), 'type': 'string', 'default': DEFAULT_WORD_SEPARATORS }, 'editor.wordWrap': { 'markdownEnumDescriptions': [ - nls.localize('vscode/editorOptions/wordWrap.off', 'Lines will never wrap.'), - nls.localize('vscode/editorOptions/wordWrap.on', 'Lines will wrap at the viewport width.'), - nls.localize('vscode/editorOptions/wordWrap.wordWrapColumn', 'Lines will wrap at `#editor.wordWrapColumn#`.'), - nls.localize('vscode/editorOptions/wordWrap.bounded', 'Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.') + nls.localizeByDefault('Lines will never wrap.'), + nls.localizeByDefault('Lines will wrap at the viewport width.'), + nls.localizeByDefault('Lines will wrap at `#editor.wordWrapColumn#`.'), + nls.localizeByDefault('Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.') ], - 'description': nls.localize('vscode/editorOptions/wordWrap', 'Controls how lines should wrap.'), + 'description': nls.localizeByDefault('Controls how lines should wrap.'), 'type': 'string', 'enum': [ 'off', @@ -1452,7 +1452,7 @@ const codeEditorPreferenceProperties = { 'default': '([{‘“〈《「『【〔([{「£¥$£¥++', }, 'editor.wordWrapColumn': { - 'markdownDescription': nls.localize('vscode/editorOptions/wordWrapColumn', 'Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.'), + 'markdownDescription': nls.localizeByDefault('Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.'), 'type': 'integer', 'default': 80, 'minimum': 1, @@ -1472,12 +1472,12 @@ const codeEditorPreferenceProperties = { }, 'editor.wrappingIndent': { 'enumDescriptions': [ - nls.localize('vscode/editorOptions/wrappingIndent.none', 'No indentation. Wrapped lines begin at column 1.'), - nls.localize('vscode/editorOptions/wrappingIndent.same', 'Wrapped lines get the same indentation as the parent.'), - nls.localize('vscode/editorOptions/wrappingIndent.indent', 'Wrapped lines get +1 indentation toward the parent.'), - nls.localize('vscode/editorOptions/wrappingIndent.deepIndent', 'Wrapped lines get +2 indentation toward the parent.') + nls.localizeByDefault('No indentation. Wrapped lines begin at column 1.'), + nls.localizeByDefault('Wrapped lines get the same indentation as the parent.'), + nls.localizeByDefault('Wrapped lines get +1 indentation toward the parent.'), + nls.localizeByDefault('Wrapped lines get +2 indentation toward the parent.') ], - 'description': nls.localize('vscode/editorOptions/wrappingIndent', 'Controls the indentation of wrapped lines.'), + 'description': nls.localizeByDefault('Controls the indentation of wrapped lines.'), 'type': 'string', 'enum': [ 'none', @@ -1489,10 +1489,10 @@ const codeEditorPreferenceProperties = { }, 'editor.wrappingStrategy': { 'enumDescriptions': [ - nls.localize('vscode/editorOptions/wrappingStrategy.simple', 'Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.'), - nls.localize('vscode/editorOptions/wrappingStrategy.advanced', 'Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.') + nls.localizeByDefault('Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.'), + nls.localizeByDefault('Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.') ], - 'description': nls.localize('vscode/editorOptions/wrappingStrategy', 'Controls the algorithm that computes wrapping points.'), + 'description': nls.localizeByDefault('Controls the algorithm that computes wrapping points.'), 'type': 'string', 'enum': [ 'simple', @@ -1515,19 +1515,20 @@ export const editorPreferenceSchema: PreferenceSchema = { 'off' ], 'default': 'off', - 'description': nls.localize('vscode/files.contribution/autoSave', 'Controls auto save of dirty files.'), + 'description': nls.localize('theia/editor/autoSaveSetting', 'Controls auto save of dirty files.'), overridable: false }, 'editor.autoSaveDelay': { 'type': 'number', 'default': 500, - 'description': nls.localize('vscode/files.contribution/autoSaveDelay', 'Configure the auto save delay in milliseconds.'), + 'description': nls.localize('theia/editor/autoSaveDelay', 'Configure the auto save delay in milliseconds.'), overridable: false }, 'editor.formatOnSave': { 'type': 'boolean', 'default': false, - 'description': nls.localize('vscode/files.contribution/formatOnSave', 'Enable format on manual save.') + // eslint-disable-next-line max-len + 'description': nls.localizeByDefault('Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down.') }, 'editor.formatOnSaveTimeout': { 'type': 'number', @@ -1547,12 +1548,12 @@ export const editorPreferenceSchema: PreferenceSchema = { 'auto' ], 'enumDescriptions': [ - nls.localize('vscode/files.contribution/eol.LF', 'LF'), - nls.localize('vscode/files.contribution/eol.CRLF', 'CRLF'), - nls.localize('vscode/files.contribution/eol.auto', 'Uses operating system specific end of line character.') + nls.localizeByDefault('LF'), + nls.localizeByDefault('CRLF'), + nls.localizeByDefault('Uses operating system specific end of line character.') ], 'default': 'auto', - 'description': nls.localize('vscode/files.contribution/eol', 'The default end of line character.') + 'description': nls.localizeByDefault('The default end of line character.') } } }; diff --git a/packages/external-terminal/src/electron-browser/external-terminal-contribution.ts b/packages/external-terminal/src/electron-browser/external-terminal-contribution.ts index 5da5ecb647f51..539e1fdec913f 100644 --- a/packages/external-terminal/src/electron-browser/external-terminal-contribution.ts +++ b/packages/external-terminal/src/electron-browser/external-terminal-contribution.ts @@ -26,10 +26,10 @@ import { QuickPickService } from '@theia/core/lib/common/quick-pick-service'; import { nls } from '@theia/core/lib/common/nls'; export namespace ExternalTerminalCommands { - export const OPEN_NATIVE_CONSOLE = Command.toLocalizedCommand({ + export const OPEN_NATIVE_CONSOLE = Command.toDefaultLocalizedCommand({ id: 'workbench.action.terminal.openNativeConsole', label: 'Open New External Terminal' - }, 'vscode/externalTerminal.contribution/globalConsoleAction'); + }); } @injectable() diff --git a/packages/external-terminal/src/electron-browser/external-terminal-preference.ts b/packages/external-terminal/src/electron-browser/external-terminal-preference.ts index c5db7967d7023..ef94da7292974 100644 --- a/packages/external-terminal/src/electron-browser/external-terminal-preference.ts +++ b/packages/external-terminal/src/electron-browser/external-terminal-preference.ts @@ -87,17 +87,17 @@ export async function getExternalTerminalSchema(externalTerminalService: Externa properties: { 'terminal.external.windowsExec': { type: 'string', - description: nls.localize('vscode/externalTerminal.contribution/terminal.external.windowsExec', 'Customizes which terminal to run on Windows.'), + description: nls.localizeByDefault('Customizes which terminal to run on Windows.'), default: `${isWindows ? hostExec : 'C:\\WINDOWS\\System32\\cmd.exe'}` }, 'terminal.external.osxExec': { type: 'string', - description: nls.localize('vscode/externalTerminal.contribution/terminal.external.osxExec', 'Customizes which terminal to run on macOS.'), + description: nls.localizeByDefault('Customizes which terminal to run on macOS.'), default: `${isOSX ? hostExec : 'Terminal.app'}` }, 'terminal.external.linuxExec': { type: 'string', - description: nls.localize('vscode/externalTerminal.contribution/terminal.external.linuxExec', 'Customizes which terminal to run on Linux.'), + description: nls.localizeByDefault('Customizes which terminal to run on Linux.'), default: `${!(isWindows || isOSX) ? hostExec : 'xterm'}` } } diff --git a/packages/file-search/src/browser/quick-file-open-contribution.ts b/packages/file-search/src/browser/quick-file-open-contribution.ts index c8cf0413b85ce..f084d80315001 100644 --- a/packages/file-search/src/browser/quick-file-open-contribution.ts +++ b/packages/file-search/src/browser/quick-file-open-contribution.ts @@ -55,7 +55,7 @@ export class QuickFileOpenFrontendContribution implements QuickAccessContributio registerMenus(menus: MenuModelRegistry): void { menus.registerMenuAction(EditorMainMenu.WORKSPACE_GROUP, { commandId: quickFileOpen.id, - label: nls.localize('vscode/quickAccessActions/quickOpen', 'Go to File...'), + label: nls.localizeByDefault('Go to File...'), order: '1', }); } diff --git a/packages/file-search/src/browser/quick-file-open.ts b/packages/file-search/src/browser/quick-file-open.ts index fe9d05e9cd3fd..e2f0da6509aba 100644 --- a/packages/file-search/src/browser/quick-file-open.ts +++ b/packages/file-search/src/browser/quick-file-open.ts @@ -28,11 +28,11 @@ import { FileSystemPreferences } from '@theia/filesystem/lib/browser'; import { EditorOpenerOptions, EditorWidget, Position, Range } from '@theia/editor/lib/browser'; import { findMatches, QuickInputService, QuickPickItem, QuickPicks } from '@theia/core/lib/browser/quick-input/quick-input-service'; -export const quickFileOpen = Command.toLocalizedCommand({ +export const quickFileOpen = Command.toDefaultLocalizedCommand({ id: 'file-search.openFile', category: CommonCommands.FILE_CATEGORY, label: 'Open File...' -}, 'vscode/workspaceActions/openFile', CommonCommands.FILE_CATEGORY_KEY); +}); export interface FilterAndRange { filter: string; range?: Range; diff --git a/packages/filesystem/src/browser/download/file-download-command-contribution.ts b/packages/filesystem/src/browser/download/file-download-command-contribution.ts index d83f5e26de202..952a8eae32bac 100644 --- a/packages/filesystem/src/browser/download/file-download-command-contribution.ts +++ b/packages/filesystem/src/browser/download/file-download-command-contribution.ts @@ -68,11 +68,11 @@ export class FileDownloadCommandContribution implements CommandContribution { export namespace FileDownloadCommands { - export const DOWNLOAD = Command.toLocalizedCommand({ + export const DOWNLOAD = Command.toDefaultLocalizedCommand({ id: 'file.download', category: CommonCommands.FILE_CATEGORY, label: 'Download' - }, 'vscode/fileActions/downloadButton', CommonCommands.FILE_CATEGORY_KEY); + }); export const COPY_DOWNLOAD_LINK = Command.toLocalizedCommand({ id: 'file.copyDownloadLink', diff --git a/packages/filesystem/src/browser/file-upload-service.ts b/packages/filesystem/src/browser/file-upload-service.ts index 4ae5b3c2c0214..5ec856dc2f42f 100644 --- a/packages/filesystem/src/browser/file-upload-service.ts +++ b/packages/filesystem/src/browser/file-upload-service.ts @@ -245,9 +245,9 @@ export class FileUploadService { protected async confirmOverwrite(fileUri: URI): Promise { const dialog = new ConfirmDialog({ - title: nls.localize('vscode/findWidget/label.replace', 'Replace file'), - msg: nls.localize('vscode/explorerViewer/confirmOverwrite', 'File "{0}" already exists in the destination folder. Do you want to replace it?', fileUri.path.base), - ok: nls.localize('vscode/findWidget/label.replace', 'Replace file'), + title: nls.localizeByDefault('Replace file'), + msg: nls.localizeByDefault('File "{0}" already exists in the destination folder. Do you want to replace it?', fileUri.path.base), + ok: nls.localizeByDefault('Replace file'), cancel: Dialog.CANCEL }); return !!await dialog.open(); diff --git a/packages/filesystem/src/browser/filesystem-preferences.ts b/packages/filesystem/src/browser/filesystem-preferences.ts index bfc59f647e352..434ab56d5fd4d 100644 --- a/packages/filesystem/src/browser/filesystem-preferences.ts +++ b/packages/filesystem/src/browser/filesystem-preferences.ts @@ -39,7 +39,8 @@ export const filesystemPreferenceSchema: PreferenceSchema = { type: 'object', properties: { 'files.watcherExclude': { - description: nls.localize('vscode/files.contribution/watcherExclude', 'List of paths to exclude from the filesystem watcher'), + // eslint-disable-next-line max-len + description: nls.localizeByDefault('Configure glob patterns of file paths to exclude from file watching. Patterns must match on absolute paths (i.e. prefix with ** or the full path to match properly). Changing this setting requires a restart. When you experience Code consuming lots of CPU time on startup, you can exclude large folders to reduce the initial load.'), additionalProperties: { type: 'boolean' }, @@ -53,29 +54,25 @@ export const filesystemPreferenceSchema: PreferenceSchema = { 'files.exclude': { type: 'object', default: { '**/.git': true, '**/.svn': true, '**/.hg': true, '**/CVS': true, '**/.DS_Store': true }, - description: nls.localize('vscode/files.contribution/exclude', 'Configure glob patterns for excluding files and folders.'), + // eslint-disable-next-line max-len + description: nls.localize('theia/filesystem/filesExclude', 'Configure glob patterns for excluding files and folders. For example, the file Explorer decides which files and folders to show or hide based on this setting. Refer to the `#search.exclude#` setting to define search specific excludes.'), scope: 'resource' }, 'files.enableTrash': { type: 'boolean', default: true, - description: nls.localize( - 'vscode/files.contribution/useTrash', - 'Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently.' - ) + description: nls.localizeByDefault('Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently.') }, 'files.associations': { type: 'object', - description: nls.localize( - 'vscode/files.contribution/associations', - 'Configure file associations to languages (e.g. \"*.extension\": \"html\"). These have precedence over the default associations of the languages installed.' + description: nls.localizeByDefault( + 'Configure file associations to languages (e.g. `\"*.extension\": \"html\"`). These have precedence over the default associations of the languages installed.' ) }, 'files.autoGuessEncoding': { type: 'boolean', default: false, - description: nls.localize( - 'vscode/files.contribution/autoGuessEncoding', + description: nls.localizeByDefault( 'When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language.' ), scope: 'language-overridable', @@ -84,8 +81,7 @@ export const filesystemPreferenceSchema: PreferenceSchema = { 'files.participants.timeout': { type: 'number', default: 5000, - markdownDescription: nls.localize( - 'vscode/mainThreadFileSystemEventService/files.participants.timeout', + markdownDescription: nls.localizeByDefault( 'Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants.' ) }, @@ -97,7 +93,7 @@ export const filesystemPreferenceSchema: PreferenceSchema = { 'files.trimTrailingWhitespace': { type: 'boolean', default: false, - description: nls.localize('vscode/files.contribution/trimTrailingWhitespace', 'When enabled, will trim trailing whitespace when saving a file.'), + description: nls.localizeByDefault('When enabled, will trim trailing whitespace when saving a file.'), scope: 'language-overridable' }, 'files.maxConcurrentUploads': { diff --git a/packages/getting-started/src/browser/getting-started-widget.tsx b/packages/getting-started/src/browser/getting-started-widget.tsx index 27b6556bf74a4..a5372d2c4f1c7 100644 --- a/packages/getting-started/src/browser/getting-started-widget.tsx +++ b/packages/getting-started/src/browser/getting-started-widget.tsx @@ -48,7 +48,7 @@ export class GettingStartedWidget extends ReactWidget { /** * The widget `label` which is used for display purposes. */ - static readonly LABEL = nls.localize('vscode/gettingStarted.contribution/Getting Started', 'Getting Started'); + static readonly LABEL = nls.localizeByDefault('Getting Started'); /** * The `ApplicationInfo` for the application if available. @@ -168,7 +168,7 @@ export class GettingStartedWidget extends ReactWidget { tabIndex={0} onClick={this.doOpen} onKeyDown={this.doOpenEnter}> - {nls.localize('vscode/dialogMainService/open', 'Open')} + {nls.localizeByDefault('Open')}
; @@ -178,7 +178,7 @@ export class GettingStartedWidget extends ReactWidget { tabIndex={0} onClick={this.doOpenFile} onKeyDown={this.doOpenFileEnter}> - {nls.localize('vscode/dialogMainService/openFile', 'Open File')} + {nls.localizeByDefault('Open File')} ; @@ -188,7 +188,7 @@ export class GettingStartedWidget extends ReactWidget { tabIndex={0} onClick={this.doOpenFolder} onKeyDown={this.doOpenFolderEnter}> - {nls.localize('vscode/dialogMainService/openFolder', 'Open Folder')} + {nls.localizeByDefault('Open Folder')} ; @@ -198,12 +198,12 @@ export class GettingStartedWidget extends ReactWidget { tabIndex={0} onClick={this.doOpenWorkspace} onKeyDown={this.doOpenWorkspaceEnter}> - {nls.localize('vscode/dialogMainService/openWorkspaceTitle', 'Open Workspace')} + {nls.localizeByDefault('Open Workspace')} ); return
-

{nls.localize('vscode/dialogMainService/open', 'Open')}

+

{nls.localizeByDefault('Open')}

{open} {openFile} {openFolder} @@ -238,14 +238,14 @@ export class GettingStartedWidget extends ReactWidget { tabIndex={0} onClick={this.doOpenRecentWorkspace} onKeyDown={this.doOpenRecentWorkspaceEnter}> - {nls.localize('vscode/vs_code_welcome_page/welcomePage.moreRecent', 'More...')} + {nls.localizeByDefault('More...')}
; return

- {nls.localize('vscode/vs_code_welcome_page/welcomePage.recent', 'Recently opened')} + {nls.localizeByDefault('Recently opened')}

- {items.length > 0 ? content :

{nls.localize('vscode/vs_code_welcome_page/welcomePage.noRecentFolders', 'No Recent Workspaces')}

} + {items.length > 0 ? content :

{nls.localizeByDefault('No Recent Workspaces')}

} {more}
; } @@ -258,7 +258,7 @@ export class GettingStartedWidget extends ReactWidget { return

- {nls.localize('vscode/preferences.contribution/settings', 'Settings')} + {nls.localizeByDefault('Settings')}

@@ -275,7 +275,7 @@ export class GettingStartedWidget extends ReactWidget { tabIndex={0} onClick={this.doOpenKeyboardShortcuts} onKeyDown={this.doOpenKeyboardShortcutsEnter}> - {nls.localize('vscode/preferences.contribution/openGlobalKeybindings', 'Open Keyboard Shortcuts')} + {nls.localizeByDefault('Open Keyboard Shortcuts')}
; @@ -288,7 +288,7 @@ export class GettingStartedWidget extends ReactWidget { return

- {nls.localize('vscode/gettingStarted.contribution/help', 'Help')} + {nls.localizeByDefault('Help')}

@@ -327,7 +327,7 @@ export class GettingStartedWidget extends ReactWidget { return

- {this.applicationInfo ? nls.localize('vscode/extensions.contribution/extensionInfoVersion', 'Version: {0}', this.applicationInfo.version) : ''} + {this.applicationInfo ? nls.localizeByDefault('Version: {0}', this.applicationInfo.version) : ''}

; diff --git a/packages/git/src/browser/diff/git-diff-contribution.ts b/packages/git/src/browser/diff/git-diff-contribution.ts index 0e61cb8d6026e..d6bc711401921 100644 --- a/packages/git/src/browser/diff/git-diff-contribution.ts +++ b/packages/git/src/browser/diff/git-diff-contribution.ts @@ -41,36 +41,35 @@ export namespace GitDiffCommands { export const OPEN_FILE_DIFF = Command.toLocalizedCommand({ id: 'git-diff:open-file-diff', category: 'Git Diff', - originalLabel: 'Compare With...', - label: nls.localize('vscode/fileActions/globalCompareFile', 'Compare With...') - }); + label: 'Compare With...' + }, 'theia/git/compareWith'); export const TREE_VIEW_MODE = { id: 'git.viewmode.tree', - tooltip: nls.localize('vscode/scmViewPane/viewModeTree', 'Toggle to Tree View'), + tooltip: nls.localizeByDefault('View as Tree'), iconClass: codicon('list-tree'), - originalLabel: 'Toggle to Tree View', - label: nls.localize('vscode/scmViewPane/viewModeTree', 'Toggle to Tree View') + originalLabel: 'View as Tree', + label: nls.localizeByDefault('View as Tree') }; export const LIST_VIEW_MODE = { id: 'git.viewmode.list', - tooltip: nls.localize('vscode/scmViewPane/viewModeList', 'Toggle to List View'), + tooltip: nls.localizeByDefault('View as List'), iconClass: codicon('list-flat'), - originalLabel: 'Toggle to List View', - label: nls.localize('vscode/scmViewPane/viewModeList', 'Toggle to List View') + originalLabel: 'View as List', + label: nls.localizeByDefault('View as List') }; export const PREVIOUS_CHANGE = { id: 'git.navigate-changes.previous', - tooltip: nls.localize('vscode/editor.contribution/navigate.prev.label', 'Previous Change'), + tooltip: nls.localizeByDefault('Previous Change'), iconClass: codicon('arrow-left'), originalLabel: 'Previous Change', - label: nls.localize('vscode/editor.contribution/navigate.prev.label', 'Previous Change') + label: nls.localizeByDefault('Previous Change') }; export const NEXT_CHANGE = { id: 'git.navigate-changes.next', - tooltip: nls.localize('vscode/editor.contribution/navigate.next.label', 'Next Change'), + tooltip: nls.localizeByDefault('Next Change'), iconClass: codicon('arrow-right'), originalLabel: 'Next Change', - label: nls.localize('vscode/editor.contribution/navigate.next.label', 'Next Change') + label: nls.localizeByDefault('Next Change') }; } diff --git a/packages/git/src/browser/git-contribution.ts b/packages/git/src/browser/git-contribution.ts index 3de1e5b15d644..b508290d14b30 100644 --- a/packages/git/src/browser/git-contribution.ts +++ b/packages/git/src/browser/git-contribution.ts @@ -897,7 +897,7 @@ export class GitContribution implements CommandContribution, MenuContribution, T } catch (e) { scmRepository.input.issue = { type: ScmInputIssueType.Warning, - message: nls.localize('vscode/commands/missing user info', 'Make sure you configure your \'user.name\' and \'user.email\' in git.') + message: nls.localizeByDefault('Make sure you configure your \'user.name\' and \'user.email\' in git.') }; } diff --git a/packages/keymaps/src/browser/keymaps-frontend-contribution.ts b/packages/keymaps/src/browser/keymaps-frontend-contribution.ts index bbac5bf18a7ce..59820a2edb245 100644 --- a/packages/keymaps/src/browser/keymaps-frontend-contribution.ts +++ b/packages/keymaps/src/browser/keymaps-frontend-contribution.ts @@ -31,16 +31,16 @@ import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/li import { nls } from '@theia/core/lib/common/nls'; export namespace KeymapsCommands { - export const OPEN_KEYMAPS = Command.toLocalizedCommand({ + export const OPEN_KEYMAPS = Command.toDefaultLocalizedCommand({ id: 'keymaps:open', category: CommonCommands.PREFERENCES_CATEGORY, label: 'Open Keyboard Shortcuts', - }, 'vscode/preferences.contribution/openGlobalKeybindings', CommonCommands.PREFERENCES_CATEGORY_KEY); - export const OPEN_KEYMAPS_JSON = Command.toLocalizedCommand({ + }); + export const OPEN_KEYMAPS_JSON = Command.toDefaultLocalizedCommand({ id: 'keymaps:openJson', category: CommonCommands.PREFERENCES_CATEGORY, label: 'Open Keyboard Shortcuts (JSON)', - }, 'vscode/preferences.contribution/openGlobalKeybindingsFile', CommonCommands.PREFERENCES_CATEGORY_KEY); + }); export const OPEN_KEYMAPS_JSON_TOOLBAR: Command = { id: 'keymaps:openJson.toolbar', iconClass: codicon('json') @@ -112,13 +112,13 @@ export class KeymapsFrontendContribution extends AbstractViewContribution constructor() { super({ widgetId: PROBLEMS_WIDGET_ID, - widgetName: nls.localize('vscode/markers.contribution/problems', 'Problems'), + widgetName: nls.localizeByDefault('Problems'), defaultWidgetOptions: { area: 'bottom' }, @@ -110,7 +110,7 @@ export class ProblemContribution extends AbstractViewContribution */ protected getStatusBarTooltip(stat: ProblemStat): string { if (stat.errors <= 0 && stat.warnings <= 0 && stat.infos <= 0) { - return nls.localize('vscode/markers.contribution/noProblems', 'No Problems'); + return nls.localizeByDefault('No Problems'); } const localize = (text: string, value: number): string => nls.localize(`vscode/markers.contribution/total${text}`, `{0} ${text}`, value.toString()); const tooltip: string[] = []; @@ -164,17 +164,17 @@ export class ProblemContribution extends AbstractViewContribution super.registerMenus(menus); menus.registerMenuAction(ProblemsMenu.CLIPBOARD, { commandId: ProblemsCommands.COPY.id, - label: nls.localize('vscode/markers.contribution/copyMarker', 'Copy'), + label: nls.localizeByDefault('Copy'), order: '0' }); menus.registerMenuAction(ProblemsMenu.CLIPBOARD, { commandId: ProblemsCommands.COPY_MESSAGE.id, - label: nls.localize('vscode/markers.contribution/copyMessage', 'Copy Message'), + label: nls.localizeByDefault('Copy Message'), order: '1' }); menus.registerMenuAction(ProblemsMenu.PROBLEMS, { commandId: ProblemsCommands.COLLAPSE_ALL.id, - label: nls.localize('vscode/markers.contribution/collapseAll', 'Collapse All'), + label: nls.localizeByDefault('Collapse All'), order: '2' }); } @@ -183,7 +183,7 @@ export class ProblemContribution extends AbstractViewContribution toolbarRegistry.registerItem({ id: ProblemsCommands.COLLAPSE_ALL_TOOLBAR.id, command: ProblemsCommands.COLLAPSE_ALL_TOOLBAR.id, - tooltip: nls.localize('vscode/markers.contribution/collapseAll', 'Collapse All'), + tooltip: nls.localizeByDefault('Collapse All'), priority: 0, }); toolbarRegistry.registerItem({ diff --git a/packages/markers/src/browser/problem/problem-preferences.ts b/packages/markers/src/browser/problem/problem-preferences.ts index f4de045029cf3..05f3240a66b2f 100644 --- a/packages/markers/src/browser/problem/problem-preferences.ts +++ b/packages/markers/src/browser/problem/problem-preferences.ts @@ -23,7 +23,7 @@ export const ProblemConfigSchema: PreferenceSchema = { 'properties': { 'problems.decorations.enabled': { 'type': 'boolean', - 'description': nls.localize('vscode/markersFileDecorations/markers.showOnFile', 'Show Errors & Warnings on files and folder.'), + 'description': nls.localizeByDefault('Show Errors & Warnings on files and folder.'), 'default': true, }, 'problems.decorations.tabbar.enabled': { @@ -33,7 +33,7 @@ export const ProblemConfigSchema: PreferenceSchema = { }, 'problems.autoReveal': { 'type': 'boolean', - 'description': nls.localize('vscode/messages/problems.panel.configuration.autoreveal', 'Controls whether Problems view should reveal markers when file is opened.'), + 'description': nls.localizeByDefault('Controls whether Problems view should automatically reveal files when opening them.'), 'default': true } } diff --git a/packages/markers/src/browser/problem/problem-widget.tsx b/packages/markers/src/browser/problem/problem-widget.tsx index f8c429b952257..ff49aa6d7cd75 100644 --- a/packages/markers/src/browser/problem/problem-widget.tsx +++ b/packages/markers/src/browser/problem/problem-widget.tsx @@ -51,7 +51,7 @@ export class ProblemWidget extends TreeWidget { super(treeProps, model, contextMenuRenderer); this.id = PROBLEMS_WIDGET_ID; - this.title.label = nls.localize('vscode/settingsLayout/problems', 'Problems'); + this.title.label = nls.localizeByDefault('Problems'); this.title.caption = this.title.label; this.title.iconClass = codicon('warning'); this.title.closable = true; diff --git a/packages/messages/src/browser/notification-center-component.tsx b/packages/messages/src/browser/notification-center-component.tsx index 87af6056b5173..94f341f2a43a6 100644 --- a/packages/messages/src/browser/notification-center-component.tsx +++ b/packages/messages/src/browser/notification-center-component.tsx @@ -58,17 +58,17 @@ export class NotificationCenterComponent extends React.Component
{title}
    -
  • -
diff --git a/packages/messages/src/browser/notification-component.tsx b/packages/messages/src/browser/notification-component.tsx index bcee3cc32b9a4..5161f88544d40 100644 --- a/packages/messages/src/browser/notification-component.tsx +++ b/packages/messages/src/browser/notification-component.tsx @@ -87,7 +87,7 @@ export class NotificationComponent extends React.Component )} - {!isProgress && (
  • )}
  • diff --git a/packages/messages/src/browser/notifications-commands.ts b/packages/messages/src/browser/notifications-commands.ts index 2c4a3ce51f040..b4905c1a9c334 100644 --- a/packages/messages/src/browser/notifications-commands.ts +++ b/packages/messages/src/browser/notifications-commands.ts @@ -14,13 +14,13 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ -import { Command } from '@theia/core'; +import { Command, nls } from '@theia/core'; import { codicon } from '@theia/core/lib/browser'; export namespace NotificationsCommands { - const NOTIFICATIONS_CATEGORY_KEY = 'vscode/notificationsCommands/notifications'; const NOTIFICATIONS_CATEGORY = 'Notifications'; + const NOTIFICATIONS_CATEGORY_KEY = nls.getDefaultKey(NOTIFICATIONS_CATEGORY); export const TOGGLE = Command.toLocalizedCommand({ id: 'notifications.commands.toggle', @@ -29,22 +29,22 @@ export namespace NotificationsCommands { label: 'Toggle Notifications' }, 'theia/messages/toggleNotifications', NOTIFICATIONS_CATEGORY_KEY); - export const SHOW = Command.toLocalizedCommand({ + export const SHOW = Command.toDefaultLocalizedCommand({ id: 'notifications.commands.show', category: NOTIFICATIONS_CATEGORY, label: 'Show Notifications' - }, 'vscode/notificationsCommands/showNotifications', NOTIFICATIONS_CATEGORY_KEY); + }); - export const HIDE = Command.toLocalizedCommand({ + export const HIDE = Command.toDefaultLocalizedCommand({ id: 'notifications.commands.hide', category: NOTIFICATIONS_CATEGORY, label: 'Hide Notifications' - }, 'vscode/notificationsCommands/hideNotifications', NOTIFICATIONS_CATEGORY_KEY); + }); - export const CLEAR_ALL = Command.toLocalizedCommand({ + export const CLEAR_ALL = Command.toDefaultLocalizedCommand({ id: 'notifications.commands.clearAll', category: NOTIFICATIONS_CATEGORY, iconClass: codicon('clear-all'), label: 'Clear All Notifications' - }, 'vscode/notificationsCommands/clearAllNotifications', NOTIFICATIONS_CATEGORY_KEY); + }); } diff --git a/packages/messages/src/browser/notifications-contribution.ts b/packages/messages/src/browser/notifications-contribution.ts index 82155010da988..aa8f495107b23 100644 --- a/packages/messages/src/browser/notifications-contribution.ts +++ b/packages/messages/src/browser/notifications-contribution.ts @@ -63,13 +63,13 @@ export class NotificationsContribution implements FrontendApplicationContributio } protected getStatusBarItemTooltip(count: number): string { if (this.manager.centerVisible) { - return nls.localize('vscode/notificationsCommands/hideNotifications', 'Hide Notifications'); + return nls.localizeByDefault('Hide Notifications'); } return count === 0 - ? nls.localize('vscode/notificationsStatus/zeroNotifications', 'No Notifications') + ? nls.localizeByDefault('No Notifications') : count === 1 - ? nls.localize('vscode/notificationsStatus/oneNotification', '1 Notification') - : nls.localize('vscode/notificationsStatus/notifications', '{0} Notifications', count.toString()); + ? nls.localizeByDefault('1 New Notification') + : nls.localizeByDefault('{0} New Notifications', count.toString()); } registerCommands(commands: CommandRegistry): void { diff --git a/packages/mini-browser/src/browser/mini-browser-open-handler.ts b/packages/mini-browser/src/browser/mini-browser-open-handler.ts index 6c0a0584d1ae0..323eca779fde7 100644 --- a/packages/mini-browser/src/browser/mini-browser-open-handler.ts +++ b/packages/mini-browser/src/browser/mini-browser-open-handler.ts @@ -35,23 +35,23 @@ import { nls } from '@theia/core/lib/common/nls'; export namespace MiniBrowserCommands { - export const PREVIEW_CATEGORY_KEY = 'vscode/extensionEditor/preview'; export const PREVIEW_CATEGORY = 'Preview'; + export const PREVIEW_CATEGORY_KEY = nls.getDefaultKey(PREVIEW_CATEGORY); export const PREVIEW = Command.toLocalizedCommand({ id: 'mini-browser.preview', label: 'Open Preview', iconClass: codicon('open-preview') - }, 'vscode/mainThreadFileSystemEventService/preview'); + }, 'vscode.markdown-language-features/package/markdown.preview.title'); export const OPEN_SOURCE: Command = { id: 'mini-browser.open.source', iconClass: codicon('go-to-file') }; - export const OPEN_URL = Command.toLocalizedCommand({ + export const OPEN_URL = Command.toDefaultLocalizedCommand({ id: 'mini-browser.openUrl', category: PREVIEW_CATEGORY, label: 'Open URL' - }, 'vscode/url.contribution/openUrl', PREVIEW_CATEGORY_KEY); + }); } /** @@ -220,12 +220,12 @@ export class MiniBrowserOpenHandler extends NavigatableWidgetOpenHandler { const url = arg ? arg : await this.quickInputService?.input({ - prompt: nls.localize('vscode/url.contribution/urlToOpen', 'URL to open'), + prompt: nls.localizeByDefault('URL to open'), placeHolder: nls.localize('theia/mini-browser/typeUrl', 'Type a URL') }); if (url) { diff --git a/packages/monaco/src/browser/monaco-command.ts b/packages/monaco/src/browser/monaco-command.ts index b444c5bdbb946..bfb63e75da258 100644 --- a/packages/monaco/src/browser/monaco-command.ts +++ b/packages/monaco/src/browser/monaco-command.ts @@ -219,7 +219,7 @@ export class MonacoEditorCommandHandlers implements CommandContribution { label: nls.localize(`vscode/indentation/indentUsing${useSpaces ? 'Spaces' : 'Tabs'}`, `Indent Using ${useSpaces ? 'Spaces' : 'Tabs'}`), execute: () => this.configureTabSize(editor, useSpaces) })); - this.quickInputService?.showQuickPick(items, { placeholder: nls.localize('vscode/editorStatus/pickAction', 'Select Action') }); + this.quickInputService?.showQuickPick(items, { placeholder: nls.localizeByDefault('Select Action') }); } protected newConfigEolHandler(): MonacoEditorCommandHandler { @@ -235,7 +235,7 @@ export class MonacoEditorCommandHandlers implements CommandContribution { execute: () => this.setEol(editor, lineEnding) }) ); - this.quickInputService?.showQuickPick(items, { placeholder: nls.localize('vscode/editorStatus/selectEOL', 'Select End of Line Sequence') }); + this.quickInputService?.showQuickPick(items, { placeholder: nls.localizeByDefault('Select End of Line Sequence') }); } protected setEol(editor: MonacoEditor, lineEnding: string): void { @@ -261,7 +261,7 @@ export class MonacoEditorCommandHandlers implements CommandContribution { const sizes = Array.from(Array(8), (_, x) => x + 1); const tabSizeOptions = sizes.map(size => ({ - label: size === tabSize ? size + ' ' + nls.localize('vscode/indentation/configuredTabSize', 'Configured Tab Size') : size.toString(), + label: size === tabSize ? size + ' ' + nls.localizeByDefault('Configured Tab Size') : size.toString(), // eslint-disable-next-line @typescript-eslint/no-explicit-any execute: () => model.updateOptions({ tabSize: size || tabSize, @@ -269,7 +269,7 @@ export class MonacoEditorCommandHandlers implements CommandContribution { }) }) ); - this.quickInputService?.showQuickPick(tabSizeOptions, { placeholder: nls.localize('vscode/indentation/selectTabWidth', 'Select Tab Size for Current File') }); + this.quickInputService?.showQuickPick(tabSizeOptions, { placeholder: nls.localizeByDefault('Select Tab Size for Current File') }); } } diff --git a/packages/monaco/src/browser/monaco-menu.ts b/packages/monaco/src/browser/monaco-menu.ts index b5ff3d764e0df..043b0977ac581 100644 --- a/packages/monaco/src/browser/monaco-menu.ts +++ b/packages/monaco/src/browser/monaco-menu.ts @@ -52,7 +52,7 @@ export class MonacoEditorMenuContribution implements MenuContribution { this.registerPeekSubmenu(registry); - registry.registerSubmenu(MonacoMenus.SELECTION, nls.localize('vscode/menubar/mSelection', 'Selection')); + registry.registerSubmenu(MonacoMenus.SELECTION, nls.localizeByDefault('Selection')); for (const item of MenuRegistry.getMenuItems(monaco.actions.MenuId.MenubarSelectionMenu)) { if (!monaco.actions.isIMenuItem(item)) { continue; @@ -70,7 +70,7 @@ export class MonacoEditorMenuContribution implements MenuContribution { // Builtin monaco language features commands. registry.registerMenuAction(EditorMainMenu.LANGUAGE_FEATURES_GROUP, { commandId: 'editor.action.quickOutline', - label: nls.localize('vscode/gotoSymbolQuickAccess/gotoSymbol', 'Go to Symbol in Editor...'), + label: nls.localizeByDefault('Go to Symbol in Editor...'), order: '1' }); registry.registerMenuAction(EditorMainMenu.LANGUAGE_FEATURES_GROUP, { @@ -102,18 +102,18 @@ export class MonacoEditorMenuContribution implements MenuContribution { // Builtin monaco problem commands. registry.registerMenuAction(MonacoMenus.MARKERS_GROUP, { commandId: 'editor.action.marker.nextInFiles', - label: nls.localize('vscode/gotoError/miGotoNextProblem', 'Next Problem'), + label: nls.localizeByDefault('Next Problem'), order: '1' }); registry.registerMenuAction(MonacoMenus.MARKERS_GROUP, { commandId: 'editor.action.marker.prevInFiles', - label: nls.localize('vscode/gotoError/miGotoPreviousProblem', 'Previous Problem'), + label: nls.localizeByDefault('Previous Problem'), order: '2' }); } protected registerPeekSubmenu(registry: MenuModelRegistry): void { - registry.registerSubmenu(MonacoMenus.PEEK_CONTEXT_SUBMENU, nls.localize('vscode/goToCommands/peek.submenu', 'Peek')); + registry.registerSubmenu(MonacoMenus.PEEK_CONTEXT_SUBMENU, nls.localizeByDefault('Peek')); for (const item of MenuRegistry.getMenuItems(monaco.actions.MenuId.EditorContextPeek)) { if (!monaco.actions.isIMenuItem(item)) { diff --git a/packages/monaco/src/browser/monaco-status-bar-contribution.ts b/packages/monaco/src/browser/monaco-status-bar-contribution.ts index baa7023728f70..be7fa6619e3c5 100644 --- a/packages/monaco/src/browser/monaco-status-bar-contribution.ts +++ b/packages/monaco/src/browser/monaco-status-bar-contribution.ts @@ -15,7 +15,7 @@ ********************************************************************************/ import { injectable, inject } from '@theia/core/shared/inversify'; -import { DisposableCollection } from '@theia/core'; +import { DisposableCollection, nls } from '@theia/core'; import { FrontendApplicationContribution, FrontendApplication, StatusBar, StatusBarAlignment } from '@theia/core/lib/browser'; import { EditorCommands, EditorManager, EditorWidget } from '@theia/editor/lib/browser'; import { MonacoEditor } from './monaco-editor'; @@ -66,13 +66,15 @@ export class MonacoStatusBarContribution implements FrontendApplicationContribut if (editor && editorModel) { const modelOptions = editorModel.getOptions(); const tabSize = modelOptions.tabSize; - const useSpaceOrTab = modelOptions.insertSpaces ? 'Spaces' : 'Tab Size'; + const useSpaceOrTab = modelOptions.insertSpaces + ? nls.localizeByDefault('Spaces: {0}', tabSize) + : nls.localizeByDefault('Tab Size: {0}', tabSize); this.statusBar.setElement('editor-status-tabbing-config', { text: `${useSpaceOrTab}: ${tabSize}`, alignment: StatusBarAlignment.RIGHT, priority: 10, command: EditorCommands.CONFIG_INDENTATION.id, - tooltip: 'Select Indentation' + tooltip: nls.localizeByDefault('Select Indentation') }); } } @@ -91,7 +93,7 @@ export class MonacoStatusBarContribution implements FrontendApplicationContribut alignment: StatusBarAlignment.RIGHT, priority: 11, command: EditorCommands.CONFIG_EOL.id, - tooltip: 'Select End Of Line Sequence' + tooltip: nls.localizeByDefault('Select End of Line Sequence') }); } } diff --git a/packages/monaco/src/browser/workspace-symbol-command.ts b/packages/monaco/src/browser/workspace-symbol-command.ts index daf679b758bfc..579139883bb1e 100644 --- a/packages/monaco/src/browser/workspace-symbol-command.ts +++ b/packages/monaco/src/browser/workspace-symbol-command.ts @@ -32,10 +32,10 @@ import { EditorMainMenu } from '@theia/editor/lib/browser'; export class WorkspaceSymbolCommand implements QuickAccessProvider, CommandContribution, KeybindingContribution, MenuContribution, CommandHandler, QuickAccessContribution { public static readonly PREFIX = '#'; - private command = Command.toLocalizedCommand({ + private command = Command.toDefaultLocalizedCommand({ id: 'languages.workspace.symbol', label: 'Go to Symbol in Workspace...' - }, 'vscode/search.contribution/showTriggerActions'); + }); @inject(MonacoLanguages) protected readonly languages: MonacoLanguages; @inject(OpenerService) protected readonly openerService: OpenerService; @@ -79,7 +79,7 @@ export class WorkspaceSymbolCommand implements QuickAccessProvider, CommandContr getInstance: () => this, prefix: WorkspaceSymbolCommand.PREFIX, placeholder: '', - helpEntries: [{ description: nls.localize('vscode/search.contribution/symbolsQuickAccess', 'Go to Symbol in Workspace'), needsEditor: false }] + helpEntries: [{ description: nls.localizeByDefault('Go to Symbol in Workspace'), needsEditor: false }] }); } diff --git a/packages/navigator/src/browser/navigator-contribution.ts b/packages/navigator/src/browser/navigator-contribution.ts index 70d2bf33285c4..10736bf0351a8 100644 --- a/packages/navigator/src/browser/navigator-contribution.ts +++ b/packages/navigator/src/browser/navigator-contribution.ts @@ -99,29 +99,29 @@ export namespace FileNavigatorCommands { label: 'Refresh in Explorer', iconClass: codicon('refresh') }, 'theia/navigator/refresh', CommonCommands.FILE_CATEGORY_KEY); - export const COLLAPSE_ALL = Command.toLocalizedCommand({ + export const COLLAPSE_ALL = Command.toDefaultLocalizedCommand({ id: 'navigator.collapse.all', category: CommonCommands.FILE_CATEGORY, label: 'Collapse Folders in Explorer', iconClass: codicon('collapse-all') - }, 'vscode/explorerView/collapseExplorerFolders', CommonCommands.FILE_CATEGORY_KEY); + }); export const ADD_ROOT_FOLDER: Command = { id: 'navigator.addRootFolder' }; - export const FOCUS = Command.toLocalizedCommand({ + export const FOCUS = Command.toDefaultLocalizedCommand({ id: 'workbench.files.action.focusFilesExplorer', category: CommonCommands.FILE_CATEGORY, label: 'Focus on Files Explorer' - }, 'vscode/fileActions/focusFilesExplorer', CommonCommands.FILE_CATEGORY_KEY); - export const COPY_RELATIVE_FILE_PATH = Command.toLocalizedCommand({ + }); + export const COPY_RELATIVE_FILE_PATH = Command.toDefaultLocalizedCommand({ id: 'navigator.copyRelativeFilePath', label: 'Copy Relative Path' - }, 'vscode/fileActions.contribution/copyRelativePath'); - export const OPEN = Command.toLocalizedCommand({ + }); + export const OPEN = Command.toDefaultLocalizedCommand({ id: 'navigator.open', category: CommonCommands.FILE_CATEGORY, label: 'Open' - }, 'vscode/dialogMainService/open', CommonCommands.FILE_CATEGORY_KEY); + }); } /** @@ -431,7 +431,7 @@ export class FileNavigatorContribution extends AbstractViewContribution { for (const opener of openers) { const openWithCommand = WorkspaceCommands.FILE_OPEN_WITH(opener); @@ -500,7 +500,7 @@ export class FileNavigatorContribution extends AbstractViewContribution(); @@ -180,7 +180,7 @@ export class OutlineViewWidget extends TreeWidget { protected renderTree(model: TreeModel): React.ReactNode { if (CompositeTreeNode.is(this.model.root) && !this.model.root.children.length) { - return
    {nls.localize('vscode/outlinePane/no-editor', 'No outline information available.')}
    ; + return
    {nls.localizeByDefault('No outline information available.')}
    ; } return super.renderTree(model); } diff --git a/packages/output/src/browser/output-commands.ts b/packages/output/src/browser/output-commands.ts index 7680175af8726..4e6fcb0dc8a7c 100644 --- a/packages/output/src/browser/output-commands.ts +++ b/packages/output/src/browser/output-commands.ts @@ -15,12 +15,12 @@ ********************************************************************************/ import { codicon } from '@theia/core/lib/browser'; -import { Command } from '@theia/core/lib/common'; +import { Command, nls } from '@theia/core/lib/common'; export namespace OutputCommands { - const OUTPUT_CATEGORY_KEY = 'vscode/outputView/output'; const OUTPUT_CATEGORY = 'Output'; + const OUTPUT_CATEGORY_KEY = nls.getDefaultKey(OUTPUT_CATEGORY); /* #region VS Code `OutputChannel` API */ // Based on: https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/vscode.d.ts#L4692-L4745 diff --git a/packages/output/src/browser/output-contribution.ts b/packages/output/src/browser/output-contribution.ts index 9121e8c775dc3..a498f243f4bb5 100644 --- a/packages/output/src/browser/output-contribution.ts +++ b/packages/output/src/browser/output-contribution.ts @@ -224,15 +224,15 @@ export class OutputContribution extends AbstractViewContribution i }); registry.registerMenuAction(OutputContextMenu.TEXT_EDIT_GROUP, { commandId: OutputCommands.COPY_ALL.id, - label: nls.localize('vscode/search.contribution/copyAllLabel', 'Copy All') + label: nls.localizeByDefault('Copy All') }); registry.registerMenuAction(OutputContextMenu.COMMAND_GROUP, { commandId: quickCommand.id, - label: nls.localize('vscode/quickAccess.contribution/commandsQuickAccess', 'Find Command...') + label: nls.localizeByDefault('Command Palette...') }); registry.registerMenuAction(OutputContextMenu.WIDGET_GROUP, { commandId: OutputCommands.CLEAR__WIDGET.id, - label: nls.localize('vscode/output.contribution/clearOutput.label', 'Clear Output') + label: nls.localizeByDefault('Clear Output') }); } diff --git a/packages/output/src/browser/output-toolbar-contribution.tsx b/packages/output/src/browser/output-toolbar-contribution.tsx index a1c8f8774c635..7b6956afe90a7 100644 --- a/packages/output/src/browser/output-toolbar-contribution.tsx +++ b/packages/output/src/browser/output-toolbar-contribution.tsx @@ -62,20 +62,20 @@ export class OutputToolbarContribution implements TabBarToolbarContribution { toolbarRegistry.registerItem({ id: OutputCommands.CLEAR__WIDGET.id, command: OutputCommands.CLEAR__WIDGET.id, - tooltip: nls.localize('vscode/output.contribution/clearOutput.label', 'Clear Output'), + tooltip: nls.localizeByDefault('Clear Output'), priority: 1, }); toolbarRegistry.registerItem({ id: OutputCommands.LOCK__WIDGET.id, command: OutputCommands.LOCK__WIDGET.id, - tooltip: nls.localize('vscode/output.contribution/outputScrollOff', 'Turn Auto Scrolling Off'), + tooltip: nls.localizeByDefault('Turn Auto Scrolling Off'), onDidChange: this.onOutputWidgetStateChanged, priority: 2 }); toolbarRegistry.registerItem({ id: OutputCommands.UNLOCK__WIDGET.id, command: OutputCommands.UNLOCK__WIDGET.id, - tooltip: nls.localize('vscode/output.contribution/outputScrollOn', 'Turn Auto Scrolling On'), + tooltip: nls.localizeByDefault('Turn Auto Scrolling On'), onDidChange: this.onOutputWidgetStateChanged, priority: 2 }); diff --git a/packages/output/src/browser/output-widget.ts b/packages/output/src/browser/output-widget.ts index d03b894b383dd..e42271041d307 100644 --- a/packages/output/src/browser/output-widget.ts +++ b/packages/output/src/browser/output-widget.ts @@ -33,7 +33,7 @@ import { nls } from '@theia/core/lib/common/nls'; export class OutputWidget extends BaseWidget implements StatefulWidget { static readonly ID = 'outputView'; - static readonly LABEL = nls.localize('vscode/settingsLayout/output', 'Output'); + static readonly LABEL = nls.localizeByDefault('Output'); @inject(SelectionService) protected readonly selectionService: SelectionService; diff --git a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts index 7589243827900..488101a3a91ad 100755 --- a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts +++ b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts @@ -379,13 +379,13 @@ export class PluginVscodeCommandsContribution implements CommandContribution { commands.registerCommand({ id: 'workbench.action.closeEditorsInGroup', - label: nls.localize('vscode/editor.contribution/closeEditorsInGroup', 'Close All Editors in Group') + label: nls.localizeByDefault('Close All Editors in Group') }, { execute: (uri?: monaco.Uri) => performActionOnGroup(this.shell.closeTabs, uri) }); commands.registerCommand({ id: 'workbench.files.saveAllInGroup', - label: nls.localize('vscode/fileActions.contribution/saveAllInGroup', 'Save All in Group') + label: nls.localizeByDefault('Save All in Group') }, { execute: (uri?: monaco.Uri) => performActionOnGroup(this.shell.saveTabs, uri) }); diff --git a/packages/preferences/src/browser/util/preference-types.ts b/packages/preferences/src/browser/util/preference-types.ts index 93797574471cc..68af26a000bff 100644 --- a/packages/preferences/src/browser/util/preference-types.ts +++ b/packages/preferences/src/browser/util/preference-types.ts @@ -113,55 +113,55 @@ export namespace PreferencesCommands { id: 'preferences:openJson.toolbar', iconClass: 'codicon codicon-json' }; - export const COPY_JSON_NAME = Command.toLocalizedCommand({ + export const COPY_JSON_NAME = Command.toDefaultLocalizedCommand({ id: 'preferences:copyJson.name', label: 'Copy Setting ID' - }, 'vscode/settingsTree/copySettingIdLabel'); - export const RESET_PREFERENCE = Command.toLocalizedCommand({ + }); + export const RESET_PREFERENCE = Command.toDefaultLocalizedCommand({ id: 'preferences:reset', label: 'Reset Setting' - }, 'vscode/settingsTree/resetSettingLabel'); + }); - export const COPY_JSON_VALUE = Command.toLocalizedCommand({ + export const COPY_JSON_VALUE = Command.toDefaultLocalizedCommand({ id: 'preferences:copyJson.value', label: 'Copy Setting as JSON', - }, 'vscode/settingsTree/copySettingAsJSONLabel'); + }); - export const OPEN_USER_PREFERENCES = Command.toLocalizedCommand({ + export const OPEN_USER_PREFERENCES = Command.toDefaultLocalizedCommand({ id: 'workbench.action.openGlobalSettings', category: CommonCommands.PREFERENCES_CATEGORY, label: 'Open User Settings', - }, 'vscode/preferences.contribution/openGlobalSettings', CommonCommands.PREFERENCES_CATEGORY_KEY); + }); - export const OPEN_WORKSPACE_PREFERENCES = Command.toLocalizedCommand({ + export const OPEN_WORKSPACE_PREFERENCES = Command.toDefaultLocalizedCommand({ id: 'workbench.action.openWorkspaceSettings', category: CommonCommands.PREFERENCES_CATEGORY, label: 'Open Workspace Settings', - }, 'vscode/preferences.contribution/openWorkspaceSettings', CommonCommands.PREFERENCES_CATEGORY_KEY); + }); - export const OPEN_FOLDER_PREFERENCES = Command.toLocalizedCommand({ + export const OPEN_FOLDER_PREFERENCES = Command.toDefaultLocalizedCommand({ id: 'workbench.action.openFolderSettings', category: CommonCommands.PREFERENCES_CATEGORY, label: 'Open Folder Settings' - }, 'vscode/preferences.contribution/openFolderSettings', CommonCommands.PREFERENCES_CATEGORY_KEY); + }); - export const OPEN_USER_PREFERENCES_JSON = Command.toLocalizedCommand({ + export const OPEN_USER_PREFERENCES_JSON = Command.toDefaultLocalizedCommand({ id: 'workbench.action.openSettingsJson', category: CommonCommands.PREFERENCES_CATEGORY, label: 'Open Settings (JSON)' - }, 'vscode/preferences.contribution/openSettingsJson', CommonCommands.PREFERENCES_CATEGORY_KEY); + }); - export const OPEN_WORKSPACE_PREFERENCES_JSON = Command.toLocalizedCommand({ + export const OPEN_WORKSPACE_PREFERENCES_JSON = Command.toDefaultLocalizedCommand({ id: 'workbench.action.openWorkspaceSettingsFile', category: CommonCommands.PREFERENCES_CATEGORY, label: 'Open Workspace Settings (JSON)', - }, 'vscode/preferences.contribution/openWorkspaceSettingsFile', CommonCommands.PREFERENCES_CATEGORY_KEY); + }); - export const OPEN_FOLDER_PREFERENCES_JSON = Command.toLocalizedCommand({ + export const OPEN_FOLDER_PREFERENCES_JSON = Command.toDefaultLocalizedCommand({ id: 'workbench.action.openFolderSettingsFile', category: CommonCommands.PREFERENCES_CATEGORY, label: 'Open Folder Settings (JSON)', - }, 'vscode/preferences.contribution/openFolderSettingsFile', CommonCommands.PREFERENCES_CATEGORY_KEY); + }); } export namespace PreferenceMenus { diff --git a/packages/preferences/src/browser/views/preference-scope-tabbar-widget.tsx b/packages/preferences/src/browser/views/preference-scope-tabbar-widget.tsx index 6080560a0ad83..f2f64cc86b51f 100644 --- a/packages/preferences/src/browser/views/preference-scope-tabbar-widget.tsx +++ b/packages/preferences/src/browser/views/preference-scope-tabbar-widget.tsx @@ -25,11 +25,11 @@ import { Preference, PreferenceMenus } from '../util/preference-types'; import { CommandRegistry, DisposableCollection, Emitter, MenuModelRegistry } from '@theia/core/lib/common'; import { nls } from '@theia/core/lib/common/nls'; -const USER_TAB_LABEL = nls.localize('vscode/preferencesWidgets/userSettings', 'User'); +const USER_TAB_LABEL = nls.localizeByDefault('User'); const USER_TAB_INDEX = PreferenceScope['User']; -const WORKSPACE_TAB_LABEL = nls.localize('vscode/preferencesWidgets/workspaceSettings', 'Workspace'); +const WORKSPACE_TAB_LABEL = nls.localizeByDefault('Workspace'); const WORKSPACE_TAB_INDEX = PreferenceScope['Workspace']; -const FOLDER_TAB_LABEL = nls.localize('vscode/preferencesWidgets/folderSettings', 'Folder'); +const FOLDER_TAB_LABEL = nls.localizeByDefault('Folder'); const FOLDER_TAB_INDEX = PreferenceScope['Folder']; const PREFERENCE_TAB_CLASSNAME = 'preferences-scope-tab'; diff --git a/packages/preferences/src/browser/views/preference-searchbar-widget.tsx b/packages/preferences/src/browser/views/preference-searchbar-widget.tsx index b6527be220894..c03f1b3cd0766 100644 --- a/packages/preferences/src/browser/views/preference-searchbar-widget.tsx +++ b/packages/preferences/src/browser/views/preference-searchbar-widget.tsx @@ -88,11 +88,11 @@ export class PreferencesSearchbarWidget extends ReactWidget implements StatefulW protected renderResultsCountOption(): React.ReactNode { let resultsFound: string; if (this.resultsCount === 0) { - resultsFound = nls.localize('vscode/settingsEditor2/noResults', 'No Settings Found'); + resultsFound = nls.localizeByDefault('No Settings Found'); } else if (this.resultsCount === 1) { - resultsFound = nls.localize('vscode/settingsEditor2/oneResult', '1 Setting Found'); + resultsFound = nls.localizeByDefault('1 Setting Found'); } else { - resultsFound = nls.localize('vscode/settingsEditor2/moreThanOneResult', '{0} Settings Found', this.resultsCount.toFixed(0)); + resultsFound = nls.localizeByDefault('{0} Settings Found', this.resultsCount.toFixed(0)); } return this.searchTermExists() ? (; } @@ -146,7 +146,7 @@ export class PreferencesSearchbarWidget extends ReactWidget implements StatefulW type="text" id={PreferencesSearchbarWidget.SEARCHBAR_ID} spellCheck={false} - placeholder={nls.localize('vscode/settingsEditor2/SearchSettings.AriaLabel', 'Search Settings')} + placeholder={nls.localizeByDefault('Search Settings')} className="settings-search-input theia-input" onChange={this.handleSearch} ref={this.searchbarRef} diff --git a/packages/preferences/src/browser/views/preference-widget.tsx b/packages/preferences/src/browser/views/preference-widget.tsx index 59dee5c2927dd..028ea68e52f7d 100644 --- a/packages/preferences/src/browser/views/preference-widget.tsx +++ b/packages/preferences/src/browser/views/preference-widget.tsx @@ -39,7 +39,7 @@ export class PreferencesWidget extends Panel implements StatefulWidget { /** * The widget `label` which is used for display purposes. */ - static readonly LABEL = nls.localize('vscode/actions/preferences', 'Preferences'); + static readonly LABEL = nls.localizeByDefault('Preferences'); @inject(PreferencesEditorWidget) protected readonly editorWidget: PreferencesEditorWidget; @inject(PreferencesTreeWidget) protected readonly treeWidget: PreferencesTreeWidget; diff --git a/packages/preview/src/browser/preview-contribution.ts b/packages/preview/src/browser/preview-contribution.ts index 451a5ff9d0ecb..c00ae6fb45fec 100644 --- a/packages/preview/src/browser/preview-contribution.ts +++ b/packages/preview/src/browser/preview-contribution.ts @@ -40,7 +40,7 @@ export namespace PreviewCommands { id: 'preview:open', label: 'Open Preview', iconClass: codicon('open-preview') - }, 'vscode/mainThreadFileSystemEventService/preview'); + }, 'vscode.markdown-language-features/package/markdown.preview.title'); export const OPEN_SOURCE: Command = { id: 'preview.open.source', iconClass: codicon('go-to-file') @@ -229,12 +229,12 @@ export class PreviewContribution extends NavigatableWidgetOpenHandler } else { this.status = { state: 'error', - errorMessage: {nls.localize('vscode/scm.contribution/no open repo', 'There is no repository selected in this workspace.')} + errorMessage: {nls.localizeByDefault('There is no repository selected in this workspace.')} }; } } diff --git a/packages/scm/src/browser/scm-contribution.ts b/packages/scm/src/browser/scm-contribution.ts index 6ece5be4a5f1a..f9b19ace25d05 100644 --- a/packages/scm/src/browser/scm-contribution.ts +++ b/packages/scm/src/browser/scm-contribution.ts @@ -41,7 +41,7 @@ import { nls } from '@theia/core/lib/common/nls'; export const SCM_WIDGET_FACTORY_ID = ScmWidget.ID; export const SCM_VIEW_CONTAINER_ID = 'scm-view-container'; export const SCM_VIEW_CONTAINER_TITLE_OPTIONS: ViewContainerTitleOptions = { - label: nls.localize('vscode/scm.contribution/source control', 'Source Control'), + label: nls.localizeByDefault('Source Control'), iconClass: codicon('source-control'), closeable: true }; @@ -57,24 +57,24 @@ export namespace SCM_COMMANDS { }; export const TREE_VIEW_MODE = { id: 'scm.viewmode.tree', - tooltip: nls.localize('vscode/scmViewPane/viewModeTree', 'Toggle to Tree View'), + tooltip: nls.localizeByDefault('View as Tree'), iconClass: codicon('list-tree'), - originalLabel: 'Toggle to Tree View', - label: nls.localize('vscode/scmViewPane/viewModeTree', 'Toggle to Tree View') + originalLabel: 'View as Tree', + label: nls.localizeByDefault('View as Tree') }; export const LIST_VIEW_MODE = { id: 'scm.viewmode.list', - tooltip: nls.localize('vscode/scmViewPane/viewModeList', 'Toggle to List View'), + tooltip: nls.localizeByDefault('View as List'), iconClass: codicon('list-flat'), - originalLabel: 'Toggle to List View', - label: nls.localize('vscode/scmViewPane/viewModeList', 'Toggle to List View') + originalLabel: 'View as List', + label: nls.localizeByDefault('View as List') }; export const COLLAPSE_ALL = { id: 'scm.collapseAll', category: 'SCM', - tooltip: nls.localize('vscode/treeView/collapseAll', 'Collapse All'), + tooltip: nls.localizeByDefault('Collapse All'), iconClass: codicon('collapse-all'), - label: nls.localize('vscode/treeView/collapseAll', 'Collapse All'), + label: nls.localizeByDefault('Collapse All'), originalLabel: 'Collapse All' }; } diff --git a/packages/scm/src/browser/scm-no-repository-widget.tsx b/packages/scm/src/browser/scm-no-repository-widget.tsx index fed9e012fac8d..9737abefb13fa 100644 --- a/packages/scm/src/browser/scm-no-repository-widget.tsx +++ b/packages/scm/src/browser/scm-no-repository-widget.tsx @@ -34,7 +34,7 @@ export class ScmNoRepositoryWidget extends ReactWidget { protected render(): React.ReactNode { return ; } diff --git a/packages/scm/src/browser/scm-preferences.ts b/packages/scm/src/browser/scm-preferences.ts index f2353b0da9c0b..eb56adca69c60 100644 --- a/packages/scm/src/browser/scm-preferences.ts +++ b/packages/scm/src/browser/scm-preferences.ts @@ -31,10 +31,10 @@ export const scmPreferenceSchema: PreferenceSchema = { type: 'string', enum: ['tree', 'list'], enumDescriptions: [ - nls.localize('vscode/scm.contribution/scm.defaultViewMode.tree', 'Show the repository changes as a tree.'), - nls.localize('vscode/scm.contribution/scm.defaultViewMode.list', 'Show the repository changes as a list.') + nls.localizeByDefault('Show the repository changes as a tree.'), + nls.localizeByDefault('Show the repository changes as a list.') ], - description: nls.localize('vscode/scm.contribution/scm.defaultViewMode', 'Controls the default source control view mode.'), + description: nls.localizeByDefault('Controls the default Source Control repository view mode.'), default: 'list' } } diff --git a/packages/scm/src/browser/scm-widget.tsx b/packages/scm/src/browser/scm-widget.tsx index d2c885eb34eb8..e0a30cbd55ef9 100644 --- a/packages/scm/src/browser/scm-widget.tsx +++ b/packages/scm/src/browser/scm-widget.tsx @@ -104,7 +104,7 @@ export class ScmWidget extends BaseWidget implements StatefulWidget { this.toDisposeOnRefresh.dispose(); this.toDispose.push(this.toDisposeOnRefresh); const repository = this.scmService.selectedRepository; - this.title.label = repository ? repository.provider.label : nls.localize('vscode/scm.contribution/no open repo', 'No repository found'); + this.title.label = repository ? repository.provider.label : nls.localize('theia/scm/noRepositoryFound', 'No repository found'); this.title.caption = this.title.label; this.update(); if (repository) { diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts b/packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts index bec20605a2944..ac7ba2a8100c6 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts +++ b/packages/search-in-workspace/src/browser/search-in-workspace-frontend-contribution.ts @@ -31,56 +31,55 @@ import { FileService } from '@theia/filesystem/lib/browser/file-service'; import { SEARCH_VIEW_CONTAINER_ID } from './search-in-workspace-factory'; export namespace SearchInWorkspaceCommands { - const SEARCH_CATEGORY_KEY = 'vscode/search.contribution/search'; const SEARCH_CATEGORY = 'Search'; export const TOGGLE_SIW_WIDGET = { id: 'search-in-workspace.toggle' }; - export const OPEN_SIW_WIDGET = Command.toLocalizedCommand({ + export const OPEN_SIW_WIDGET = Command.toDefaultLocalizedCommand({ id: 'search-in-workspace.open', category: SEARCH_CATEGORY, label: 'Find in Files' - }, 'vscode/search.contribution/findInFiles', SEARCH_CATEGORY_KEY); - export const REPLACE_IN_FILES = Command.toLocalizedCommand({ + }); + export const REPLACE_IN_FILES = Command.toDefaultLocalizedCommand({ id: 'search-in-workspace.replace', category: SEARCH_CATEGORY, label: 'Replace in Files' - }, 'vscode/searchActions/replaceInFiles', SEARCH_CATEGORY_KEY); + }); export const FIND_IN_FOLDER = Command.toLocalizedCommand({ id: 'search-in-workspace.in-folder', category: SEARCH_CATEGORY, label: 'Find in Folder' - }, 'vscode/search.contribution/findInFolder', SEARCH_CATEGORY_KEY); - export const REFRESH_RESULTS = Command.toLocalizedCommand({ + }); + export const REFRESH_RESULTS = Command.toDefaultLocalizedCommand({ id: 'search-in-workspace.refresh', category: SEARCH_CATEGORY, label: 'Refresh', iconClass: codicon('refresh') - }, 'vscode/search.contribution/RefreshAction.label', SEARCH_CATEGORY_KEY); - export const CANCEL_SEARCH = Command.toLocalizedCommand({ + }); + export const CANCEL_SEARCH = Command.toDefaultLocalizedCommand({ id: 'search-in-workspace.cancel', category: SEARCH_CATEGORY, label: 'Cancel Search', iconClass: codicon('search-stop') - }, 'vscode/search.contribution/CancelSearchAction.label', SEARCH_CATEGORY_KEY); - export const COLLAPSE_ALL = Command.toLocalizedCommand({ + }); + export const COLLAPSE_ALL = Command.toDefaultLocalizedCommand({ id: 'search-in-workspace.collapse-all', category: SEARCH_CATEGORY, label: 'Collapse All', iconClass: codicon('collapse-all') - }, 'vscode/search.contribution/CollapseDeepestExpandedLevelAction.label', SEARCH_CATEGORY_KEY); - export const EXPAND_ALL = Command.toLocalizedCommand({ + }); + export const EXPAND_ALL = Command.toDefaultLocalizedCommand({ id: 'search-in-workspace.expand-all', category: SEARCH_CATEGORY, label: 'Expand All', iconClass: codicon('expand-all') - }, 'vscode/search.contribution/ExpandAllAction.label', SEARCH_CATEGORY_KEY); - export const CLEAR_ALL = Command.toLocalizedCommand({ + }); + export const CLEAR_ALL = Command.toDefaultLocalizedCommand({ id: 'search-in-workspace.clear-all', category: SEARCH_CATEGORY, label: 'Clear Search Results', iconClass: codicon('clear-all') - }, 'vscode/search.contribution/ClearSearchResultsAction.label', SEARCH_CATEGORY_KEY); + }); } @injectable() diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-preferences.ts b/packages/search-in-workspace/src/browser/search-in-workspace-preferences.ts index c2fbea4fc8237..1761075fb3bd4 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-preferences.ts +++ b/packages/search-in-workspace/src/browser/search-in-workspace-preferences.ts @@ -22,24 +22,24 @@ export const searchInWorkspacePreferencesSchema: PreferenceSchema = { type: 'object', properties: { 'search.lineNumbers': { - description: nls.localize('vscode/search.contribution/search.showLineNumbers', 'Controls whether to show line numbers for search results.'), + description: nls.localizeByDefault('Controls whether to show line numbers for search results.'), default: false, type: 'boolean', }, 'search.collapseResults': { - description: nls.localize('vscode/search.contribution/search.collapseAllResults', 'Controls whether the search results will be collapsed or expanded.'), + description: nls.localizeByDefault('Controls whether the search results will be collapsed or expanded.'), default: 'auto', type: 'string', enum: ['auto', 'alwaysCollapse', 'alwaysExpand'], }, 'search.searchOnType': { - description: nls.localize('vscode/search.contribution/search.searchOnType', 'Search all files as you type in the search field.'), + description: nls.localizeByDefault('Search all files as you type.'), default: true, type: 'boolean', }, 'search.searchOnTypeDebouncePeriod': { // eslint-disable-next-line max-len - description: nls.localize('vscode/search.contribution/search.searchOnTypeDebouncePeriod', 'When `search.searchOnType` is enabled, controls the timeout in milliseconds between a character being typed and the search starting. Has no effect when `search.searchOnType` is disabled.'), + description: nls.localizeByDefault('When `#search.searchOnType#` is enabled, controls the timeout in milliseconds between a character being typed and the search starting. Has no effect when `search.searchOnType` is disabled.'), default: 300, type: 'number', }, @@ -50,7 +50,7 @@ export const searchInWorkspacePreferencesSchema: PreferenceSchema = { }, 'search.smartCase': { // eslint-disable-next-line max-len - description: nls.localize('vscode/search.contribution/search.smartCase', 'Search case-insensitively if the pattern is all lowercase, otherwise, search case-sensitively.'), + description: nls.localizeByDefault('Search case-insensitively if the pattern is all lowercase, otherwise, search case-sensitively.'), default: false, type: 'boolean', } diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx index b4fb6a550b7b7..056ff9045fafa 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx +++ b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx @@ -740,8 +740,8 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget { return this.doReplace(node, e)} title={isResultLineNode - ? nls.localize('vscode/findWidget/label.replaceButton', 'Replace') - : nls.localize('vscode/findWidget/label.replaceAllButton', 'Replace All') + ? nls.localizeByDefault('Replace') + : nls.localizeByDefault('Replace All') }>; } @@ -786,7 +786,7 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget { protected confirmReplaceAll(resultNumber: number, fileNumber: number): Promise { return new ConfirmDialog({ - title: nls.localize('vscode/findWidget/label.replaceAllButton', 'Replace All'), + title: nls.localizeByDefault('Replace All'), msg: this.buildReplaceAllConfirmationMessage(resultNumber, fileNumber, this._replaceTerm) }).open(); } @@ -795,39 +795,39 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget { if (occurrences === 1) { if (fileCount === 1) { if (replaceValue) { - return nls.localize('vscode/searchView/removeAll.occurrence.file.confirmation.message', + return nls.localizeByDefault( "Replace {0} occurrence across {1} file with '{2}'?", occurrences, fileCount, replaceValue); } - return nls.localize('vscode/searchView/replaceAll.occurrence.file.confirmation.message', + return nls.localizeByDefault( 'Replace {0} occurrence across {1} file?', occurrences, fileCount); } if (replaceValue) { - return nls.localize('vscode/searchView/removeAll.occurrence.files.confirmation.message', + return nls.localizeByDefault( "Replace {0} occurrence across {1} files with '{2}'?", occurrences, fileCount, replaceValue); } - return nls.localize('vscode/searchView/replaceAll.occurrence.files.confirmation.message', + return nls.localizeByDefault( 'Replace {0} occurrence across {1} files?', occurrences, fileCount); } if (fileCount === 1) { if (replaceValue) { - return nls.localize('vscode/searchView/removeAll.occurrences.file.confirmation.message', + return nls.localizeByDefault( "Replace {0} occurrences across {1} file with '{2}'?", occurrences, fileCount, replaceValue); } - return nls.localize('vscode/searchView/replaceAll.occurrences.file.confirmation.message', + return nls.localizeByDefault( 'Replace {0} occurrences across {1} file?', occurrences, fileCount); } if (replaceValue) { - return nls.localize('vscode/searchView/removeAll.occurrences.files.confirmation.message', + return nls.localizeByDefault( "Replace {0} occurrences across {1} files with '{2}'?", occurrences, fileCount, replaceValue); } - return nls.localize('vscode/searchView/replaceAll.occurrences.files.confirmation.message', + return nls.localizeByDefault( 'Replace {0} occurrences across {1} files?', occurrences, fileCount); } diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-widget.tsx b/packages/search-in-workspace/src/browser/search-in-workspace-widget.tsx index e8930c482c4ee..d0161b57f3b7d 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-widget.tsx +++ b/packages/search-in-workspace/src/browser/search-in-workspace-widget.tsx @@ -40,7 +40,7 @@ export interface SearchFieldState { export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidget { static ID = 'search-in-workspace'; - static LABEL = nls.localize('vscode/search.contribution/search', 'Search'); + static LABEL = nls.localizeByDefault('Search'); protected matchCaseState: SearchFieldState; protected wholeWordState: SearchFieldState; @@ -118,17 +118,17 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge this.matchCaseState = { className: codicon('case-sensitive'), enabled: false, - title: nls.localize('vscode/findInputCheckboxes/caseDescription', 'Match Case') + title: nls.localizeByDefault('Match Case') }; this.wholeWordState = { className: codicon('whole-word'), enabled: false, - title: nls.localize('vscode/findInputCheckboxes/wordsDescription', 'Match Whole Word') + title: nls.localizeByDefault('Match Whole Word') }; this.regExpState = { className: codicon('regex'), enabled: false, - title: nls.localize('vscode/findInputCheckboxes/regexDescription', 'Use Regular Expression') + title: nls.localizeByDefault('Use Regular Expression') }; this.includeIgnoredState = { className: codicon('eye'), @@ -197,9 +197,9 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge this.regExpState = oldState.regExpState; this.includeIgnoredState = oldState.includeIgnoredState; // Override the title of the restored state, as we could have changed languages in between - this.matchCaseState.title = nls.localize('vscode/findInputCheckboxes/caseDescription', 'Match Case'); - this.wholeWordState.title = nls.localize('vscode/findInputCheckboxes/wordsDescription', 'Match Whole Word'); - this.regExpState.title = nls.localize('vscode/findInputCheckboxes/regexDescription', 'Use Regular Expression'); + this.matchCaseState.title = nls.localizeByDefault('Match Case'); + this.wholeWordState.title = nls.localizeByDefault('Match Whole Word'); + this.regExpState.title = nls.localizeByDefault('Use Regular Expression'); this.includeIgnoredState.title = nls.localize('theia/search-in-workspace/includeIgnoredFiles', 'Include Ignored Files'); this.showSearchDetails = oldState.showSearchDetails; this.searchInWorkspaceOptions = oldState.searchInWorkspaceOptions; @@ -367,7 +367,7 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge protected renderReplaceFieldToggle(): React.ReactNode { const toggle = ; return
    { @@ -515,7 +515,7 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge protected renderReplaceField(): React.ReactNode { const replaceAllButtonContainer = this.renderReplaceAllButtonContainer(); - const replace = nls.localize('vscode/findWidget/label.replaceButton', 'Replace'); + const replace = nls.localizeByDefault('Replace'); return
    0; return
    { if (enabled) { @@ -598,7 +598,7 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge protected renderExpandGlobFieldsButton(): React.ReactNode { return
    { this.showSearchDetails = !this.showSearchDetails; @@ -679,28 +679,28 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge let message: string; if (isIncludesPresent && isExcludesPresent) { - message = nls.localize('vscode/searchView/noResultsIncludesExcludes', "No results found in '{0}' excluding '{1}' - ", + message = nls.localizeByDefault("No results found in '{0}' excluding '{1}' - ", this.searchInWorkspaceOptions.include!.toString(), this.searchInWorkspaceOptions.exclude!.toString()); } else if (isIncludesPresent) { - message = nls.localize('vscode/searchView/noResultsIncludes', "No results found in '{0}' - ", + message = nls.localizeByDefault("No results found in '{0}' - ", this.searchInWorkspaceOptions.include!.toString()); } else if (isExcludesPresent) { - message = nls.localize('vscode/searchView/noResultsExcludes', "No results found excluding '{0}' - ", + message = nls.localizeByDefault("No results found excluding '{0}' - ", this.searchInWorkspaceOptions.exclude!.toString()); } else { - message = nls.localize('vscode/searchView/noResultsFound', 'No results found. - '); + message = nls.localizeByDefault('No results found. - '); } // We have to trim here as vscode will always add a trailing " - " string return message.substring(0, message.length - 2).trim(); } else { if (this.resultNumber === 1 && this.resultTreeWidget.fileNumber === 1) { - return nls.localize('vscode/searchView/search.file.result', '{0} result in {1} file', + return nls.localizeByDefault('{0} result in {1} file', this.resultNumber.toString(), this.resultTreeWidget.fileNumber.toString()); } else if (this.resultTreeWidget.fileNumber === 1) { - return nls.localize('vscode/searchView/search.file.results', '{0} results in {1} file', + return nls.localizeByDefault('{0} results in {1} file', this.resultNumber.toString(), this.resultTreeWidget.fileNumber.toString()); } else if (this.resultTreeWidget.fileNumber > 0) { - return nls.localize('vscode/searchView/search.files.results', '{0} results in {1} files', + return nls.localizeByDefault('{0} results in {1} files', this.resultNumber.toString(), this.resultTreeWidget.fileNumber.toString()); } else { // if fileNumber === 0, return undefined so that `onUpdateRequest()` would not re-render component diff --git a/packages/task/src/browser/task-frontend-contribution.ts b/packages/task/src/browser/task-frontend-contribution.ts index ae1ffc60a14b5..97f8a92337467 100644 --- a/packages/task/src/browser/task-frontend-contribution.ts +++ b/packages/task/src/browser/task-frontend-contribution.ts @@ -15,7 +15,7 @@ ********************************************************************************/ import { inject, injectable, named, postConstruct } from '@theia/core/shared/inversify'; -import { ILogger, ContributionProvider, CommandContribution, Command, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core/lib/common'; +import { ILogger, ContributionProvider, CommandContribution, Command, CommandRegistry, MenuContribution, MenuModelRegistry, nls } from '@theia/core/lib/common'; import { QuickOpenTask, TaskTerminateQuickOpen, TaskRunningQuickOpen, TaskRestartRunningQuickOpen } from './quick-open-task'; import { FrontendApplication, FrontendApplicationContribution, QuickAccessContribution, @@ -31,36 +31,36 @@ import { EditorManager } from '@theia/editor/lib/browser'; import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service'; export namespace TaskCommands { - const TASK_CATEGORY_KEY = 'vscode/settingsLayout/task'; const TASK_CATEGORY = 'Task'; - export const TASK_RUN = Command.toLocalizedCommand({ + const TASK_CATEGORY_KEY = nls.getDefaultKey(TASK_CATEGORY); + export const TASK_RUN = Command.toDefaultLocalizedCommand({ id: 'task:run', category: TASK_CATEGORY, label: 'Run Task...' - }, 'vscode/task.contribution/RunTaskAction.label', TASK_CATEGORY_KEY); + }); - export const TASK_RUN_BUILD = Command.toLocalizedCommand({ + export const TASK_RUN_BUILD = Command.toDefaultLocalizedCommand({ id: 'task:run:build', category: TASK_CATEGORY, - label: 'Run Build Task...' - }, 'vscode/task.contribution/BuildAction.label', TASK_CATEGORY_KEY); + label: 'Run Build Task' + }); - export const TASK_RUN_TEST = Command.toLocalizedCommand({ + export const TASK_RUN_TEST = Command.toDefaultLocalizedCommand({ id: 'task:run:test', category: TASK_CATEGORY, - label: 'Run Test Task...' - }, 'vscode/task.contribution/TestAction.label', TASK_CATEGORY_KEY); + label: 'Run Test Task' + }); export const WORKBENCH_RUN_TASK = Command.toLocalizedCommand({ id: 'workbench.action.tasks.runTask', category: TASK_CATEGORY }, '', TASK_CATEGORY_KEY); - export const TASK_RUN_LAST = Command.toLocalizedCommand({ + export const TASK_RUN_LAST = Command.toDefaultLocalizedCommand({ id: 'task:run:last', category: TASK_CATEGORY, - label: 'Run Last Task' - }, 'vscode/task.contribution/ReRunTaskAction.label', TASK_CATEGORY_KEY); + label: 'Rerun Last Task' + }); export const TASK_ATTACH = Command.toLocalizedCommand({ id: 'task:attach', @@ -68,17 +68,17 @@ export namespace TaskCommands { label: 'Attach Task...' }, 'theia/task/attachTask', TASK_CATEGORY_KEY); - export const TASK_RUN_TEXT = Command.toLocalizedCommand({ + export const TASK_RUN_TEXT = Command.toDefaultLocalizedCommand({ id: 'task:run:text', category: TASK_CATEGORY, label: 'Run Selected Text' - }, 'vscode/terminalMenu/miRunSelectedText', TASK_CATEGORY_KEY); + }); - export const TASK_CONFIGURE = Command.toLocalizedCommand({ + export const TASK_CONFIGURE = Command.toDefaultLocalizedCommand({ id: 'task:configure', category: TASK_CATEGORY, label: 'Configure Tasks...' - }, 'vscode/task.contribution/miConfigureTask', TASK_CATEGORY_KEY); + }); export const TASK_OPEN_USER = Command.toLocalizedCommand({ id: 'task:open_user', @@ -92,23 +92,23 @@ export namespace TaskCommands { label: 'Clear History' }, 'theia/task/clearHistory', TASK_CATEGORY_KEY); - export const TASK_SHOW_RUNNING = Command.toLocalizedCommand({ + export const TASK_SHOW_RUNNING = Command.toDefaultLocalizedCommand({ id: 'task:show-running', category: TASK_CATEGORY, label: 'Show Running Tasks' - }, 'vscode/task.contribution/runningTasks', TASK_CATEGORY_KEY); + }); - export const TASK_TERMINATE = Command.toLocalizedCommand({ + export const TASK_TERMINATE = Command.toDefaultLocalizedCommand({ id: 'task:terminate', category: TASK_CATEGORY, label: 'Terminate Task' - }, 'vscode/abstractTaskService/terminateTask', TASK_CATEGORY_KEY); + }); - export const TASK_RESTART_RUNNING = Command.toLocalizedCommand({ + export const TASK_RESTART_RUNNING = Command.toDefaultLocalizedCommand({ id: 'task:restart-running', category: TASK_CATEGORY, label: 'Restart Running Task...' - }, 'vscode/abstractTaskService/restartTask', TASK_CATEGORY_KEY); + }); } const TASKS_STORAGE_KEY = 'tasks'; diff --git a/packages/terminal/src/browser/terminal-frontend-contribution.ts b/packages/terminal/src/browser/terminal-frontend-contribution.ts index e14ad513030a8..5e87cb2927609 100644 --- a/packages/terminal/src/browser/terminal-frontend-contribution.ts +++ b/packages/terminal/src/browser/terminal-frontend-contribution.ts @@ -65,78 +65,77 @@ export namespace TerminalMenus { } export namespace TerminalCommands { - const TERMINAL_CATEGORY_KEY = 'vscode/settingsLayout/terminal'; const TERMINAL_CATEGORY = 'Terminal'; - export const NEW = Command.toLocalizedCommand({ + export const NEW = Command.toDefaultLocalizedCommand({ id: 'terminal:new', category: TERMINAL_CATEGORY, - label: 'Open New Terminal' - }, 'vscode/terminalActions/workbench.action.terminal.new', TERMINAL_CATEGORY_KEY); - export const NEW_ACTIVE_WORKSPACE = Command.toLocalizedCommand({ + label: 'Create New Integrated Terminal' + }); + export const NEW_ACTIVE_WORKSPACE = Command.toDefaultLocalizedCommand({ id: 'terminal:new:active:workspace', category: TERMINAL_CATEGORY, - label: 'Open New Terminal (In Active Workspace)' - }, 'vscode/terminalActions/workbench.action.terminal.newInActiveWorkspace', TERMINAL_CATEGORY_KEY); - export const TERMINAL_CLEAR = Command.toLocalizedCommand({ + label: 'Create New Integrated Terminal (In Active Workspace)' + }); + export const TERMINAL_CLEAR = Command.toDefaultLocalizedCommand({ id: 'terminal:clear', category: TERMINAL_CATEGORY, - label: 'Clear Terminal' - }, 'vscode/terminalActions/workbench.action.terminal.clear', TERMINAL_CATEGORY_KEY); - export const TERMINAL_CONTEXT = Command.toLocalizedCommand({ + label: 'Clear' + }); + export const TERMINAL_CONTEXT = Command.toDefaultLocalizedCommand({ id: 'terminal:context', category: TERMINAL_CATEGORY, label: 'Open in Terminal' - }, 'vscode/scm.contribution/open in terminal', TERMINAL_CATEGORY_KEY); - export const SPLIT = Command.toLocalizedCommand({ + }); + export const SPLIT = Command.toDefaultLocalizedCommand({ id: 'terminal:split', category: TERMINAL_CATEGORY, label: 'Split Terminal' - }, 'vscode/terminalActions/workbench.action.terminal.split', TERMINAL_CATEGORY_KEY); - export const TERMINAL_FIND_TEXT = Command.toLocalizedCommand({ + }); + export const TERMINAL_FIND_TEXT = Command.toDefaultLocalizedCommand({ id: 'terminal:find', category: TERMINAL_CATEGORY, label: 'Find' - }, 'vscode/findController/startFindAction', TERMINAL_CATEGORY_KEY); - export const TERMINAL_FIND_TEXT_CANCEL = Command.toLocalizedCommand({ + }); + export const TERMINAL_FIND_TEXT_CANCEL = Command.toDefaultLocalizedCommand({ id: 'terminal:find:cancel', category: TERMINAL_CATEGORY, - label: 'Hide find widget' - }, 'vscode/terminalActions/workbench.action.terminal.hideFind', TERMINAL_CATEGORY_KEY); + label: 'Hide Find' + }); - export const SCROLL_LINE_UP = Command.toLocalizedCommand({ + export const SCROLL_LINE_UP = Command.toDefaultLocalizedCommand({ id: 'terminal:scroll:line:up', category: TERMINAL_CATEGORY, - label: 'Scroll line up' - }, 'vscode/terminalActions/workbench.action.terminal.scrollUp', TERMINAL_CATEGORY_KEY); - export const SCROLL_LINE_DOWN = Command.toLocalizedCommand({ + label: 'Scroll Up (Line)' + }); + export const SCROLL_LINE_DOWN = Command.toDefaultLocalizedCommand({ id: 'terminal:scroll:line:down', category: TERMINAL_CATEGORY, - label: 'Scroll line down' - }, 'vscode/terminalActions/workbench.action.terminal.scrollDown', TERMINAL_CATEGORY_KEY); - export const SCROLL_TO_TOP = Command.toLocalizedCommand({ + label: 'Scroll Down (Line)' + }); + export const SCROLL_TO_TOP = Command.toDefaultLocalizedCommand({ id: 'terminal:scroll:top', category: TERMINAL_CATEGORY, - label: 'Scroll to top' - }, 'vscode/terminalActions/workbench.action.terminal.scrollToTop', TERMINAL_CATEGORY_KEY); - export const SCROLL_PAGE_UP = Command.toLocalizedCommand({ + label: 'Scroll to Top' + }); + export const SCROLL_PAGE_UP = Command.toDefaultLocalizedCommand({ id: 'terminal:scroll:page:up', category: TERMINAL_CATEGORY, - label: 'Scroll page up' - }, 'vscode/terminalActions/workbench.action.terminal.scrollUpPage', TERMINAL_CATEGORY_KEY); - export const SCROLL_PAGE_DOWN = Command.toLocalizedCommand({ + label: 'Scroll Up (Page)' + }); + export const SCROLL_PAGE_DOWN = Command.toDefaultLocalizedCommand({ id: 'terminal:scroll:page:down', category: TERMINAL_CATEGORY, - label: 'Scroll page down' - }, 'vscode/terminalActions/workbench.action.terminal.scrollDownPage', TERMINAL_CATEGORY_KEY); + label: 'Scroll Down (Page)' + }); /** * Command that displays all terminals that are currently opened */ - export const SHOW_ALL_OPENED_TERMINALS = Command.toLocalizedCommand({ + export const SHOW_ALL_OPENED_TERMINALS = Command.toDefaultLocalizedCommand({ id: 'workbench.action.showAllTerminals', category: CommonCommands.VIEW_CATEGORY, label: 'Show All Opened Terminals' - }, 'vscode/terminal.contribution/tasksQuickAccessHelp', CommonCommands.VIEW_CATEGORY_KEY); + }); } @injectable() @@ -394,7 +393,7 @@ export class TerminalFrontendContribution implements TerminalService, CommandCon menus.registerSubmenu(TerminalMenus.TERMINAL, TerminalWidgetImpl.LABEL); menus.registerMenuAction(TerminalMenus.TERMINAL_NEW, { commandId: TerminalCommands.NEW.id, - label: nls.localize('vscode/terminalActions/workbench.action.terminal.new.short', 'New Terminal'), + label: nls.localizeByDefault('New Terminal'), order: '0' }); menus.registerMenuAction(TerminalMenus.TERMINAL_NEW, { @@ -600,7 +599,7 @@ export class TerminalFrontendContribution implements TerminalService, CommandCon resource })); const selectedItem = await this.quickInputService?.showQuickPick(items, { - placeholder: nls.localize('vscode/terminalActions/workbench.action.terminal.newWorkspacePlaceholder', 'Select current working directory for new terminal') + placeholder: nls.localizeByDefault('Select current working directory for new terminal') }); resolve(selectedItem?.resource?.toString()); } diff --git a/packages/terminal/src/browser/terminal-preferences.ts b/packages/terminal/src/browser/terminal-preferences.ts index 1db95d96378e5..fe2cb9a414e38 100644 --- a/packages/terminal/src/browser/terminal-preferences.ts +++ b/packages/terminal/src/browser/terminal-preferences.ts @@ -36,109 +36,109 @@ export const TerminalConfigSchema: PreferenceSchema = { }, 'terminal.integrated.fontFamily': { type: 'string', - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.fontFamily', 'Controls the font family of the terminal.'), + description: nls.localizeByDefault("Controls the font family of the terminal, this defaults to `#editor.fontFamily#`'s value."), default: EDITOR_FONT_DEFAULTS.fontFamily }, 'terminal.integrated.fontSize': { type: 'number', - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.fontSize', 'Controls the font size in pixels of the terminal.'), + description: nls.localizeByDefault('Controls the font size in pixels of the terminal.'), minimum: 6, default: EDITOR_FONT_DEFAULTS.fontSize }, 'terminal.integrated.fontWeight': { type: 'string', enum: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'], - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.fontWeight', 'The font weight to use within the terminal for non-bold text.'), + description: nls.localizeByDefault('The font weight to use within the terminal for non-bold text. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.'), default: 'normal' }, 'terminal.integrated.fontWeightBold': { type: 'string', enum: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'], - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.fontWeightBold', 'The font weight to use within the terminal for bold text.'), + description: nls.localizeByDefault('The font weight to use within the terminal for bold text. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.'), default: 'bold' }, 'terminal.integrated.drawBoldTextInBrightColors': { - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.drawBoldTextInBrightColors', 'Controls whether to draw bold text in bright colors.'), + description: nls.localizeByDefault('Controls whether bold text in the terminal will always use the \"bright\" ANSI color variant.'), type: 'boolean', default: true, }, 'terminal.integrated.letterSpacing': { - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.letterSpacing', 'Controls the letter spacing of the terminal, this is an integer value which represents the amount of additional pixels to add between characters.'), + description: nls.localizeByDefault('Controls the letter spacing of the terminal, this is an integer value which represents the amount of additional pixels to add between characters.'), type: 'number', default: 1 }, 'terminal.integrated.lineHeight': { - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.lineHeight', 'Controls the line height of the terminal, this number is multiplied by the terminal font size to get the actual line-height in pixels.'), + description: nls.localizeByDefault('Controls the line height of the terminal, this number is multiplied by the terminal font size to get the actual line-height in pixels.'), type: 'number', minimum: 1, default: 1 }, 'terminal.integrated.scrollback': { - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.scrollback', 'Controls the maximum amount of lines the terminal keeps in its buffer.'), + description: nls.localizeByDefault('Controls the maximum amount of lines the terminal keeps in its buffer.'), type: 'number', default: 1000 }, 'terminal.integrated.fastScrollSensitivity': { - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.fastScrollSensitivity', 'Controls the scrolling speed when pressing \'alt\'.'), + description: nls.localizeByDefault('Scrolling speed multiplier when pressing `Alt`.'), type: 'number', default: 5, }, 'terminal.integrated.rendererType': { - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.rendererType', 'Controls how the terminal is rendered.'), + description: nls.localizeByDefault('Controls how the terminal is rendered.'), type: 'string', enum: ['canvas', 'dom'], default: 'canvas' }, 'terminal.integrated.copyOnSelection': { - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.copyOnSelection', 'Controls whether text selected in the terminal will be copied to the clipboard.'), + description: nls.localizeByDefault('Controls whether text selected in the terminal will be copied to the clipboard.'), type: 'boolean', default: false, }, 'terminal.integrated.cursorBlinking': { - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.cursorBlinking', 'Controls whether the terminal cursor blinks.'), + description: nls.localizeByDefault('Controls whether the terminal cursor blinks.'), type: 'boolean', default: false }, 'terminal.integrated.cursorStyle': { - description: nls.localize('vscode/terminalConfiguration/terminal.integrated.cursorStyle', 'Controls the style of the terminal cursor.'), + description: nls.localizeByDefault('Controls the style of terminal cursor.'), enum: ['block', 'underline', 'line'], default: 'block' }, 'terminal.integrated.cursorWidth': { - markdownDescription: nls.localize('vscode/terminalConfiguration/terminal.integrated.cursorWidth', 'Controls the width of the cursor when `#terminal.integrated.cursorStyle#` is set to `line`.'), + markdownDescription: nls.localizeByDefault('Controls the width of the cursor when `#terminal.integrated.cursorStyle#` is set to `line`.'), type: 'number', default: 1 }, 'terminal.integrated.shell.windows': { type: ['string', 'null'], - markdownDescription: nls.localize('vscode/terminalConfiguration/terminal.integrated.shell.windows', 'The path of the shell that the terminal uses on Windows. (default: C:\\Windows\\System32\\cmd.exe).'), + markdownDescription: nls.localize('theia/terminal/shellWindows', 'The path of the shell that the terminal uses on Windows. (default: \'{0}\').', 'C:\\Windows\\System32\\cmd.exe'), default: undefined }, 'terminal.integrated.shell.osx': { type: ['string', 'null'], - markdownDescription: nls.localize('vscode/terminalConfiguration/terminal.integrated.shell.osx', 'The path of the shell that the terminal uses on macOS (default: \'/bin/bash\'}).'), + markdownDescription: nls.localize('theia/terminal/shellOsx', 'The path of the shell that the terminal uses on macOS (default: \'{0}\'}).', '/bin/bash'), default: undefined }, 'terminal.integrated.shell.linux': { type: ['string', 'null'], - markdownDescription: nls.localize('vscode/terminalConfiguration/terminal.integrated.shell.linux', 'The path of the shell that the terminal uses on Linux (default: \'/bin/bash\'}).'), + markdownDescription: nls.localize('theia/terminal/shellLinux', 'The path of the shell that the terminal uses on Linux (default: \'{0}\'}).', '/bin/bash'), default: undefined }, 'terminal.integrated.shellArgs.windows': { type: 'array', - markdownDescription: nls.localize('vscode/terminalConfiguration/terminal.integrated.shellArgs.windows', 'The command line arguments to use when on the Windows terminal.'), + markdownDescription: nls.localize('theia/terminal/shellArgsWindows', 'The command line arguments to use when on the Windows terminal.'), default: [] }, 'terminal.integrated.shellArgs.osx': { type: 'array', - markdownDescription: nls.localize('vscode/terminalConfiguration/terminal.integrated.shellArgs.osx', 'The command line arguments to use when on the macOS terminal.'), + markdownDescription: nls.localize('theia/terminal/shellArgsOsx', 'The command line arguments to use when on the macOS terminal.'), default: [ '-l' ] }, 'terminal.integrated.shellArgs.linux': { type: 'array', - markdownDescription: nls.localize('vscode/terminalConfiguration/terminal.integrated.shellArgs.linux', 'The command line arguments to use when on the Linux terminal.'), + markdownDescription: nls.localize('theia/terminal/shellArgsLinux', 'The command line arguments to use when on the Linux terminal.'), default: [] }, } diff --git a/packages/terminal/src/browser/terminal-quick-open-service.ts b/packages/terminal/src/browser/terminal-quick-open-service.ts index 431f888b22e12..06fdb2082b44c 100644 --- a/packages/terminal/src/browser/terminal-quick-open-service.ts +++ b/packages/terminal/src/browser/terminal-quick-open-service.ts @@ -22,7 +22,7 @@ import { QuickAccessRegistry, QuickInputService } from '@theia/core/lib/browser'; -import { CancellationToken, CommandContribution, CommandRegistry, CommandService } from '@theia/core/lib/common'; +import { CancellationToken, CommandContribution, CommandRegistry, CommandService, nls } from '@theia/core/lib/common'; import { TerminalWidget } from './base/terminal-widget'; import { TerminalService } from './base/terminal-service'; import { TerminalCommands } from './terminal-frontend-contribution'; @@ -60,7 +60,7 @@ export class TerminalQuickOpenService implements QuickAccessProvider { } // Append a quick open item to create a new terminal. items.push({ - label: 'Open New Terminal', + label: nls.localizeByDefault('Create New Integrated Terminal'), iconClasses: codiconArray('add'), execute: () => this.doCreateNewTerminal() }); @@ -73,7 +73,7 @@ export class TerminalQuickOpenService implements QuickAccessProvider { getInstance: () => this, prefix: TerminalQuickOpenService.PREFIX, placeholder: '', - helpEntries: [{ description: 'Show All Opened Terminals', needsEditor: false }] + helpEntries: [{ description: nls.localizeByDefault('Show All Opened Terminals'), needsEditor: false }] }); } diff --git a/packages/terminal/src/browser/terminal-widget-impl.ts b/packages/terminal/src/browser/terminal-widget-impl.ts index 60eeb8747b685..8ad0edde9883a 100644 --- a/packages/terminal/src/browser/terminal-widget-impl.ts +++ b/packages/terminal/src/browser/terminal-widget-impl.ts @@ -49,7 +49,7 @@ export interface TerminalWidgetFactoryOptions extends Partial(); @@ -249,7 +249,7 @@ export class TerminalWidgetImpl extends TerminalWidget implements StatefulWidget static getFollowLinkHover(): string { const cmdCtrl = isOSX ? 'Cmd' : 'Ctrl'; - return nls.localize('vscode/terminalLinkManager/followLink', 'Follow link') + ' (' + + return nls.localizeByDefault('Follow link') + ' (' + nls.localize(`vscode/terminalLinkManager/terminalLinkHandler.followLink${cmdCtrl}`, `${cmdCtrl} + Click`) + ')'; } diff --git a/packages/vsx-registry/src/browser/vsx-extension-commands.ts b/packages/vsx-registry/src/browser/vsx-extension-commands.ts index ce579f0a470e4..02f7e6dba60ae 100644 --- a/packages/vsx-registry/src/browser/vsx-extension-commands.ts +++ b/packages/vsx-registry/src/browser/vsx-extension-commands.ts @@ -20,18 +20,17 @@ import { Command } from '@theia/core/lib/common'; export namespace VSXExtensionsCommands { - const EXTENSIONS_CATEGORY_KEY = 'vscode/settingsLayout/extensions'; const EXTENSIONS_CATEGORY = 'Extensions'; - export const CLEAR_ALL = Command.toLocalizedCommand({ + export const CLEAR_ALL = Command.toDefaultLocalizedCommand({ id: 'vsxExtensions.clearAll', category: EXTENSIONS_CATEGORY, label: 'Clear Search Results', iconClass: codicon('clear-all') - }, 'vscode/search.contribution/ClearSearchResultsAction.label', EXTENSIONS_CATEGORY_KEY); + }); export const INSTALL_FROM_VSIX: Command & { dialogLabel: string } = { id: 'vsxExtensions.installFromVSIX', - category: nls.localize(EXTENSIONS_CATEGORY_KEY, EXTENSIONS_CATEGORY), + category: nls.localizeByDefault(EXTENSIONS_CATEGORY), originalCategory: EXTENSIONS_CATEGORY, originalLabel: 'Install from VSIX...', label: nls.localize('theia/vsx-registry/installFromVSIX', 'Install from VSIX') + '...', @@ -43,19 +42,19 @@ export namespace VSXExtensionsCommands { export const COPY_EXTENSION_ID: Command = { id: 'vsxExtensions.copyExtensionId' }; - export const SHOW_BUILTINS = Command.toLocalizedCommand({ + export const SHOW_BUILTINS = Command.toDefaultLocalizedCommand({ id: 'vsxExtension.showBuiltins', label: 'Show Built-in Extensions', category: EXTENSIONS_CATEGORY, - }, 'vscode/extensions.contribution/showBuiltInExtensions', EXTENSIONS_CATEGORY_KEY); - export const SHOW_INSTALLED = Command.toLocalizedCommand({ + }); + export const SHOW_INSTALLED = Command.toDefaultLocalizedCommand({ id: 'vsxExtension.showInstalled', label: 'Show Installed Extensions', category: EXTENSIONS_CATEGORY, - }, 'vscode/extensions.contribution/showInstalledExtensions', EXTENSIONS_CATEGORY_KEY); - export const SHOW_RECOMMENDATIONS = Command.toLocalizedCommand({ + }); + export const SHOW_RECOMMENDATIONS = Command.toDefaultLocalizedCommand({ id: 'vsxExtension.showRecommendations', label: 'Show Recommended Extensions', category: EXTENSIONS_CATEGORY, - }, 'vscode/extensions.contribution/showRecommendedExtensions', EXTENSIONS_CATEGORY_KEY); + }); } diff --git a/packages/vsx-registry/src/browser/vsx-extensions-view-container.ts b/packages/vsx-registry/src/browser/vsx-extensions-view-container.ts index 49318b7313158..d38f45990f45c 100644 --- a/packages/vsx-registry/src/browser/vsx-extensions-view-container.ts +++ b/packages/vsx-registry/src/browser/vsx-extensions-view-container.ts @@ -28,7 +28,7 @@ import { nls } from '@theia/core/lib/common/nls'; export class VSXExtensionsViewContainer extends ViewContainer { static ID = 'vsx-extensions-view-container'; - static LABEL = nls.localize('vscode/settingsLayout/extensions', 'Extensions'); + static LABEL = nls.localizeByDefault('Extensions'); disableDNDBetweenContainers = true; @@ -166,7 +166,7 @@ export class VSXExtensionsViewContainer extends ViewContainer { } protected getToggleVisibilityGroupLabel(): string { - return 'a/' + nls.localize('vscode/viewPaneContainer/views', 'Views'); + return 'a/' + nls.localizeByDefault('Views'); } } export namespace VSXExtensionsViewContainer { diff --git a/packages/vsx-registry/src/browser/vsx-extensions-widget.ts b/packages/vsx-registry/src/browser/vsx-extensions-widget.ts index adbdf4308838e..f735564588f1c 100644 --- a/packages/vsx-registry/src/browser/vsx-extensions-widget.ts +++ b/packages/vsx-registry/src/browser/vsx-extensions-widget.ts @@ -67,11 +67,11 @@ export class VSXExtensionsWidget extends SourceTreeWidget { protected computeTitle(): string { switch (this.options.id) { case VSXExtensionsSourceOptions.INSTALLED: - return nls.localize('vscode/extensions.contribution/installed filter', 'Installed'); + return nls.localizeByDefault('Installed'); case VSXExtensionsSourceOptions.BUILT_IN: - return nls.localize('vscode/extensions.contribution/builtin filter', 'Built-in'); + return nls.localizeByDefault('Built-in'); case VSXExtensionsSourceOptions.RECOMMENDED: - return nls.localize('vscode/extensions.contribution/most popular recommended', 'Recommended'); + return nls.localizeByDefault('Recommended'); case VSXExtensionsSourceOptions.SEARCH_RESULT: return nls.localize('theia/vsx-registry/openVSX', 'Open VSX Registry'); default: diff --git a/packages/workspace/src/browser/workspace-commands.ts b/packages/workspace/src/browser/workspace-commands.ts index d8337c6aac064..babf7cbe327f9 100644 --- a/packages/workspace/src/browser/workspace-commands.ts +++ b/packages/workspace/src/browser/workspace-commands.ts @@ -44,7 +44,6 @@ const validFilename: (arg: string) => boolean = require('valid-filename'); export namespace WorkspaceCommands { - const WORKSPACE_CATEGORY_KEY = 'vscode/workspaceActions/workspaces'; const WORKSPACE_CATEGORY = 'Workspaces'; const FILE_CATEGORY = CommonCommands.FILE_CATEGORY; @@ -53,65 +52,65 @@ export namespace WorkspaceCommands { // `OPEN` must *not* be available on Windows and Linux in electron. // VS Code does the same. See: https://github.com/eclipse-theia/theia/pull/3202#issuecomment-430585357 export const OPEN: Command & { dialogLabel: string } = { - ...Command.toLocalizedCommand({ + ...Command.toDefaultLocalizedCommand({ id: 'workspace:open', category: CommonCommands.FILE_CATEGORY, label: 'Open...' - }, 'vscode/workspaceActions/openFileFolder', CommonCommands.FILE_CATEGORY_KEY), - dialogLabel: nls.localize('vscode/dialogMainService/open', 'Open') + }), + dialogLabel: nls.localizeByDefault('Open') }; // No `label`. Otherwise, it shows up in the `Command Palette`. export const OPEN_FILE: Command & { dialogLabel: string } = { id: 'workspace:openFile', originalCategory: FILE_CATEGORY, - category: nls.localize(CommonCommands.FILE_CATEGORY_KEY, CommonCommands.FILE_CATEGORY), + category: nls.localizeByDefault(CommonCommands.FILE_CATEGORY), dialogLabel: 'Open File' }; export const OPEN_FOLDER: Command & { dialogLabel: string } = { id: 'workspace:openFolder', - dialogLabel: nls.localize('vscode/dialogMainService/openFolder', 'Open Folder') // No `label`. Otherwise, it shows up in the `Command Palette`. + dialogLabel: nls.localizeByDefault('Open Folder') // No `label`. Otherwise, it shows up in the `Command Palette`. }; export const OPEN_WORKSPACE: Command & { dialogLabel: string } = { - ...Command.toLocalizedCommand({ + ...Command.toDefaultLocalizedCommand({ id: 'workspace:openWorkspace', category: CommonCommands.FILE_CATEGORY, label: 'Open Workspace...', - }, 'vscode/workspaceActions/openWorkspaceAction', CommonCommands.FILE_CATEGORY_KEY), - dialogLabel: nls.localize('vscode/dialogMainService/openWorkspaceTitle', 'Open Workspace') + }), + dialogLabel: nls.localizeByDefault('Open Workspace') }; export const OPEN_RECENT_WORKSPACE = Command.toLocalizedCommand({ id: 'workspace:openRecent', category: FILE_CATEGORY, label: 'Open Recent Workspace...' }, 'theia/workspace/openRecentWorkspace', CommonCommands.FILE_CATEGORY_KEY); - export const CLOSE = Command.toLocalizedCommand({ + export const CLOSE = Command.toDefaultLocalizedCommand({ id: 'workspace:close', category: WORKSPACE_CATEGORY, label: 'Close Workspace' - }, 'vscode/workspaceActions/closeWorkspace', WORKSPACE_CATEGORY_KEY); - export const NEW_FILE = Command.toLocalizedCommand({ + }); + export const NEW_FILE = Command.toDefaultLocalizedCommand({ id: 'file.newFile', category: FILE_CATEGORY, label: 'New File' - }, 'vscode/fileActions/newFile', CommonCommands.FILE_CATEGORY_KEY); - export const NEW_FOLDER = Command.toLocalizedCommand({ + }); + export const NEW_FOLDER = Command.toDefaultLocalizedCommand({ id: 'file.newFolder', category: FILE_CATEGORY, label: 'New Folder' - }, 'vscode/fileActions/newFile', CommonCommands.FILE_CATEGORY_KEY); + }); export const FILE_OPEN_WITH = (opener: OpenHandler): Command => ({ id: `file.openWith.${opener.id}` }); - export const FILE_RENAME = Command.toLocalizedCommand({ + export const FILE_RENAME = Command.toDefaultLocalizedCommand({ id: 'file.rename', category: FILE_CATEGORY, label: 'Rename' - }, 'vscode/fileActions/rename', CommonCommands.FILE_CATEGORY_KEY); - export const FILE_DELETE = Command.toLocalizedCommand({ + }); + export const FILE_DELETE = Command.toDefaultLocalizedCommand({ id: 'file.delete', category: FILE_CATEGORY, label: 'Delete' - }, 'vscode/fileActions/delete', CommonCommands.FILE_CATEGORY_KEY); + }); export const FILE_DUPLICATE = Command.toLocalizedCommand({ id: 'file.duplicate', category: FILE_CATEGORY, @@ -121,32 +120,32 @@ export namespace WorkspaceCommands { id: 'file.compare', category: FILE_CATEGORY, label: 'Compare with Each Other' - }, 'vscode/fileActions.contribution/compareSelected', CommonCommands.FILE_CATEGORY_KEY); - export const ADD_FOLDER = Command.toLocalizedCommand({ + }, 'theia/workspace/compareWithEachOther', CommonCommands.FILE_CATEGORY_KEY); + export const ADD_FOLDER = Command.toDefaultLocalizedCommand({ id: 'workspace:addFolder', category: WORKSPACE_CATEGORY, label: 'Add Folder to Workspace...' - }, 'vscode/workspaceCommands/addFolderToWorkspace', WORKSPACE_CATEGORY_KEY); - export const REMOVE_FOLDER = Command.toLocalizedCommand({ + }); + export const REMOVE_FOLDER = Command.toDefaultLocalizedCommand({ id: 'workspace:removeFolder', category: WORKSPACE_CATEGORY, label: 'Remove Folder from Workspace' - }, 'vscode/fileCommands/removeFolderFromWorkspace', WORKSPACE_CATEGORY_KEY); - export const SAVE_WORKSPACE_AS = Command.toLocalizedCommand({ + }); + export const SAVE_WORKSPACE_AS = Command.toDefaultLocalizedCommand({ id: 'workspace:saveAs', category: WORKSPACE_CATEGORY, label: 'Save Workspace As...' - }, 'vscode/workspaceActions/saveWorkspaceAsAction', WORKSPACE_CATEGORY_KEY); - export const OPEN_WORKSPACE_FILE = Command.toLocalizedCommand({ + }); + export const OPEN_WORKSPACE_FILE = Command.toDefaultLocalizedCommand({ id: 'workspace:openConfigFile', category: WORKSPACE_CATEGORY, label: 'Open Workspace Configuration File' - }, 'vscode/abstractWorkspaceEditingService/openWorkspaceConfigurationFile', WORKSPACE_CATEGORY_KEY); - export const SAVE_AS = Command.toLocalizedCommand({ + }); + export const SAVE_AS = Command.toDefaultLocalizedCommand({ id: 'file.saveAs', category: CommonCommands.FILE_CATEGORY, label: 'Save As...', - }, 'vscode/fileCommands/saveAs', CommonCommands.FILE_CATEGORY_KEY); + }); } @injectable() @@ -244,7 +243,7 @@ export class WorkspaceCommandContribution implements CommandContribution { const vacantChildUri = FileSystemUtils.generateUniqueResourceURI(parentUri, parent, fileName, fileExtension); const dialog = new WorkspaceInputDialog({ - title: nls.localize('vscode/fileActions/newFile', 'New File'), + title: nls.localizeByDefault('New File'), parentUri: parentUri, initialValue: vacantChildUri.path.base, validate: name => this.validateFileName(name, parent, true) @@ -267,7 +266,7 @@ export class WorkspaceCommandContribution implements CommandContribution { const parentUri = parent.resource; const vacantChildUri = FileSystemUtils.generateUniqueResourceURI(parentUri, parent, 'Untitled'); const dialog = new WorkspaceInputDialog({ - title: nls.localize('vscode/fileActions/newFolder', 'New Folder'), + title: nls.localizeByDefault('New Folder'), parentUri: parentUri, initialValue: vacantChildUri.path.base, validate: name => this.validateFileName(name, parent, true) @@ -291,7 +290,7 @@ export class WorkspaceCommandContribution implements CommandContribution { if (parent) { const oldName = uri.path.base; const dialog = new SingleTextInputDialog({ - title: nls.localize('vscode/fileActions/rename', 'Rename'), + title: nls.localizeByDefault('Rename'), initialValue: oldName, initialSelectionRange: { start: 0, @@ -409,21 +408,21 @@ export class WorkspaceCommandContribution implements CommandContribution { } // do not allow recursive rename if (!allowNested && !validFilename(name)) { - return nls.localize('vscode/configureSnippets/bad_name1', 'Invalid file or folder name'); + return nls.localizeByDefault('Invalid file or folder name'); } if (name.startsWith('/')) { - return nls.localize('vscode/fileActions/fileNameStartsWithSlashError', 'Absolute paths or names that starts with / are not allowed'); + return nls.localizeByDefault('Absolute paths or names that starts with / are not allowed'); } else if (name.startsWith(' ') || name.endsWith(' ')) { - return nls.localize('vscode/fileActions/fileNameWhitespaceWarning', 'Names with leading or trailing whitespaces are not allowed'); + return nls.localizeByDefault('Names with leading or trailing whitespaces are not allowed'); } // check and validate each sub-paths if (name.split(/[\\/]/).some(file => !file || !validFilename(file) || /^\s+$/.test(file))) { - return nls.localize('vscode/fileActions/invalidFileNameError', 'The name "{0}" is not a valid file or folder name.', this.trimFileName(name)); + return nls.localizeByDefault('The name "{0}" is not a valid file or folder name.', this.trimFileName(name)); } const childUri = parent.resource.resolve(name); const exists = await this.fileService.exists(childUri); if (exists) { - return nls.localize('vscode/fileActions/fileNameExistsError', 'A file or folder "{0}" already exists at this location.', this.trimFileName(name)); + return nls.localizeByDefault('A file or folder "{0}" already exists at this location.', this.trimFileName(name)); } return ''; } @@ -514,7 +513,7 @@ export class WorkspaceCommandContribution implements CommandContribution { }); messageContainer.appendChild(list); const dialog = new ConfirmDialog({ - title: nls.localize('vscode/fileCommands/removeFolderFromWorkspace', 'Remove Folder from Workspace'), + title: nls.localizeByDefault('Remove Folder from Workspace'), msg: messageContainer }); if (await dialog.open()) { diff --git a/packages/workspace/src/browser/workspace-frontend-contribution.ts b/packages/workspace/src/browser/workspace-frontend-contribution.ts index 043e3a620f622..61a2cde7aaca7 100644 --- a/packages/workspace/src/browser/workspace-frontend-contribution.ts +++ b/packages/workspace/src/browser/workspace-frontend-contribution.ts @@ -498,8 +498,8 @@ export class WorkspaceFrontendContribution implements CommandContribution, Keybi } // Prompt users for confirmation before overwriting. const confirmed = await new ConfirmDialog({ - title: nls.localize('vscode/textFileSaveErrorHandler/overwrite', 'Overwrite'), - msg: nls.localize('vscode/simpleFileDialog/remoteFileDialog.validateExisting', 'Do you really want to overwrite "{0}"?', uri.toString()) + title: nls.localizeByDefault('Overwrite'), + msg: nls.localizeByDefault('Do you really want to overwrite "{0}"?', uri.toString()) }).open(); return !!confirmed; }