Skip to content

Commit

Permalink
Merge pull request #152190 from microsoft/tyriar/152076
Browse files Browse the repository at this point in the history
Localize 'Executing task' messages
  • Loading branch information
Tyriar committed Jun 15, 2022
2 parents dfc3718 + 4f66d55 commit 14d6d81
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1122,9 +1122,15 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
shellLaunchConfig.args = windowsShellArgs ? combinedShellArgs.join(' ') : combinedShellArgs;
if (task.command.presentation && task.command.presentation.echo) {
if (needsFolderQualification && workspaceFolder) {
shellLaunchConfig.initialText = formatMessageForTerminal(`Executing task in folder ${workspaceFolder.name}: ${commandLine}`, { excludeLeadingNewLine: true });
shellLaunchConfig.initialText = formatMessageForTerminal(nls.localize({
key: 'task.executingInFolder',
comment: ['The workspace folder the task is running in', 'The task command line or label']
}, 'Executing task in folder {0}: {1}', workspaceFolder.name, commandLine), { excludeLeadingNewLine: true });
} else {
shellLaunchConfig.initialText = formatMessageForTerminal(`Executing task: ${commandLine}`, { excludeLeadingNewLine: true });
shellLaunchConfig.initialText = formatMessageForTerminal(nls.localize({
key: 'task.executing',
comment: ['The task command line or label']
}, 'Executing task: {0}', commandLine), { excludeLeadingNewLine: true });
}
}
} else {
Expand Down Expand Up @@ -1154,9 +1160,15 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
return args.join(' ');
};
if (needsFolderQualification && workspaceFolder) {
shellLaunchConfig.initialText = formatMessageForTerminal(`Executing task in folder ${workspaceFolder.name}: ${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`, { excludeLeadingNewLine: true });
shellLaunchConfig.initialText = formatMessageForTerminal(nls.localize({
key: 'task.executingInFolder',
comment: ['The workspace folder the task is running in', 'The task command line or label']
}, 'Executing task in folder {0}: {1}', workspaceFolder.name, `${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`), { excludeLeadingNewLine: true });
} else {
shellLaunchConfig.initialText = formatMessageForTerminal(`Executing task: ${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`, { excludeLeadingNewLine: true });
shellLaunchConfig.initialText = formatMessageForTerminal(nls.localize({
key: 'task.executing',
comment: ['The task command line or label']
}, 'Executing task: {0}', `${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`), { excludeLeadingNewLine: true });
}
}
}
Expand Down Expand Up @@ -1256,7 +1268,10 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
customPtyImplementation: (id, cols, rows) => new TerminalProcessExtHostProxy(id, cols, rows, this._terminalService),
waitOnExit,
name: this._createTerminalName(task),
initialText: task.command.presentation && task.command.presentation.echo ? formatMessageForTerminal(`Executing task: ${task._label}`, { excludeLeadingNewLine: true }) : undefined,
initialText: task.command.presentation && task.command.presentation.echo ? formatMessageForTerminal(nls.localize({
key: 'task.executing',
comment: ['The task command line or label']
}, 'Executing task: {0}', task._label), { excludeLeadingNewLine: true }) : undefined,
isFeatureTerminal: true,
icon: task.configurationProperties.icon ? ThemeIcon.fromId(task.configurationProperties.icon) : undefined,
color: task.configurationProperties.color
Expand Down

0 comments on commit 14d6d81

Please sign in to comment.