Platformio-vscode-ide: Upload and other buttons don't work with French locale

Created on 10 May 2018  ·  14Comments  ·  Source: platformio/platformio-vscode-ide

This is because clicking the Upload button runs the task PlatformIO: Upload
https://github.com/platformio/platformio-vscode-ide/blob/develop/src/main.js#L181

However, with the French locale, a space is appended before the colon so the task name becomes PlatformIO : Upload and the command doesn't work (it prompts you to run any of the available tasks)

bug known issue

All 14 comments

Maybe that is a bug of locale? Why do they append this space?

Please move this issue to https://github.com/Microsoft/vscode/issues and make reference to this issue.

I don't get why you think this is a locale bug; using a localisable string as an identifier is just wrong.

Tasks can be matched using via identifier as seen here : https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts#L1174. Why not use that instead?

@dbaeumer sorry that disturb you again. Is this our issue? We use string combination of task type and task name split by :. See https://github.com/platformio/platformio-vscode-ide/blob/develop/src/main.js#L209

I can't run task using taskDefination as you mentioned in the previous issue

vscode.commands.executeCommand('workbench.action.tasks.runTask', {
  type: 'PlatformIO',
  task: 'Clean'
])

We do indeed localize the label since it is presented in the UI let label = nls.localize('task.label', '{0}: {1}', source.label, task.name)

Unfortunately the run task command currently only supports strings as args and not task definitions.

Created https://github.com/Microsoft/vscode/issues/50799

@dbaeumer Why does FRA locale use it as PlatformIO : Upload? Who does add this space?

https://en.wikipedia.org/w/index.php?title=Colon_(punctuation)&oldid=840842446#Spacing

@mickael9 Wow! 😮 Thanks! Let's wait when @dbaeumer resolve https://github.com/Microsoft/vscode/issues/50799 . Then I'll update this extension.

@ivankravets alternatively you could use executeTask directly instead of going through the backdoor of executeCommand.

Thanks, I thought the same yesterday. We need a new release of VSCode firstly.

Agree. Planed for beginning of next week.

It seems that it have been solved.

:+1:

Was this page helpful?
0 / 5 - 0 ratings