Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add sample on how to localize in VS Code #21
What does this PR do?
As far as I can tell, there is not much documentation on how extension authors can localize their VS Code extensions. VS Code itself (and extensions that are bundled with it, are properly localized) but there are not many examples of how to do it (short of reading the source code). There have been several questions on this:
This is a small extension that shows several things:
What is not in the scope of this PR?
This PR does not talk about Transifex and different file formats for localization. The
It also tries to demystify a lot of the magic that
Another reason I am doing this is also to learn how localization works in VS Code and also validate some of my assumptions on what is save to use (API stable). We are creating several extensions and localization is something that we have been asked to look into. Even if this PR is not accepted, comments on the assumptions in my code is appreciated so that we can understand what we should or should not rely on.
@vazexqi I worked on the PR and made a couple of changes, mainly around structure and things that have changed in our thinking around nls in the meantime.
The demo.gif got outdated through that. Could you please generate a new one. The change I made are available here: https://github.com/Microsoft/vscode-extension-samples/tree/vazexqi-master
@dbaeumer - Thanks for the review and changes.
I should be able to do this over the weekend and have an updated PR in by Monday.
@dbaeumer I've rebased master of https://github.com/vazexqi/vscode-extension-samples onto the latest master of https://github.com/Microsoft/vscode-extension-samples and cherry-picked your changes over since I don't have access to push to vazexqi-master on this repo.
I've also regenerated the gif so that it shows using
I noticed that you removed two files (i18n-sample/i18n/jpn/out/command/sayBye.i18n.json and i18n-sample/i18n/jpn/out/extension.i18n.json). This might have been because your .gitignore is too strict. If you don't have those files, then when you run
I've added them back in.