Skip to content

Commit 246a337

Browse files
Move more strings to localize2 (take 2) (microsoft#204180)
* Revert "Revert "Adopt localize2 in more spots" (microsoft#204087)" This reverts commit 5baa693. * Keep only the localize2 changes * revert accidental change to launch.json
1 parent 17e46e2 commit 246a337

File tree

27 files changed

+76
-94
lines changed

27 files changed

+76
-94
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function getQuickChatActionForProvider(id: string, label: string) {
171171
super({
172172
id: `workbench.action.openQuickChat.${id}`,
173173
category: CHAT_CATEGORY,
174-
title: { value: localize('interactiveSession.open', "Open Quick Chat ({0})", label), original: `Open Quick Chat (${label})` },
174+
title: localize2('interactiveSession.open', "Open Quick Chat ({0})", label),
175175
f1: true
176176
});
177177
}

src/vs/workbench/contrib/debug/browser/debug.contribution.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { submenu: MenuId.EditorTitleRun
232232
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
233233
submenu: MenuId.MenubarDebugMenu,
234234
title: {
235-
value: 'Run',
236-
original: 'Run',
235+
...nls.localize2('runMenu', "Run"),
237236
mnemonicTitle: nls.localize({ key: 'mRun', comment: ['&& denotes a mnemonic'] }, "&&Run")
238237
},
239238
order: 6

src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
899899
}
900900

901901
private generateStandaloneOptionCommand(commandId: string, qualifiedName: string, category: string | ILocalizedString | undefined, when: ContextKeyExpression | undefined, remoteGroup: string | undefined) {
902-
const command = {
902+
const command: IAction2Options = {
903903
id: `${continueWorkingOnCommand.id}.${commandId}`,
904904
title: { original: qualifiedName, value: qualifiedName },
905905
category: typeof category === 'string' ? { original: category, value: category } : category,

src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
177177
super({
178178
id: 'workbench.extensions.installLocalExtensions',
179179
get title() {
180-
return {
181-
value: localize('select and install local extensions', "Install Local Extensions in '{0}'...", server.label),
182-
original: `Install Local Extensions in '${server.label}'...`,
183-
};
180+
return localize2('select and install local extensions', "Install Local Extensions in '{0}'...", server.label);
184181
},
185182
category: REMOTE_CATEGORY,
186183
icon: installLocalInRemoteIcon,

src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class SaveModelAsAction extends Action {
324324
private model: ITextFileEditorModel,
325325
@IEditorService private editorService: IEditorService
326326
) {
327-
super('workbench.files.action.saveModelAs', SAVE_FILE_AS_LABEL);
327+
super('workbench.files.action.saveModelAs', SAVE_FILE_AS_LABEL.value);
328328
}
329329

330330
override async run(): Promise<void> {

src/vs/workbench/contrib/files/browser/fileActions.contribution.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ appendToCommandPalette({
215215

216216
appendToCommandPalette({
217217
id: SAVE_FILE_COMMAND_ID,
218-
title: { value: SAVE_FILE_LABEL, original: 'Save' },
218+
title: SAVE_FILE_LABEL,
219219
category: Categories.File
220220
});
221221

222222
appendToCommandPalette({
223223
id: SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID,
224-
title: { value: SAVE_FILE_WITHOUT_FORMATTING_LABEL, original: 'Save without Formatting' },
224+
title: SAVE_FILE_WITHOUT_FORMATTING_LABEL,
225225
category: Categories.File
226226
});
227227

@@ -251,26 +251,26 @@ appendToCommandPalette({
251251

252252
appendToCommandPalette({
253253
id: SAVE_FILE_AS_COMMAND_ID,
254-
title: { value: SAVE_FILE_AS_LABEL, original: 'Save As...' },
254+
title: SAVE_FILE_AS_LABEL,
255255
category: Categories.File
256256
});
257257

258258
appendToCommandPalette({
259259
id: NEW_FILE_COMMAND_ID,
260-
title: { value: NEW_FILE_LABEL, original: 'New File' },
260+
title: NEW_FILE_LABEL,
261261
category: Categories.File
262262
}, WorkspaceFolderCountContext.notEqualsTo('0'));
263263

264264
appendToCommandPalette({
265265
id: NEW_FOLDER_COMMAND_ID,
266-
title: { value: NEW_FOLDER_LABEL, original: 'New Folder' },
266+
title: NEW_FOLDER_LABEL,
267267
category: Categories.File,
268268
metadata: { description: nls.localize2('newFolderDescription', "Create a new folder or directory") }
269269
}, WorkspaceFolderCountContext.notEqualsTo('0'));
270270

271271
appendToCommandPalette({
272272
id: NEW_UNTITLED_FILE_COMMAND_ID,
273-
title: { value: NEW_UNTITLED_FILE_LABEL, original: 'New Untitled Text File' },
273+
title: NEW_UNTITLED_FILE_LABEL,
274274
category: Categories.File
275275
});
276276

src/vs/workbench/contrib/files/browser/fileActions.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ import { Categories } from 'vs/platform/action/common/actionCommonCategories';
6161
import { ILocalizedString } from 'vs/platform/action/common/action';
6262

6363
export const NEW_FILE_COMMAND_ID = 'explorer.newFile';
64-
export const NEW_FILE_LABEL = nls.localize('newFile', "New File...");
64+
export const NEW_FILE_LABEL = nls.localize2('newFile', "New File...");
6565
export const NEW_FOLDER_COMMAND_ID = 'explorer.newFolder';
66-
export const NEW_FOLDER_LABEL = nls.localize('newFolder', "New Folder...");
66+
export const NEW_FOLDER_LABEL = nls.localize2('newFolder', "New Folder...");
6767
export const TRIGGER_RENAME_LABEL = nls.localize('rename', "Rename...");
6868
export const MOVE_FILE_TO_TRASH_LABEL = nls.localize('delete', "Delete");
6969
export const COPY_FILE_LABEL = nls.localize('copyFile', "Copy");
@@ -481,12 +481,12 @@ async function askForOverwrite(fileService: IFileService, dialogService: IDialog
481481
export class GlobalCompareResourcesAction extends Action2 {
482482

483483
static readonly ID = 'workbench.files.action.compareFileWith';
484-
static readonly LABEL = nls.localize('globalCompareFile', "Compare Active File With...");
484+
static readonly LABEL = nls.localize2('globalCompareFile', "Compare Active File With...");
485485

486486
constructor() {
487487
super({
488488
id: GlobalCompareResourcesAction.ID,
489-
title: { value: GlobalCompareResourcesAction.LABEL, original: 'Compare Active File With...' },
489+
title: GlobalCompareResourcesAction.LABEL,
490490
f1: true,
491491
category: Categories.File,
492492
precondition: ActiveEditorContext
@@ -609,12 +609,12 @@ export class CloseGroupAction extends Action {
609609
export class FocusFilesExplorer extends Action2 {
610610

611611
static readonly ID = 'workbench.files.action.focusFilesExplorer';
612-
static readonly LABEL = nls.localize('focusFilesExplorer', "Focus on Files Explorer");
612+
static readonly LABEL = nls.localize2('focusFilesExplorer', "Focus on Files Explorer");
613613

614614
constructor() {
615615
super({
616616
id: FocusFilesExplorer.ID,
617-
title: { value: FocusFilesExplorer.LABEL, original: 'Focus on Files Explorer' },
617+
title: FocusFilesExplorer.LABEL,
618618
f1: true,
619619
category: Categories.File
620620
});
@@ -629,12 +629,12 @@ export class FocusFilesExplorer extends Action2 {
629629
export class ShowActiveFileInExplorer extends Action2 {
630630

631631
static readonly ID = 'workbench.files.action.showActiveFileInExplorer';
632-
static readonly LABEL = nls.localize('showInExplorer', "Reveal Active File in Explorer View");
632+
static readonly LABEL = nls.localize2('showInExplorer', "Reveal Active File in Explorer View");
633633

634634
constructor() {
635635
super({
636636
id: ShowActiveFileInExplorer.ID,
637-
title: { value: ShowActiveFileInExplorer.LABEL, original: 'Reveal Active File in Explorer View' },
637+
title: ShowActiveFileInExplorer.LABEL,
638638
f1: true,
639639
category: Categories.File
640640
});
@@ -653,13 +653,13 @@ export class ShowActiveFileInExplorer extends Action2 {
653653
export class OpenActiveFileInEmptyWorkspace extends Action2 {
654654

655655
static readonly ID = 'workbench.action.files.showOpenedFileInNewWindow';
656-
static readonly LABEL = nls.localize('openFileInEmptyWorkspace', "Open Active File in New Empty Workspace");
656+
static readonly LABEL = nls.localize2('openFileInEmptyWorkspace', "Open Active File in New Empty Workspace");
657657

658658
constructor(
659659
) {
660660
super({
661661
id: OpenActiveFileInEmptyWorkspace.ID,
662-
title: { value: OpenActiveFileInEmptyWorkspace.LABEL, original: 'Open Active File in New Empty Workspace' },
662+
title: OpenActiveFileInEmptyWorkspace.LABEL,
663663
f1: true,
664664
category: Categories.File,
665665
precondition: EmptyWorkspaceSupportContext
@@ -763,12 +763,12 @@ function getWellFormedFileName(filename: string): string {
763763
export class CompareNewUntitledTextFilesAction extends Action2 {
764764

765765
static readonly ID = 'workbench.files.action.compareNewUntitledTextFiles';
766-
static readonly LABEL = nls.localize('compareNewUntitledTextFiles', "Compare New Untitled Text Files");
766+
static readonly LABEL = nls.localize2('compareNewUntitledTextFiles', "Compare New Untitled Text Files");
767767

768768
constructor() {
769769
super({
770770
id: CompareNewUntitledTextFilesAction.ID,
771-
title: { value: CompareNewUntitledTextFilesAction.LABEL, original: 'Compare New Untitled Text Files' },
771+
title: CompareNewUntitledTextFilesAction.LABEL,
772772
f1: true,
773773
category: Categories.File
774774
});
@@ -788,15 +788,15 @@ export class CompareNewUntitledTextFilesAction extends Action2 {
788788
export class CompareWithClipboardAction extends Action2 {
789789

790790
static readonly ID = 'workbench.files.action.compareWithClipboard';
791-
static readonly LABEL = nls.localize('compareWithClipboard', "Compare Active File with Clipboard");
791+
static readonly LABEL = nls.localize2('compareWithClipboard', "Compare Active File with Clipboard");
792792

793793
private registrationDisposal: IDisposable | undefined;
794794
private static SCHEME_COUNTER = 0;
795795

796796
constructor() {
797797
super({
798798
id: CompareWithClipboardAction.ID,
799-
title: { value: CompareWithClipboardAction.LABEL, original: 'Compare Active File with Clipboard' },
799+
title: CompareWithClipboardAction.LABEL,
800800
f1: true,
801801
category: Categories.File,
802802
keybinding: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyC), weight: KeybindingWeight.WorkbenchContrib }
@@ -1261,12 +1261,12 @@ class BaseSetActiveEditorReadonlyInSession extends Action2 {
12611261
export class SetActiveEditorReadonlyInSession extends BaseSetActiveEditorReadonlyInSession {
12621262

12631263
static readonly ID = 'workbench.action.files.setActiveEditorReadonlyInSession';
1264-
static readonly LABEL = nls.localize('setActiveEditorReadonlyInSession', "Set Active Editor Read-only in Session");
1264+
static readonly LABEL = nls.localize2('setActiveEditorReadonlyInSession', "Set Active Editor Read-only in Session");
12651265

12661266
constructor() {
12671267
super(
12681268
SetActiveEditorReadonlyInSession.ID,
1269-
{ value: SetActiveEditorReadonlyInSession.LABEL, original: 'Set Active Editor Readonly in Session' },
1269+
SetActiveEditorReadonlyInSession.LABEL,
12701270
true
12711271
);
12721272
}
@@ -1275,12 +1275,12 @@ export class SetActiveEditorReadonlyInSession extends BaseSetActiveEditorReadonl
12751275
export class SetActiveEditorWriteableInSession extends BaseSetActiveEditorReadonlyInSession {
12761276

12771277
static readonly ID = 'workbench.action.files.setActiveEditorWriteableInSession';
1278-
static readonly LABEL = nls.localize('setActiveEditorWriteableInSession', "Set Active Editor Writeable in Session");
1278+
static readonly LABEL = nls.localize2('setActiveEditorWriteableInSession', "Set Active Editor Writeable in Session");
12791279

12801280
constructor() {
12811281
super(
12821282
SetActiveEditorWriteableInSession.ID,
1283-
{ value: SetActiveEditorWriteableInSession.LABEL, original: 'Set Active Editor Writeable in Session' },
1283+
SetActiveEditorWriteableInSession.LABEL,
12841284
false
12851285
);
12861286
}
@@ -1289,12 +1289,12 @@ export class SetActiveEditorWriteableInSession extends BaseSetActiveEditorReadon
12891289
export class ToggleActiveEditorReadonlyInSession extends BaseSetActiveEditorReadonlyInSession {
12901290

12911291
static readonly ID = 'workbench.action.files.toggleActiveEditorReadonlyInSession';
1292-
static readonly LABEL = nls.localize('toggleActiveEditorReadonlyInSession', "Toggle Active Editor Read-only in Session");
1292+
static readonly LABEL = nls.localize2('toggleActiveEditorReadonlyInSession', "Toggle Active Editor Read-only in Session");
12931293

12941294
constructor() {
12951295
super(
12961296
ToggleActiveEditorReadonlyInSession.ID,
1297-
{ value: ToggleActiveEditorReadonlyInSession.LABEL, original: 'Toggle Active Editor Readonly in Session' },
1297+
ToggleActiveEditorReadonlyInSession.LABEL,
12981298
'toggle'
12991299
);
13001300
}
@@ -1303,12 +1303,12 @@ export class ToggleActiveEditorReadonlyInSession extends BaseSetActiveEditorRead
13031303
export class ResetActiveEditorReadonlyInSession extends BaseSetActiveEditorReadonlyInSession {
13041304

13051305
static readonly ID = 'workbench.action.files.resetActiveEditorReadonlyInSession';
1306-
static readonly LABEL = nls.localize('resetActiveEditorReadonlyInSession', "Reset Active Editor Read-only in Session");
1306+
static readonly LABEL = nls.localize2('resetActiveEditorReadonlyInSession', "Reset Active Editor Read-only in Session");
13071307

13081308
constructor() {
13091309
super(
13101310
ResetActiveEditorReadonlyInSession.ID,
1311-
{ value: ResetActiveEditorReadonlyInSession.LABEL, original: 'Reset Active Editor Readonly in Session' },
1311+
ResetActiveEditorReadonlyInSession.LABEL,
13121312
'reset'
13131313
);
13141314
}

src/vs/workbench/contrib/files/browser/fileConstants.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ export const COPY_PATH_COMMAND_ID = 'copyFilePath';
1919
export const COPY_RELATIVE_PATH_COMMAND_ID = 'copyRelativeFilePath';
2020

2121
export const SAVE_FILE_AS_COMMAND_ID = 'workbench.action.files.saveAs';
22-
export const SAVE_FILE_AS_LABEL = nls.localize('saveAs', "Save As...");
22+
export const SAVE_FILE_AS_LABEL = nls.localize2('saveAs', "Save As...");
2323
export const SAVE_FILE_COMMAND_ID = 'workbench.action.files.save';
24-
export const SAVE_FILE_LABEL = nls.localize('save', "Save");
24+
export const SAVE_FILE_LABEL = nls.localize2('save', "Save");
2525
export const SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID = 'workbench.action.files.saveWithoutFormatting';
26-
export const SAVE_FILE_WITHOUT_FORMATTING_LABEL = nls.localize('saveWithoutFormatting', "Save without Formatting");
26+
export const SAVE_FILE_WITHOUT_FORMATTING_LABEL = nls.localize2('saveWithoutFormatting', "Save without Formatting");
2727

2828
export const SAVE_ALL_COMMAND_ID = 'saveAll';
29-
export const SAVE_ALL_LABEL = nls.localize('saveAll', "Save All");
29+
export const SAVE_ALL_LABEL = nls.localize2('saveAll', "Save All");
3030

3131
export const SAVE_ALL_IN_GROUP_COMMAND_ID = 'workbench.files.action.saveAllInGroup';
3232

@@ -45,5 +45,5 @@ export const NEXT_COMPRESSED_FOLDER = 'nextCompressedFolder';
4545
export const FIRST_COMPRESSED_FOLDER = 'firstCompressedFolder';
4646
export const LAST_COMPRESSED_FOLDER = 'lastCompressedFolder';
4747
export const NEW_UNTITLED_FILE_COMMAND_ID = 'workbench.action.files.newUntitledFile';
48-
export const NEW_UNTITLED_FILE_LABEL = nls.localize('newUntitledFile', "New Untitled Text File");
48+
export const NEW_UNTITLED_FILE_LABEL = nls.localize2('newUntitledFile', "New Untitled Text File");
4949
export const NEW_FILE_COMMAND_ID = 'workbench.action.files.newFile';

src/vs/workbench/contrib/files/browser/views/openEditorsView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ registerAction2(class extends Action2 {
835835
constructor() {
836836
super({
837837
id: 'workbench.action.files.saveAll',
838-
title: { value: SAVE_ALL_LABEL, original: 'Save All' },
838+
title: SAVE_ALL_LABEL,
839839
f1: true,
840840
icon: Codicon.saveAll,
841841
menu: {

src/vs/workbench/contrib/files/electron-sandbox/fileActions.contribution.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { SideBySideEditor, EditorResourceAccessor } from 'vs/workbench/common/ed
2424
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
2525

2626
const REVEAL_IN_OS_COMMAND_ID = 'revealFileInOS';
27-
const REVEAL_IN_OS_LABEL = isWindows ? nls.localize('revealInWindows', "Reveal in File Explorer") : isMacintosh ? nls.localize('revealInMac', "Reveal in Finder") : nls.localize('openContainer', "Open Containing Folder");
27+
const REVEAL_IN_OS_LABEL = isWindows ? nls.localize2('revealInWindows', "Reveal in File Explorer") : isMacintosh ? nls.localize2('revealInMac', "Reveal in Finder") : nls.localize2('openContainer', "Open Containing Folder");
2828
const REVEAL_IN_OS_WHEN_CONTEXT = ContextKeyExpr.or(ResourceContextKey.Scheme.isEqualTo(Schemas.file), ResourceContextKey.Scheme.isEqualTo(Schemas.vscodeUserData));
2929

3030
KeybindingsRegistry.registerCommandAndKeybindingRule({
@@ -57,13 +57,13 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
5757
}
5858
});
5959

60-
appendEditorTitleContextMenuItem(REVEAL_IN_OS_COMMAND_ID, REVEAL_IN_OS_LABEL, REVEAL_IN_OS_WHEN_CONTEXT, '2_files', 0);
60+
appendEditorTitleContextMenuItem(REVEAL_IN_OS_COMMAND_ID, REVEAL_IN_OS_LABEL.value, REVEAL_IN_OS_WHEN_CONTEXT, '2_files', 0);
6161

6262
// Menu registration - open editors
6363

6464
const revealInOsCommand = {
6565
id: REVEAL_IN_OS_COMMAND_ID,
66-
title: REVEAL_IN_OS_LABEL
66+
title: REVEAL_IN_OS_LABEL.value
6767
};
6868
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
6969
group: 'navigation',
@@ -92,6 +92,6 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
9292
const category = nls.localize2('filesCategory', "File");
9393
appendToCommandPalette({
9494
id: REVEAL_IN_OS_COMMAND_ID,
95-
title: { value: REVEAL_IN_OS_LABEL, original: isWindows ? 'Reveal in File Explorer' : isMacintosh ? 'Reveal in Finder' : 'Open Containing Folder' },
95+
title: REVEAL_IN_OS_LABEL,
9696
category: category
9797
}, REVEAL_IN_OS_WHEN_CONTEXT);

0 commit comments

Comments
 (0)