UNPKG

1.07 kBMarkdownView Raw
1# How to add a new translation
2
31. 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`).
92. 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.)
113. Copy the root `strings.js` file into your subfolder and start translating!
12
13Strings not specified in a given locale will fall back to the language for that locale, if any,
14and strings not specified in either the locale or its language will fall back to the `root`
15string entry.
16
17Localization is provided via the require.js i18n plugin. See the [require i18n docs][1]
18for more info.
19
20[1]: http://requirejs.org/docs/api.html#i18n
\No newline at end of file