Yuki Takei 5 лет назад
Родитель
Сommit
36f1f2249c

+ 0 - 1
resource/locales/en_US/meta.json

@@ -1,5 +1,4 @@
 {
   "id": "en_US",
-  "aliases": ["en", "en-US"],
   "name": "English"
 }

+ 0 - 1
resource/locales/ja_JP/meta.json

@@ -1,5 +1,4 @@
 {
   "id": "ja_JP",
-  "aliases": ["ja"],
   "name": "日本語"
 }

+ 0 - 1
resource/locales/zh_CN/meta.json

@@ -1,5 +1,4 @@
 {
   "id": "zh_CN",
-  "aliases": [],
   "name": "简体中文"
 }

+ 1 - 9
src/server/util/i18nUserSettingDetector.js

@@ -1,7 +1,3 @@
-const { getLocaleAliasToIdMap } = require('@commons/util/locale-utils');
-
-const aliasToIdMap = getLocaleAliasToIdMap();
-
 module.exports = {
   name: 'userSettingDetector',
 
@@ -10,11 +6,7 @@ module.exports = {
       return null;
     }
 
-    // convert locale alias to corrent locale id for backward compatibility -- 2020.06.21 Yuki Takei
-    const { userLang } = req.user;
-    const convertedLocaleId = aliasToIdMap[userLang];
-
-    return convertedLocaleId || req.user.lang || null;
+    return req.user.lang || null;
   },
 
   cacheUserlanguage(req, res, lng, options) {

+ 0 - 13
src/server/util/middlewares.js

@@ -8,10 +8,6 @@ const pathUtils = require('growi-commons').pathUtils;
 const md5 = require('md5');
 const entities = require('entities');
 
-const { getLocaleAliasToIdMap } = require('@commons/util/locale-utils');
-
-const aliasToIdMap = getLocaleAliasToIdMap();
-
 module.exports = (crowi) => {
   const { configManager, appService } = crowi;
 
@@ -158,15 +154,6 @@ module.exports = (crowi) => {
         return list.slice(start, end);
       });
 
-      /**
-       * convert locale alias to corrent locale id for backward compatibility -- 2020.06.21 Yuki Takei
-       */
-      swig.setFilter('convertOldLangPropertyToLocaleId', (user) => {
-        const { lang: userLang } = user;
-        user.lang = aliasToIdMap[userLang] || userLang;
-        return user;
-      });
-
       next();
     };
   };

+ 1 - 1
src/server/views/layout/layout.html

@@ -163,7 +163,7 @@
 
 {% if user != null %}
   <script type="application/json" id="growi-current-user">
-  {{ user|convertOldLangPropertyToLocaleId|json|safe|preventXss }}
+  {{ user|json|safe|preventXss }}
   </script>
 {% endif %}