Commit 44a2f780 authored by JC Brand's avatar JC Brand

Hook in `ar` and `eu` locales and document.

parent 6381128a
...@@ -104,8 +104,8 @@ To do this for ALL languages, run: ...@@ -104,8 +104,8 @@ To do this for ALL languages, run:
The resulting `.po` file is then what gets translated. The resulting `.po` file is then what gets translated.
Generating a JavaScript file from a translations file Generating a JSON file from a translations file
----------------------------------------------------- -----------------------------------------------
Unfortunately `Jed <http://slexaxton.github.io/Jed>`_, which we use for Unfortunately `Jed <http://slexaxton.github.io/Jed>`_, which we use for
translations in converse.js cannot use the `.po` files directly. We have translations in converse.js cannot use the `.po` files directly. We have
...@@ -136,3 +136,29 @@ To do this for ALL languages, run: ...@@ -136,3 +136,29 @@ To do this for ALL languages, run:
If you are adding translations for a new language that is not already supported, If you are adding translations for a new language that is not already supported,
you'll have to add the language path in main.js and make one more edit in ./src/locales.js you'll have to add the language path in main.js and make one more edit in ./src/locales.js
to make sure the language is loaded by require.js. to make sure the language is loaded by require.js.
Making sure the JSON file will get loaded
------------------------------------------
Finally, make sure that the language code is added to the list of default
values for the ``locales`` config setting.
This is done in ``src/converse-core.js``.
Look for the following section:
.. code-block:: javascript
// Default configuration values
// ----------------------------
this.default_settings = {
// ... Omitted for brevity
locales_url: 'locale/{{{locale}}}/LC_MESSAGES/converse.json',
locales: [
'af', 'ar', 'bg', 'ca', 'de', 'es', 'en', 'fr', 'he',
'hu', 'id', 'it', 'ja', 'nb', 'nl',
'pl', 'pt_BR', 'ru', 'tr', 'uk', 'zh_CN', 'zh_TW'
],
// ... Omitted for brevity
};
...@@ -312,7 +312,7 @@ ...@@ -312,7 +312,7 @@
keepalive: true, keepalive: true,
locales_url: 'locale/{{{locale}}}/LC_MESSAGES/converse.json', locales_url: 'locale/{{{locale}}}/LC_MESSAGES/converse.json',
locales: [ locales: [
'af', 'bg', 'ca', 'de', 'es', 'en', 'fr', 'he', 'af', 'ar', 'bg', 'ca', 'de', 'es', 'eu', 'en', 'fr', 'he',
'hu', 'id', 'it', 'ja', 'nb', 'nl', 'hu', 'id', 'it', 'ja', 'nb', 'nl',
'pl', 'pt_BR', 'ru', 'tr', 'uk', 'zh_CN', 'zh_TW' 'pl', 'pt_BR', 'ru', 'tr', 'uk', 'zh_CN', 'zh_TW'
], ],
......
...@@ -15,10 +15,12 @@ ...@@ -15,10 +15,12 @@
"lodash.noconflict", "lodash.noconflict",
"moment", "moment",
'moment/locale/af', 'moment/locale/af',
'moment/locale/ar',
'moment/locale/bg', 'moment/locale/bg',
'moment/locale/ca', 'moment/locale/ca',
'moment/locale/de', 'moment/locale/de',
'moment/locale/es', 'moment/locale/es',
'moment/locale/eu',
'moment/locale/fr', 'moment/locale/fr',
'moment/locale/he', 'moment/locale/he',
'moment/locale/hu', 'moment/locale/hu',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment