Skip to content

Commit df2e764

Browse files
authored
improve remote tunnel localize descriptions (microsoft#167035)
1 parent efb4fd9 commit df2e764

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/vs/platform/remoteTunnel/electron-browser/remoteTunnelService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class RemoteTunnelService extends Disposable implements IRemoteTunnelServ
142142
}
143143
const { token, providerId, accountLabel: accountName } = this._account;
144144

145-
this.setTunnelStatus(TunnelStates.connecting(localize('remoteTunnelService.authorizing', 'Connecting as {0} ({1})', accountName, providerId)));
145+
this.setTunnelStatus(TunnelStates.connecting(localize({ key: 'remoteTunnelService.authorizing', comment: ['{0} is a user account name, {1} a provider name (e.g. Github)'] }, 'Connecting as {0} ({1})', accountName, providerId)));
146146
const onOutput = (a: string, isErr: boolean) => {
147147
a = a.replaceAll(token, '*'.repeat(4));
148148
if (isErr) {
@@ -171,7 +171,7 @@ export class RemoteTunnelService extends Disposable implements IRemoteTunnelServ
171171

172172
const hostName = this.getHostName();
173173
if (hostName) {
174-
this.setTunnelStatus(TunnelStates.connecting(localize('remoteTunnelService.openTunnelWithName', 'Opening tunnel for {0}', hostName)));
174+
this.setTunnelStatus(TunnelStates.connecting(localize({ key: 'remoteTunnelService.openTunnelWithName', comment: ['{0} is a host name'] }, 'Opening tunnel for {0}', hostName)));
175175
} else {
176176
this.setTunnelStatus(TunnelStates.connecting(localize('remoteTunnelService.openTunnel', 'Opening tunnel')));
177177
}
@@ -234,12 +234,12 @@ export class RemoteTunnelService extends Disposable implements IRemoteTunnelServ
234234
});
235235
if (!this.environmentService.isBuilt) {
236236
onOutput('Building tunnel CLI from sources and run', false);
237-
onOutput(`${logLabel} Spawning: cargo run -- tunnel ${commandArgs.join(' ')} `, false);
237+
onOutput(`${logLabel} Spawning: cargo run -- tunnel ${commandArgs.join(' ')}`, false);
238238
tunnelProcess = spawn('cargo', ['run', '--', 'tunnel', ...commandArgs], { cwd: join(this.environmentService.appRoot, 'cli') });
239239
} else {
240240
onOutput('Running tunnel CLI', false);
241241
const tunnelCommand = this.getTunnelCommandLocation();
242-
onOutput(`${logLabel} Spawning: ${tunnelCommand} tunnel ${commandArgs.join(' ')} `, false);
242+
onOutput(`${logLabel} Spawning: ${tunnelCommand} tunnel ${commandArgs.join(' ')}`, false);
243243
tunnelProcess = spawn(tunnelCommand, ['tunnel', ...commandArgs], { cwd: homedir() });
244244
}
245245

src/vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
188188
return await this.progressService.withProgress(
189189
{
190190
location: silent ? ProgressLocation.Window : ProgressLocation.Notification,
191-
title: localize('progress.title', "[Starting remote tunnel](command:{0})", RemoteTunnelCommandIds.showLog),
191+
title: localize({ key: 'progress.title', comment: ['Only translate \'Starting remote tunnel\', do not change the format of the rest (markdown link format)'] }, "[Starting remote tunnel](command:{0})", RemoteTunnelCommandIds.showLog),
192192
},
193193
(progress: IProgress<IProgressStep>) => {
194194
return new Promise<ConnectionInfo | undefined>((s, e) => {
@@ -310,7 +310,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
310310
const signedInForProvider = sessions.some(account => account.providerId === authenticationProvider.id);
311311
if (!signedInForProvider || this.authenticationService.supportsMultipleAccounts(authenticationProvider.id)) {
312312
const providerName = this.authenticationService.getLabel(authenticationProvider.id);
313-
options.push({ label: localize('sign in using account', "Sign in with {0}", providerName), provider: authenticationProvider });
313+
options.push({ label: localize({ key: 'sign in using account', comment: ['{0} will be a auth provider (e.g. Github)'] }, "Sign in with {0}", providerName), provider: authenticationProvider });
314314
}
315315
}
316316

@@ -424,7 +424,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
424424
const linkToOpen = that.getLinkToOpen(connectionInfo);
425425
await notificationService.notify({
426426
severity: Severity.Info,
427-
message: localize('progress.turnOn.final',
427+
message: localize({ key: 'progress.turnOn.final', comment: ['{0} will be a host name, {1} will the link address to the web UI. [label](command:commandId) is a markdown lionk. Only translate label, never change the format'] },
428428
"Remote tunnel access is enabled for [{0}](command:{4}). To access from a different machine, open [{1}]({2}) or use the Remote - Tunnels extension. Use the Account menu to [configure](command:{3}) or [turn off](command:{5}).",
429429
connectionInfo.hostName, connectionInfo.domain, linkToOpen, RemoteTunnelCommandIds.manage, RemoteTunnelCommandIds.configure, RemoteTunnelCommandIds.turnOff),
430430
actions: {
@@ -621,7 +621,9 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
621621
const items: Array<QuickPickItem> = [];
622622
items.push({ id: RemoteTunnelCommandIds.learnMore, label: RemoteTunnelCommandLabels.learnMore });
623623
if (this.connectionInfo && account) {
624-
quickPick.title = localize('manage.title.on', 'Remote Machine Access enabled for {0}({1}) as {2}', account.label, account.description, this.connectionInfo.hostName);
624+
quickPick.title = localize(
625+
{ key: 'manage.title.on', comment: ['{0} will be a user account name, {1} the provider name (e.g. Github), {2} is the machine name'] },
626+
'Remote Machine Access enabled for {0}({1}) as {2}', account.label, account.description, this.connectionInfo.hostName);
625627
items.push({ id: RemoteTunnelCommandIds.copyToClipboard, label: RemoteTunnelCommandLabels.copyToClipboard, description: this.connectionInfo.domain });
626628
} else {
627629
quickPick.title = localize('manage.title.off', 'Remote Machine Access not enabled');

0 commit comments

Comments
 (0)