arcade
arcade copied to clipboard
Feature request: Add support for translating VS Extensibility resources
VS Extensibility stores string resources in .vsextension\string-resources.json
. See https://learn.microsoft.com/en-us/visualstudio/extensibility/visualstudio.extensibility/command/localize-metadata?view=vs-2022. The strings in this file need to be translated.
The ask is to add support for the translation to Microsoft.DotNet.XliffTasks.
XliffTasks isn't publicly shipping. Who would benefit from such a feature? Is it just internal teams?
XliffTasks isn't publicly shipping. Who would benefit from such a feature? Is it just internal teams?
Yes, internal teams. Like anything in Arcade?
Trying to investigate the plan here.
The goal here would be, we should be able to localize strings under .vsextension/
It's similar to the VSCode l10n model. In vscode, it is done in this way.
- vscode l10n would generate
bundle.l10.json
. This is done by scanning the whole extension code. The scanning process is not interesting here. - From
bundle.l10.json
, it would be converted to xlf file by using thegenerate-xlf
in l10n. - These xlf file could later be translated by the LOC team.
- Translated xlf file, can be converted back to json file by using
import-xlf
.
Note VS code only provide l10n and l10-dev packages function via npm, so developer needs to set up the pipeline themself to work with the LOC side.
So in short, vscode path is x.json
-> x.xlf
-> Translated by LOC team -> x.xlf (translated)
-> x.json
In VS, it seems like we need to support LOC from both the json file and the legacy xlf file.
For each extension, it seems like xliff-tasks
should support
- Convert the
string-resources.json
tostring-resources.xlf
. - Expand
string-resources.xlf
to all the supported language version. - Convert
<lang>/string-resources.xlf
back to<lang>/string-resources.json
(I guess there should be only one string-ressources.xlf
per extension)
Arcade might add other support to feed the results of Step 2
to LOC side so they can generated the real LOC content. It might not needed in xliff-tasks
I am unfamiliar with arcade repo and xliff-tasks
. Is this a good plan? Do I need to get someone's review before start working on this? Tag @tmat and @ViktorHofer
@Cosifne Yes, that's how it would work. xliff-tasks already implements everything. It just needs to understand the additional string-resources.json
items. Seems like adding it is straightforward. I'll give it a shot since it's blocking me now.
I think it's done now in the linked PR.