Hook in ar and eu locales and document.

This commit is contained in:
JC Brand 2018-03-31 15:45:23 +02:00
parent 6381128a5f
commit 44a2f7807c
3 changed files with 31 additions and 3 deletions

View File

@ -104,8 +104,8 @@ To do this for ALL languages, run:
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
translations in converse.js cannot use the `.po` files directly. We have
@ -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,
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.
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
};

View File

@ -312,7 +312,7 @@
keepalive: true,
locales_url: 'locale/{{{locale}}}/LC_MESSAGES/converse.json',
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',
'pl', 'pt_BR', 'ru', 'tr', 'uk', 'zh_CN', 'zh_TW'
],

View File

@ -15,10 +15,12 @@
"lodash.noconflict",
"moment",
'moment/locale/af',
'moment/locale/ar',
'moment/locale/bg',
'moment/locale/ca',
'moment/locale/de',
'moment/locale/es',
'moment/locale/eu',
'moment/locale/fr',
'moment/locale/he',
'moment/locale/hu',