Browse Source

Using dict format to allow standard lang codes

Allowing standard language code makes easier to backends to send it to
converse.js keeping coherence.
Matheus Figueiredo 12 năm trước cách đây
mục cha
commit
6c5a9efe0c
2 tập tin đã thay đổi với 10 bổ sung9 xóa
  1. 1 1
      index.html
  2. 9 8
      locale/locales.js

+ 1 - 1
index.html

@@ -171,7 +171,7 @@
             auto_subscribe: false,
             auto_subscribe: false,
             bosh_service_url: 'https://bind.opkode.im', // Please use this connection manager only for testing purposes
             bosh_service_url: 'https://bind.opkode.im', // Please use this connection manager only for testing purposes
             hide_muc_server: false,
             hide_muc_server: false,
-            i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported
+            i18n: locales['en'], // Refer to ./locale/locales.js to see which locales are supported
             prebind: false,
             prebind: false,
             show_controlbox_by_default: true,
             show_controlbox_by_default: true,
             xhr_user_search: false
             xhr_user_search: false

+ 9 - 8
locale/locales.js

@@ -29,13 +29,14 @@
         "it",
         "it",
         'ptbr'
         'ptbr'
         ], function (jed, af, en, es, de, hu, it, ptbr) {
         ], function (jed, af, en, es, de, hu, it, ptbr) {
-            root.locales = {};
-            root.locales.af = af;
-            root.locales.en = en;
-            root.locales.es = es;
-            root.locales.de = de;
-            root.locales.hu = hu;
-            root.locales.it = it;
-            root.locales.ptbr = ptbr;
+            root.locales = {
+                 'af': af,
+                 'en': en,
+                 'es': es,
+                 'de': de,
+                 'hu': hu,
+                 'it': it,
+                 'pt-br': ptbr
+            };
         });
         });
 })(this);
 })(this);