@midwayjs/i18n 3.16.8 → 3.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/i18nService.js +3 -3
- package/package.json +6 -6
package/dist/i18nService.js
CHANGED
|
@@ -39,7 +39,7 @@ let MidwayI18nServiceSingleton = class MidwayI18nServiceSingleton {
|
|
|
39
39
|
* @param localeTextMapping
|
|
40
40
|
*/
|
|
41
41
|
addLocale(locale, localeTextMapping) {
|
|
42
|
-
const currentLangMap = getMap(this.localeTextMap, locale);
|
|
42
|
+
const currentLangMap = getMap(this.localeTextMap, locale, true);
|
|
43
43
|
for (const key in localeTextMapping) {
|
|
44
44
|
if (typeof localeTextMapping[key] === 'string') {
|
|
45
45
|
// set to default
|
|
@@ -267,8 +267,8 @@ function getES6Object(o) {
|
|
|
267
267
|
}
|
|
268
268
|
return o;
|
|
269
269
|
}
|
|
270
|
-
function getMap(o, key) {
|
|
271
|
-
key = (0, utils_1.formatLocale)(key);
|
|
270
|
+
function getMap(o, key, formatKey = false) {
|
|
271
|
+
key = formatKey ? (0, utils_1.formatLocale)(key) : key;
|
|
272
272
|
if (!o.has(key)) {
|
|
273
273
|
o.set(key, new Map());
|
|
274
274
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/i18n",
|
|
3
3
|
"description": "midway i18n component",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.17.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"picomatch": "2.3.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@midwayjs/core": "^3.
|
|
17
|
-
"@midwayjs/express": "^3.
|
|
18
|
-
"@midwayjs/koa": "^3.
|
|
19
|
-
"@midwayjs/mock": "^3.
|
|
16
|
+
"@midwayjs/core": "^3.17.1",
|
|
17
|
+
"@midwayjs/express": "^3.17.1",
|
|
18
|
+
"@midwayjs/koa": "^3.17.1",
|
|
19
|
+
"@midwayjs/mock": "^3.17.1"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"midway",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"type": "git",
|
|
39
39
|
"url": "https://github.com/midwayjs/midway.git"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "824d8474a425b342fcd4480649c83677f846afb9"
|
|
42
42
|
}
|