Skip to content

Commit

Permalink
docs(ui): update translation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Oct 28, 2018
1 parent f127531 commit 1aed844
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions docs/dev-guide/ui-localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,13 @@

## Translate the standard UI

Follow those simple steps to propose a new language for the CLI UI!

1. Run `navigator.languages` or `navigator.language` to get the language code for the new locale. *For example: `'fr'`.*

2. Search NPM to see if a package called `vue-cli-locale-<language code>` doesn't already exist. If it does, please contribute to it by submitting PRs! If you don't find any, create a new package called `vue-cli-locale-<language code>`. *For example: `vue-cli-locale-fr`*

3. Put the locale JSON file in a `locales` folder and give it the name of the language code. *For example: `locales/fr.json`*

4. In the `package.json` file, set the `unpkg` field to the path to the locale file. *For example: `"unpkg": "./locales/fr.json"`*

5. Publish the package on NPM.

The English reference locale is [here](https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-ui/locales/en.json).

Take a look at [the french localization package](https://github.com/Akryum/vue-cli-locale-fr) as an example.

### Easier translation with Transifex

To make collaboration and synchronisation easier, the English source locale from the `dev` branch is automatically imported to [Transifex](https://www.transifex.com/vuejs/vue-cli/dashboard/), a platform for collaborative translation.

For existing languages, you can [sign up as a translator](https://www.transifex.com/vuejs/vue-cli/dashboard/).
For new languages, you can [request the new language](https://www.transifex.com/vuejs/vue-cli/dashboard/) after signing up.

In either case you will be able to translate keys as they are added or changed in the source locale.

Note that the translations on Transifex are not automatically exported into the localization packages. However, maintainers of locale package maintainers can easily export their translated locale from Transifex via "View resources" (next to the language), by clicking on the "cli-ui" resource and finally choosing "Download for use".

## Translate your plugin

You can put locale files compatible with [vue-i18n](https://github.com/kazupon/vue-i18n) in a `locales` folder at the root of your plugin. They will be automatically loaded into the client when the project is opened. You can then use `$t` to translate strings in your components and other vue-i18n helpers. Also, the strings used in the UI API (like `describeTask`) will go through vue-i18n as well to you can localize them.
Expand Down

0 comments on commit 1aed844

Please sign in to comment.