Skip to content

Commit b4c1bd0

Browse files
authored
Merge pull request #125817 from microsoft/aeschli/125786
aeschli/125786
2 parents f8b576c + 33d504f commit b4c1bd0

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,10 @@ class FormatOnSaveParticipant implements ITextFileSaveParticipant {
233233
const nestedProgress = new Progress<{ displayName?: string, extensionId?: ExtensionIdentifier }>(provider => {
234234
progress.report({
235235
message: localize(
236-
'formatting',
237-
"Running '{0}' Formatter ([configure](command:workbench.action.openSettings?%5B%22editor.formatOnSave%22%5D)).",
238-
provider.displayName || provider.extensionId && provider.extensionId.value || '???'
236+
{ key: 'formatting2', comment: ['[configure]({1}) is a link. Only translate `configure`. Do not change brackets and parentheses or {1}'] },
237+
"Running '{0}' Formatter ([configure]({1})).",
238+
provider.displayName || provider.extensionId && provider.extensionId.value || '???',
239+
'command:workbench.action.openSettings?%5B%22editor.formatOnSave%22%5D'
239240
)
240241
});
241242
});
@@ -336,9 +337,10 @@ class CodeActionOnSaveParticipant implements ITextFileSaveParticipant {
336337
private _report(): void {
337338
progress.report({
338339
message: localize(
339-
'codeaction.get',
340-
"Getting code actions from '{0}' ([configure](command:workbench.action.openSettings?%5B%22editor.codeActionsOnSave%22%5D)).",
341-
[...this._names].map(name => `'${name}'`).join(', ')
340+
{ key: 'codeaction.get2', comment: ['[configure]({1}) is a link. Only translate `configure`. Do not change brackets and parentheses or {1}'] },
341+
"Getting code actions from '{0}' ([configure]({1})).",
342+
[...this._names].map(name => `'${name}'`).join(', '),
343+
'command:workbench.action.openSettings?%5B%22editor.codeActionsOnSave%22%5D'
342344
)
343345
});
344346
}

src/vs/workbench/contrib/remote/browser/remoteExplorer.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ class OnAutoForwardedAction extends Disposable {
314314
}
315315

316316
private linkMessage() {
317-
return nls.localize('remote.tunnelsView.notificationLink', "[See all forwarded ports](command:{0}.focus)", TunnelPanel.ID);
317+
return nls.localize(
318+
{ key: 'remote.tunnelsView.notificationLink2', comment: ['[See all forwarded ports]({0}) is a link. Only translate `See all forwarded ports`. Do not change brackets and parentheses or {0}'] },
319+
"[See all forwarded ports]({0})", `command:${TunnelPanel.ID}.focus`);
318320
}
319321

320322
private async showNotification(tunnel: RemoteTunnel) {

src/vs/workbench/contrib/remote/browser/remoteIndicator.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
301301
const workspaceLabel = this.getWorkspaceLabel();
302302
if (workspaceLabel) {
303303
const toolTip: IMarkdownString = {
304-
value: nls.localize('workspace.tooltip', "Virtual workspace on {0}\n\n[Some features](command:{1}) are not available for resources located on a virtual file system.", workspaceLabel, LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID),
304+
value: nls.localize(
305+
{ key: 'workspace.tooltip2', comment: ['{0} is a remote location name, e.g. GitHub', '[Some features]({1}) is a link. Only translate `Some features`. Do not change brackets and parentheses or {1}'] },
306+
"Virtual workspace on {0}\n\n[Some features]({1}) are not available for resources located on a virtual file system.",
307+
workspaceLabel, `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
308+
),
305309
isTrusted: true
306310
};
307311
this.renderRemoteStatusIndicator(`$(remote) ${truncate(workspaceLabel, RemoteStatusIndicator.REMOTE_STATUS_LABEL_MAX_LENGTH)}`, toolTip);

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

+18-3
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,12 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
374374
ariaLabel = trusted ? localize('status.ariaTrustedWindow', "This window is trusted.") :
375375
localize('status.ariaUntrustedWindow', "Restricted Mode: Some features are disabled because this window is not trusted.");
376376
toolTip = trusted ? ariaLabel : {
377-
value: localize('status.tooltipUntrustedWindow', "Running in Restricted Mode\n\n\Some [features are disabled](command:{0}) because this [window is not trusted](command:{1}).", LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID, MANAGE_TRUST_COMMAND_ID),
377+
value: localize(
378+
{ key: 'status.tooltipUntrustedWindow2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `window is not trusted`. Do not change brackets and parentheses or {n}'] },
379+
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
380+
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
381+
`command:${MANAGE_TRUST_COMMAND_ID}`
382+
),
378383
isTrusted: true,
379384
supportThemeIcons: true
380385
};
@@ -384,7 +389,12 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
384389
ariaLabel = trusted ? localize('status.ariaTrustedFolder', "This folder is trusted.") :
385390
localize('status.ariaUntrustedFolder', "Restricted Mode: Some features are disabled because this folder is not trusted.");
386391
toolTip = trusted ? ariaLabel : {
387-
value: localize('status.tooltipUntrustedFolder', "Running in Restricted Mode\n\n\Some [features are disabled](command:{0}) because this [folder is not trusted](command:{1}).", LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID, MANAGE_TRUST_COMMAND_ID),
392+
value: localize(
393+
{ key: 'status.tooltipUntrustedFolder2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `folder is not trusted`. Do not change brackets and parentheses or {n}'] },
394+
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
395+
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
396+
`command:${MANAGE_TRUST_COMMAND_ID}`
397+
),
388398
isTrusted: true,
389399
supportThemeIcons: true
390400
};
@@ -394,7 +404,12 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
394404
ariaLabel = trusted ? localize('status.ariaTrustedWorkspace', "This workspace is trusted.") :
395405
localize('status.ariaUntrustedWorkspace', "Restricted Mode: Some features are disabled because this workspace is not trusted.");
396406
toolTip = trusted ? ariaLabel : {
397-
value: localize('status.tooltipUntrustedWorkspace', "Running in Restricted Mode\n\n\Some [features are disabled](command:{0}) because this [workspace is not trusted](command:{1}).", LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID, MANAGE_TRUST_COMMAND_ID),
407+
value: localize(
408+
{ key: 'status.tooltipUntrustedWorkspace2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `workspace is not trusted`. Do not change brackets and parentheses or {n}'] },
409+
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
410+
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
411+
`command:${MANAGE_TRUST_COMMAND_ID}`
412+
),
398413
isTrusted: true,
399414
supportThemeIcons: true
400415
};

0 commit comments

Comments
 (0)