@cloudtower/parrot 0.10.0 → 0.12.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.
@@ -0,0 +1,23 @@
1
+ @tower/i18n:prepublish: cache hit, replaying output 3aaff15b304d5006
2
+ @tower/i18n:prepublish: $ npm run build && npm run typings
3
+ @tower/i18n:prepublish: npm WARN ignoring workspace config at /home/cqh/workspace/smartx/tower/packages/i18n/.npmrc
4
+ @tower/i18n:prepublish: 
5
+ @tower/i18n:prepublish: > @tower/i18n@1.9.0 build
6
+ @tower/i18n:prepublish: > tsc -b .
7
+ @tower/i18n:prepublish: 
8
+ @tower/i18n:prepublish: 
9
+ @tower/i18n:prepublish: > @tower/i18n@1.9.0 postbuild
10
+ @tower/i18n:prepublish: > npm run load
11
+ @tower/i18n:prepublish: 
12
+ @tower/i18n:prepublish: npm WARN ignoring workspace config at /home/cqh/workspace/smartx/tower/packages/i18n/.npmrc
13
+ @tower/i18n:prepublish: 
14
+ @tower/i18n:prepublish: > @tower/i18n@1.9.0 load
15
+ @tower/i18n:prepublish: > node ./scripts/locales-loader.js
16
+ @tower/i18n:prepublish: 
17
+ @tower/i18n:prepublish: 2 zones found, loading locales and templates into seperate zones
18
+ @tower/i18n:prepublish: npm WARN ignoring workspace config at /home/cqh/workspace/smartx/tower/packages/i18n/.npmrc
19
+ @tower/i18n:prepublish: 
20
+ @tower/i18n:prepublish: > @tower/i18n@1.9.0 typings
21
+ @tower/i18n:prepublish: > tsc --emitDeclarationOnly
22
+ @tower/i18n:prepublish: 
23
+ @tower/i18n:prepublish: $ node ../eslint-plugin-i18n/lib/generate/index.js
@@ -0,0 +1 @@
1
+ @tower/i18n:typings: cache hit, replaying output e277aab270a4094c
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as locales } from "./locales";
2
2
  export { default as parrotI18n } from "./parrotI18n";
3
+ export * from "./parrotI18n";
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as locales } from "./locales";
2
2
  export { default as parrotI18n } from "./parrotI18n";
3
+ export * from "./parrotI18n";
@@ -1,2 +1,3 @@
1
1
  declare const parrotI18n: import("i18next").i18n;
2
2
  export default parrotI18n;
3
+ export declare const initParrotI18n: () => void;
@@ -1,10 +1,34 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import i18next from "i18next";
2
13
  import locales from "./locales";
3
14
  var parrotI18n = i18next.createInstance({
4
- fallbackLng: "en",
15
+ lng: "zh-CN",
16
+ fallbackLng: "en-US",
5
17
  debug: true,
6
- });
7
- parrotI18n.init({
8
- resources: locales,
18
+ interpolation: {
19
+ prefix: "{",
20
+ suffix: "}",
21
+ },
22
+ resources: {
23
+ "en-US": {
24
+ translation: __assign({}, locales["en-US"]),
25
+ },
26
+ "zh-CN": {
27
+ translation: __assign({}, locales["zh-CN"]),
28
+ },
29
+ },
9
30
  });
10
31
  export default parrotI18n;
32
+ export var initParrotI18n = function () {
33
+ parrotI18n.init({});
34
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudtower/parrot",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "i18n modules for cloudtower sparrow and eagle",
5
5
  "keywords": [
6
6
  "i18n",
@@ -22,5 +22,5 @@
22
22
  "i18next": "^21.10.0",
23
23
  "typescript": "^4.8.4"
24
24
  },
25
- "gitHead": "426d4f1449439e6c8db0ce6342dcf1ff4a633ea1"
25
+ "gitHead": "1efe26ef3e9c65f317002b8a3da9ec7e4c3d0e40"
26
26
  }
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as locales } from "./locales";
2
2
  export { default as parrotI18n } from "./parrotI18n";
3
+ export * from "./parrotI18n";
package/src/parrotI18n.ts CHANGED
@@ -3,12 +3,29 @@ import i18next from "i18next";
3
3
  import locales from "./locales";
4
4
 
5
5
  const parrotI18n = i18next.createInstance({
6
- fallbackLng: "en",
6
+ lng: "zh-CN",
7
+ fallbackLng: "en-US",
7
8
  debug: true,
8
- });
9
-
10
- parrotI18n.init({
11
- resources: locales,
9
+ interpolation: {
10
+ prefix: "{",
11
+ suffix: "}",
12
+ },
13
+ resources: {
14
+ "en-US": {
15
+ translation: {
16
+ ...locales["en-US"],
17
+ },
18
+ },
19
+ "zh-CN": {
20
+ translation: {
21
+ ...locales["zh-CN"],
22
+ },
23
+ },
24
+ },
12
25
  });
13
26
 
14
27
  export default parrotI18n;
28
+
29
+ export const initParrotI18n = () => {
30
+ parrotI18n.init({});
31
+ };