@midwayjs/i18n 3.16.6 → 3.17.0

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.
@@ -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.16.6",
4
+ "version": "3.17.0",
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.16.2",
17
- "@midwayjs/express": "^3.16.5",
18
- "@midwayjs/koa": "^3.16.6",
19
- "@midwayjs/mock": "^3.16.5"
16
+ "@midwayjs/core": "^3.17.0",
17
+ "@midwayjs/express": "^3.17.0",
18
+ "@midwayjs/koa": "^3.17.0",
19
+ "@midwayjs/mock": "^3.17.0"
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": "9edcf6fd9e85f81bb83e8967c17cd1cb1f164020"
41
+ "gitHead": "21faf25ae7277f28d61f8416d1acd5a786a2c353"
42
42
  }