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

Translation using l10n vscode api #1178

Merged
merged 10 commits into from
May 13, 2024
Prev Previous commit
Next Next commit
update language contribution doc
  • Loading branch information
brianignacio5 committed Apr 28, 2024
commit a610dec4f9f82dcae7ac4e4b76b65070d160045d
19 changes: 4 additions & 15 deletions docs/LANG_CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,18 @@

Make sure you install the source code version of this extension by following [Source Mode](./INSTALL.md#Build-from-Source-Code).

Inside i18n folder, create a sub-directory using the language code name as specified by [ISO 639-3](https://en.wikipedia.org/wiki/ISO_639-3) convention.
Inside `l10n` folder, create a `bundle.l10n.<lang>.json` file using the language code name as specified by [ISO 639-3](https://en.wikipedia.org/wiki/ISO_639-3) convention to replace `<lang>`.

For ease you could copy the `en` for English definitions. A language folder tree structure should look like:
In the root directory, also contribute a `package.nls.<lang>.json` for static language definitions such as command names and such.

```
<IS0 639-3 Language Code>/
+-- out/
+-- sub-directory/
+-- ...
+-- ...
+-- ...
+-- ...
+-- extension.i18n.json
+-- utils.i18n.json
+-- package.i18n.json
```
To generate the english definition, just run the `yarn genLocalizationBundle` command which will generate `l10n/bundle.l10n.json` english bundle file and copy the `package.nls.json`.

Each file has a key value structure such as:

```json
{
"espIdf.createFiles.title": "ESP-IDF: Create ESP-IDF Project from Extension Template",
"textID": "value"
"englishTextOrTextId": "translationInNewLanguage"
}
```

Expand Down