Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create the i18n folder structure automatically using vscode-nls-dev #74

Closed
DonJayamanne opened this issue Jun 2, 2018 · 2 comments
Assignees

Comments

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Jun 2, 2018

@dbaeumer

All localization files are under the i18n folder.
You could have created this folder by hand, or you could have used the vscode-nls-dev tool to extract it.
Under the i18n folder, you have sub-folders that represent the language you want to localize. These names follow the ISO 639-3 convention.

Q1. Looking at the sample https://github.com/Microsoft/vscode-extension-samples/tree/8fb95dc0f72c067579c9aaa63c88129781bebb43/i18n-sample, I'm struggling to understand how the i18n folder structure is created.

Does this have to be created by hand, or can be this automated as described above or you could have used the vscode-nls-dev tool to extract it.

Q2. Please could you provide an example.

If you have a top-level package.nls.json file in your extension, you should have one for each language following the naming convention of package.i18n.json.

@dbaeumer
Copy link
Member

dbaeumer commented Jun 5, 2018

@DonJayamanne

Regarding Q1: none of your tools force to use a special translation platform. So it is up to you to decide how these strings are translated. All the tooling does is to assume that there is a i18n folder with sub folder per language were the folder name uses ISO 639-3 convention. Underneath these folders the directory structures is the same as for the source code. If you are using Transifex to translate the project then vscode-nls-dev provides gulp functions to automatically push and pull to Transifex honoring the directory structure. If you choose to use your own translation platform you need to write your own import / export scripts. See https://github.com/Microsoft/vscode-node-debug2.git for an example that uses Transifex.

Q2.: https://github.com/Microsoft/vscode-node-debug2.git is again a good example.

I am closing the issue. Please ping if there something is still unclear.

@dbaeumer dbaeumer closed this as completed Jun 5, 2018
@JarrettSpiker
Copy link

I posted a similar question to StackOverflow, and after figuring it out (using the above comment) added a step-by-step (ish) guide to getting the i18n-sample working.

https://stackoverflow.com/questions/58294569/automatically-create-i18n-directory-for-vscode-extension/

Hopefully if anyone else is stuck with this that helps move them in the right direction.

It would be great if some more of this especially the format of the translated xlf file was spelled out in the readme for i18n-sample

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants