1 | # How to add a new translation
|
2 |
|
3 | 1. Create a subfolder of the `nls` folder whose name is the language or locale you want to
|
4 | create a translation for.
|
5 | * If you're creating a general translation for a language, just use its two-letter code
|
6 | (e.g. `en`, `de`).
|
7 | * If you're creating a locale-specific translation for a particular country, add a hyphen
|
8 | and the country code in lowercase (e.g. `en-ca`, `en-gb`).
|
9 | 2. Add an entry for your translation to the `module.exports` object in `nls/strings.js`.
|
10 | (Eventually, we should remove this requirement and just scan the folder for available languages.)
|
11 | 3. Copy the root `strings.js` file into your subfolder and start translating!
|
12 |
|
13 | Strings not specified in a given locale will fall back to the language for that locale, if any,
|
14 | and strings not specified in either the locale or its language will fall back to the `root`
|
15 | string entry.
|
16 |
|
17 | Localization is provided via the require.js i18n plugin. See the [require i18n docs][1]
|
18 | for more info.
|
19 |
|
20 | [1]: http://requirejs.org/docs/api.html#i18n |
\ | No newline at end of file |