diff --git a/src/vs/platform/menubar/electron-main/menubar.ts b/src/vs/platform/menubar/electron-main/menubar.ts index 2d637109..72b026eb 100644 --- a/src/vs/platform/menubar/electron-main/menubar.ts +++ b/src/vs/platform/menubar/electron-main/menubar.ts @@ -24,6 +24,7 @@ import { IUpdateService, StateType } from 'vs/platform/update/common/update'; import { getTitleBarStyle, INativeRunActionInWindowRequest, INativeRunKeybindingInWindowRequest, IWindowOpenable } from 'vs/platform/window/common/window'; import { IWindowsCountChangedEvent, IWindowsMainService, OpenContext } from 'vs/platform/windows/electron-main/windows'; import { IWorkspacesHistoryMainService } from 'vs/platform/workspaces/electron-main/workspacesHistoryMainService'; +import * as platform from 'vs/base/common/platform'; const telemetryFrom = 'menu'; @@ -299,7 +300,7 @@ export class Menubar { //Project if (this.shouldDrawMenu('Project')) { const projectMenu = new Menu(); - const projectMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mProject', comment: ['&& denotes a mnemonic'] }, "&&Project")), submenu: projectMenu, role: 'help' }); + const projectMenuItem = new MenuItem({ label: this.mnemonicLabel((platform.language == 'zh-cn' ? '项目' : 'Project')), submenu: projectMenu, role: 'help' }); this.setMenuById(projectMenu, 'Project'); menubar.append(projectMenuItem); } @@ -342,7 +343,6 @@ export class Menubar { this.setMenuById(terminalMenu, 'Terminal'); menubar.append(terminalMenuItem); } - // Mac: Window let macWindowMenuItem: MenuItem | undefined; if (this.shouldDrawMenu('Window')) { diff --git a/src/vs/workbench/browser/actions/projectActions.ts b/src/vs/workbench/browser/actions/projectActions.ts index 20d51266..86990111 100755 --- a/src/vs/workbench/browser/actions/projectActions.ts +++ b/src/vs/workbench/browser/actions/projectActions.ts @@ -1,4 +1,4 @@ -import { localize } from 'vs/nls'; +//import { localize } from 'vs/nls'; import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; //import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; @@ -9,13 +9,14 @@ const commandPackageProject = "project.buildPackage"; const commandDebugProject = "debug.openView"; const commandRunProject = "workbench.action.tasks.runTask"; const commandBuidProject = "workbench.action.tasks.build"; +import * as platform from 'vs/base/common/platform'; MenuRegistry.appendMenuItem(MenuId.MenubarProjectMenu, { group: '1_project', command: { id: commandCreateProject, - title: localize({ key: 'miDefault Template', comment: ['&& denotes a mnemonic'] }, "&&Create New Project") + title: (platform.language == 'zh-cn' ? '创建新的项目' : 'Create New Project') }, order: 1, // when: ContextKeyExpr.has('hasCreateProject') @@ -24,7 +25,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarProjectMenu, { group: '1_project', command: { id: commandConfigProject, - title: localize({ key: 'miDefault Template', comment: ['&& denotes a mnemonic'] }, "&&Config Project") + title: (platform.language == 'zh-cn' ? '配置当前项目' : 'Configure Project') }, order: 2, // when: ContextKeyExpr.has('hasCreateProject') @@ -33,7 +34,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarProjectMenu, { group: '1_project', command: { id: commandBuidProject, - title: localize({ key: 'miDefault Template', comment: ['&& denotes a mnemonic'] }, "&&Build") + title: (platform.language == 'zh-cn' ? '构建' : 'Build') }, order: 3, // when: ContextKeyExpr.has('hasCreateProject') @@ -42,7 +43,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarProjectMenu, { group: '1_project', command: { id: commandDebugProject, - title: localize({ key: 'miDefault Template', comment: ['&& denotes a mnemonic'] }, "&&Debug") + title: (platform.language == 'zh-cn' ? '调试' : 'Debug') }, order: 4, // when: ContextKeyExpr.has('hasCreateProject') @@ -51,7 +52,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarProjectMenu, { group: '1_project', command: { id: commandRunProject, - title: localize({ key: 'miDefault Template', comment: ['&& denotes a mnemonic'] }, "&&Run") + title: (platform.language == 'zh-cn' ? '运行' : 'Run') }, order: 5, // when: ContextKeyExpr.equals('hasCreateProject', true) @@ -60,7 +61,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarProjectMenu, { group: '1_project', command: { id: commandPackageProject, - title: localize({ key: 'miDefault Template', comment: ['&& denotes a mnemonic'] }, "&&Pack") + title: (platform.language == 'zh-cn' ? '打包' : 'Pack') }, order: 6, // when: ContextKeyExpr.has('hasCreateProject') diff --git a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts index e844ce3e..ecc7c8dc 100644 --- a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts +++ b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts @@ -41,7 +41,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions'; import { IWorkbenchExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; - +import * as platform from 'vs/base/common/platform'; export type IOpenRecentAction = IAction & { uri: URI; remoteAuthority?: string }; MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, { @@ -118,9 +118,9 @@ MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, { MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, { submenu: MenuId.MenubarProjectMenu, title: { - value: 'Project', + value: (platform.language == 'zh-cn' ? '项目' : 'Project'), original: 'Project', - mnemonicTitle: localize({ key: 'mProject', comment: ['&& denotes a mnemonic'] }, "&&Project") + mnemonicTitle: (platform.language == 'zh-cn' ? '项目' : 'Project') }, order: 10 });