From eb8e1815a397b99be395ddaa8c0e433e99c29462 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 14 Oct 2020 10:52:57 +0200 Subject: [PATCH] dialogs - make sure to put mnemonics for button labels --- .../extensions/electron-browser/extensionProfileService.ts | 4 ++-- .../extensions/electron-browser/runtimeExtensionsEditor.ts | 4 ++-- .../contrib/performance/electron-browser/startupProfiler.ts | 6 +++--- .../workbench/contrib/userDataSync/browser/userDataSync.ts | 6 ++++-- .../contrib/userDataSync/browser/userDataSyncViews.ts | 2 +- .../userDataSync/browser/userDataSyncWorkbenchService.ts | 6 +++--- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts index 858879813dd..d491483b338 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts @@ -120,8 +120,8 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio type: 'info', message: nls.localize('restart1', "Profile Extensions"), detail: nls.localize('restart2', "In order to profile extensions a restart is required. Do you want to restart '{0}' now?", this._productService.nameLong), - primaryButton: nls.localize('restart3', "Restart"), - secondaryButton: nls.localize('cancel', "Cancel") + primaryButton: nls.localize('restart3', "&&Restart"), + secondaryButton: nls.localize('cancel', "&&Cancel") }).then(res => { if (res.confirmed) { this._nativeHostService.relaunch({ addArgs: [`--inspect-extensions=${randomPort()}`] }); diff --git a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts index b72a62a2d7b..2a81e43f66d 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts @@ -606,8 +606,8 @@ export class DebugExtensionHostAction extends Action { type: 'info', message: nls.localize('restart1', "Profile Extensions"), detail: nls.localize('restart2', "In order to profile extensions a restart is required. Do you want to restart '{0}' now?", this.productService.nameLong), - primaryButton: nls.localize('restart3', "Restart"), - secondaryButton: nls.localize('cancel', "Cancel") + primaryButton: nls.localize('restart3', "&&Restart"), + secondaryButton: nls.localize('cancel', "&&Cancel") }); if (res.confirmed) { await this._nativeHostService.relaunch({ addArgs: [`--inspect-extensions=${randomPort()}`] }); diff --git a/src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts b/src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts index d79a11a8937..4023c6493c0 100644 --- a/src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts +++ b/src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts @@ -77,8 +77,8 @@ export class StartupProfiler implements IWorkbenchContribution { type: 'info', message: localize('prof.message', "Successfully created profiles."), detail: localize('prof.detail', "Please create an issue and manually attach the following files:\n{0}", profileFiles), - primaryButton: localize('prof.restartAndFileIssue', "Create Issue and Restart"), - secondaryButton: localize('prof.restart', "Restart") + primaryButton: localize('prof.restartAndFileIssue', "&&Create Issue and Restart"), + secondaryButton: localize('prof.restart', "&&Restart") }).then(res => { if (res.confirmed) { Promise.all([ @@ -90,7 +90,7 @@ export class StartupProfiler implements IWorkbenchContribution { type: 'info', message: localize('prof.thanks', "Thanks for helping us."), detail: localize('prof.detail.restart', "A final restart is required to continue to use '{0}'. Again, thank you for your contribution.", this._productService.nameLong), - primaryButton: localize('prof.restart', "Restart"), + primaryButton: localize('prof.restart.button', "&&Restart"), secondaryButton: undefined }).then(() => { // now we are ready to restart diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts index 440e030ae24..caeba8ce960 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts @@ -608,7 +608,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo type: 'info', message: localize('turn off sync confirmation', "Do you want to turn off sync?"), detail: localize('turn off sync detail', "Your settings, keybindings, extensions, snippets and UI State will no longer be synced."), - primaryButton: localize('turn off', "Turn Off"), + primaryButton: localize({ key: 'turn off', comment: ['&& denotes a mnemonic'] }, "&&Turn off"), checkbox: this.userDataSyncWorkbenchService.accountStatus === AccountStatus.Available ? { label: localize('turn off sync everywhere', "Turn off sync on all your devices and clear the data from the cloud.") } : undefined @@ -1222,6 +1222,8 @@ class AcceptChangesContribution extends Disposable implements IEditorContributio const isRemote = conflicts.some(({ remoteResource }) => isEqual(remoteResource, resource)); const acceptRemoteLabel = localize('accept remote', "Accept Remote"); const acceptMergesLabel = localize('accept merges', "Accept Merges"); + const acceptRemoteButtonLabel = localize('accept remote button', "Accept &&Remote"); + const acceptMergesButtonLabel = localize('accept merges button', "Accept &&Merges"); this.acceptChangesButton = this.instantiationService.createInstance(FloatingClickWidget, this.editor, isRemote ? acceptRemoteLabel : acceptMergesLabel, null); this._register(this.acceptChangesButton.onClick(async () => { const model = this.editor.getModel(); @@ -1236,7 +1238,7 @@ class AcceptChangesContribution extends Disposable implements IEditorContributio message: isRemote ? localize('confirm replace and overwrite local', "Would you like to accept remote {0} and replace local {1}?", syncAreaLabel.toLowerCase(), syncAreaLabel.toLowerCase()) : localize('confirm replace and overwrite remote', "Would you like to accept merges and replace remote {0}?", syncAreaLabel.toLowerCase()), - primaryButton: isRemote ? acceptRemoteLabel : acceptMergesLabel + primaryButton: isRemote ? acceptRemoteButtonLabel : acceptMergesButtonLabel }); if (result.confirmed) { try { diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSyncViews.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSyncViews.ts index a3434826dd5..8b801947f8d 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSyncViews.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSyncViews.ts @@ -491,7 +491,7 @@ class UserDataSyncMachinesViewDataProvider implements ITreeViewDataProvider { const result = await this.dialogService.confirm({ type: 'info', message: localize('turn off sync on machine', "Are you sure you want to turn off sync on {0}?", machine.name), - primaryButton: localize('turn off', "Turn off"), + primaryButton: localize({ key: 'turn off', comment: ['&& denotes a mnemonic'] }, "&&Turn off"), }); if (!result.confirmed) { diff --git a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts index 415ec7d3230..720d17e3b0a 100644 --- a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts +++ b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts @@ -288,8 +288,8 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat type: 'warning', message: localize('sync in progress', "Settings Sync is being turned on. Would you like to cancel it?"), title: localize('settings sync', "Settings Sync"), - primaryButton: localize('yes', "Yes"), - secondaryButton: localize('no', "No"), + primaryButton: localize({ key: 'yes', comment: ['&& denotes a mnemonic'] }, "&&Yes"), + secondaryButton: localize({ key: 'no', comment: ['&& denotes a mnemonic'] }, "&&No"), }); if (result.confirmed) { await manualSyncTask.stop(); @@ -429,7 +429,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat message: localize('reset', "This will clear your data in the cloud and stop sync on all your devices."), title: localize('reset title', "Clear"), type: 'info', - primaryButton: localize('reset button', "Reset"), + primaryButton: localize({ key: 'resetButton', comment: ['&& denotes a mnemonic'] }, "&&Reset"), }); if (result.confirmed) { await this.userDataSyncService.resetRemote(); -- GitLab