Pārlūkot izejas kodu

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

JC Brand 7 gadi atpakaļ
vecāks
revīzija
44a2f7807c
3 mainītis faili ar 31 papildinājumiem un 3 dzēšanām
  1. 28 2
      docs/source/translations.rst
  2. 1 1
      src/converse-core.js
  3. 2 0
      src/i18n.js

+ 28 - 2
docs/source/translations.rst

@@ -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
+        };

+ 1 - 1
src/converse-core.js

@@ -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'
             ],

+ 2 - 0
src/i18n.js

@@ -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',