Skip to content

Commit 96a795c

Browse files
Lock command strings to prevent issues with translations (#172664)
Fixes microsoft/vscode#172663
1 parent 8ca48df commit 96a795c

File tree

1 file changed

+44
-6
lines changed

1 file changed

+44
-6
lines changed

src/vs/workbench/contrib/debug/browser/welcomeView.ts

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,31 @@ export class WelcomeView extends ViewPane {
107107

108108
const viewsRegistry = Registry.as<IViewsRegistry>(Extensions.ViewsRegistry);
109109
viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
110-
content: localize({ key: 'openAFileWhichCanBeDebugged', comment: ['Please do not translate the word "commmand", it is part of our internal syntax which must not change'] },
111-
"[Open a file](command:{0}) which can be debugged or run.", (isMacintosh && !isWeb) ? OpenFileFolderAction.ID : OpenFileAction.ID),
110+
content: localize(
111+
{
112+
key: 'openAFileWhichCanBeDebugged',
113+
comment: [
114+
'Please do not translate the word "command", it is part of our internal syntax which must not change',
115+
'{Locked="](command:{0})"}'
116+
]
117+
},
118+
"[Open a file](command:{0}) which can be debugged or run.", (isMacintosh && !isWeb) ? OpenFileFolderAction.ID : OpenFileAction.ID
119+
),
112120
when: ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUGGER_INTERESTED_IN_ACTIVE_EDITOR.toNegated()),
113121
group: ViewContentGroups.Open,
114122
});
115123

116124
let debugKeybindingLabel = '';
117125
viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
118-
content: localize({ key: 'runAndDebugAction', comment: ['Please do not translate the word "commmand", it is part of our internal syntax which must not change'] },
126+
content: localize(
127+
{
128+
key: 'runAndDebugAction',
129+
comment: [
130+
'{0} will be replaced with a keybinding',
131+
'Please do not translate the word "command", it is part of our internal syntax which must not change',
132+
'{Locked="](command:{1})"}'
133+
]
134+
},
119135
"[Run and Debug{0}](command:{1})", debugKeybindingLabel, DEBUG_START_COMMAND_ID),
120136
when: CONTEXT_DEBUGGERS_AVAILABLE,
121137
group: ViewContentGroups.Debug,
@@ -124,22 +140,44 @@ viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
124140
});
125141

126142
viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
127-
content: localize({ key: 'detectThenRunAndDebug', comment: ['Please do not translate the word "commmand", it is part of our internal syntax which must not change'] },
143+
content: localize(
144+
{
145+
key: 'detectThenRunAndDebug',
146+
comment: [
147+
'Please do not translate the word "command", it is part of our internal syntax which must not change',
148+
'{Locked="](command:{0})"}',
149+
150+
]
151+
},
128152
"[Show all automatic debug configurations](command:{0}).", SELECT_AND_START_ID),
129153
when: CONTEXT_DEBUGGERS_AVAILABLE,
130154
group: ViewContentGroups.Debug,
131155
order: 10
132156
});
133157

134158
viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
135-
content: localize({ key: 'customizeRunAndDebug', comment: ['Please do not translate the word "commmand", it is part of our internal syntax which must not change'] },
159+
content: localize(
160+
{
161+
key: 'customizeRunAndDebug',
162+
comment: [
163+
'Please do not translate the word "command", it is part of our internal syntax which must not change',
164+
'{Locked="](command:{0})"}'
165+
]
166+
},
136167
"To customize Run and Debug [create a launch.json file](command:{0}).", DEBUG_CONFIGURE_COMMAND_ID),
137168
when: ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, WorkbenchStateContext.notEqualsTo('empty')),
138169
group: ViewContentGroups.Debug
139170
});
140171

141172
viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
142-
content: localize({ key: 'customizeRunAndDebugOpenFolder', comment: ['Please do not translate the word "commmand", it is part of our internal syntax which must not change'] },
173+
content: localize(
174+
{
175+
key: 'customizeRunAndDebugOpenFolder',
176+
comment: [
177+
'Please do not translate the word "commmand", it is part of our internal syntax which must not change',
178+
'{Locked="](command:{0})"}'
179+
]
180+
},
143181
"To customize Run and Debug, [open a folder](command:{0}) and create a launch.json file.", (isMacintosh && !isWeb) ? OpenFileFolderAction.ID : OpenFolderAction.ID),
144182
when: ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, WorkbenchStateContext.isEqualTo('empty')),
145183
group: ViewContentGroups.Debug

0 commit comments

Comments
 (0)