浏览代码

i18n locale can now be specified with only the language code

JC Brand 8 年之前
父节点
当前提交
48a3c30e75
共有 1 个文件被更改,包括 3 次插入0 次删除
  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