Procházet zdrojové kódy

i18n locale can now be specified with only the language code

JC Brand před 8 roky
rodič
revize
48a3c30e75
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      src/converse-core.js

+ 3 - 0
src/converse-core.js

@@ -188,6 +188,9 @@
             moment.locale = moment.lang;
         }
         moment.locale(utils.detectLocale(this.isMomentLocale));
+        if (_.includes(_.keys(locales), settings.i18n)) {
+            settings.i18n = locales[settings.i18n];
+        }
         this.i18n = settings.i18n ? settings.i18n : locales[utils.detectLocale(this.isConverseLocale)] || {};
 
         // Translation machinery