@cloudtower/parrot 0.17.9 → 0.17.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudtower/parrot",
3
- "version": "0.17.9",
3
+ "version": "0.17.10",
4
4
  "description": "i18n modules for cloudtower sparrow and eagle",
5
5
  "keywords": [
6
6
  "i18n",
@@ -17,10 +17,16 @@
17
17
  "generate:reexport": "node --loader ts-node/esm tools/index.mts",
18
18
  "lint": "eslint src --ext .ts --quiet"
19
19
  },
20
+ "dependencies": {
21
+ "i18next": "21.10.0",
22
+ "lodash.merge": "^4.6.2"
23
+ },
20
24
  "devDependencies": {
25
+ "@rollup/plugin-json": "^6.0.0",
26
+ "@types/lodash.merge": "^4.6.7",
21
27
  "ejs": "^3.1.8",
22
28
  "i18next": "^21.10.0",
23
29
  "typescript": "^4.8.4"
24
30
  },
25
- "gitHead": "1a215b9fe982fbf09abf3506572d245548e004e8"
31
+ "gitHead": "96fce0747611802294092922e6f034c612b82ef4"
26
32
  }
package/src/parrotI18n.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import i18next, { Callback, InitOptions } from "i18next";
2
+ import merge from "lodash.merge";
2
3
 
3
4
  import locales from "./locales";
4
5
 
5
- const parrotI18n = i18next.createInstance({
6
+ const defaultOptions = {
6
7
  lng: "zh-CN",
7
8
  fallbackLng: "en-US",
8
9
  interpolation: {
@@ -21,13 +22,15 @@ const parrotI18n = i18next.createInstance({
21
22
  },
22
23
  },
23
24
  },
24
- });
25
+ };
26
+
27
+ const parrotI18n = i18next.createInstance(defaultOptions);
25
28
 
26
29
  export default parrotI18n;
27
30
 
28
31
  export const initParrotI18n = (
29
- options: InitOptions,
32
+ options?: InitOptions,
30
33
  callback?: Callback | undefined
31
34
  ) => {
32
- parrotI18n.init(options, callback);
35
+ parrotI18n.init(merge(defaultOptions, options), callback);
33
36
  };
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export { default as locales } from "./locales";
2
- export { default as parrotI18n } from "./parrotI18n";
3
- export * from "./parrotI18n";
package/dist/index.js DELETED
@@ -1,3 +0,0 @@
1
- export { default as locales } from "./locales";
2
- export { default as parrotI18n } from "./parrotI18n";
3
- export * from "./parrotI18n";
@@ -1,27 +0,0 @@
1
- {
2
- "_action_": "Action",
3
- "action": "Action",
4
- "all": "All",
5
- "cancel": "Cancel",
6
- "clear_query": "Clear the filter criteria",
7
- "close": "Close",
8
- "contains": "Contains",
9
- "confirm": "Confirm",
10
- "empty": "No ",
11
- "enable": "Enable",
12
- "error": "Error",
13
- "next_step": "Next",
14
- "not_contains": "Not Contains",
15
- "not_enable": "Not enabled",
16
- "prev_step": "Previous",
17
- "io": "Total I/O",
18
- "load_failed": "Failed to load",
19
- "param": "Parameter",
20
- "no": "No",
21
- "message": "Message",
22
- "architecture": "CPU Architecture",
23
- "calculation": "Computing",
24
- "on": "On",
25
- "error_message": "Error Message",
26
- "retry": "Retry"
27
- }
@@ -1,15 +0,0 @@
1
- {
2
- "contains": "Contains",
3
- "custom_column": "Customize Columns & Order",
4
- "in": "belongs to",
5
- "not": "Not",
6
- "not_contains": "Not Contains",
7
- "or": "or",
8
- "previous_items": "Previous {size} items",
9
- "next_items": "Next {size} items",
10
- "push_to": "Jump to",
11
- "pagination_range": "Item {range1} – {range2}",
12
- "pagination_total": "Item {range1} – {range2}, {total} in total",
13
- "unknow_error": "Unknown error",
14
- "to": "to"
15
- }
@@ -1,50 +0,0 @@
1
- declare const locale: {
2
- common: {
3
- _action_: string;
4
- action: string;
5
- all: string;
6
- cancel: string;
7
- clear_query: string;
8
- close: string;
9
- contains: string;
10
- confirm: string;
11
- empty: string;
12
- enable: string;
13
- error: string;
14
- next_step: string;
15
- not_contains: string;
16
- not_enable: string;
17
- prev_step: string;
18
- io: string;
19
- load_failed: string;
20
- param: string;
21
- no: string;
22
- message: string;
23
- architecture: string;
24
- calculation: string;
25
- on: string;
26
- error_message: string;
27
- retry: string;
28
- };
29
- components: {
30
- contains: string;
31
- custom_column: string;
32
- in: string;
33
- not: string;
34
- not_contains: string;
35
- or: string;
36
- previous_items: string;
37
- next_items: string;
38
- push_to: string;
39
- pagination_range: string;
40
- pagination_total: string;
41
- unknow_error: string;
42
- to: string;
43
- };
44
- metric: {
45
- current: string;
46
- empty: string;
47
- max: string;
48
- };
49
- };
50
- export default locale;
@@ -1,9 +0,0 @@
1
- import common from "./common.json";
2
- import components from "./components.json";
3
- import metric from "./metric.json";
4
- var locale = {
5
- common: common,
6
- components: components,
7
- metric: metric,
8
- };
9
- export default locale;
@@ -1,5 +0,0 @@
1
- {
2
- "current": "Current value",
3
- "empty": "No data in this time range",
4
- "max": "Max"
5
- }
@@ -1,101 +0,0 @@
1
- declare const locales: {
2
- "en-US": {
3
- common: {
4
- _action_: string;
5
- action: string;
6
- all: string;
7
- cancel: string;
8
- clear_query: string;
9
- close: string;
10
- contains: string;
11
- confirm: string;
12
- empty: string;
13
- enable: string;
14
- error: string;
15
- next_step: string;
16
- not_contains: string;
17
- not_enable: string;
18
- prev_step: string;
19
- io: string;
20
- load_failed: string;
21
- param: string;
22
- no: string;
23
- message: string;
24
- architecture: string;
25
- calculation: string;
26
- on: string;
27
- error_message: string;
28
- retry: string;
29
- };
30
- components: {
31
- contains: string;
32
- custom_column: string;
33
- in: string;
34
- not: string;
35
- not_contains: string;
36
- or: string;
37
- previous_items: string;
38
- next_items: string;
39
- push_to: string;
40
- pagination_range: string;
41
- pagination_total: string;
42
- unknow_error: string;
43
- to: string;
44
- };
45
- metric: {
46
- current: string;
47
- empty: string;
48
- max: string;
49
- };
50
- };
51
- "zh-CN": {
52
- common: {
53
- _action_: string;
54
- action: string;
55
- all: string;
56
- cancel: string;
57
- clear_query: string;
58
- close: string;
59
- contains: string;
60
- confirm: string;
61
- empty: string;
62
- enable: string;
63
- error: string;
64
- next_step: string;
65
- not_contains: string;
66
- not_enable: string;
67
- prev_step: string;
68
- io: string;
69
- load_failed: string;
70
- param: string;
71
- no: string;
72
- message: string;
73
- architecture: string;
74
- calculation: string;
75
- on: string;
76
- error_message: string;
77
- retry: string;
78
- };
79
- components: {
80
- contains: string;
81
- custom_column: string;
82
- in: string;
83
- not: string;
84
- not_contains: string;
85
- or: string;
86
- previous_items: string;
87
- next_items: string;
88
- push_to: string;
89
- pagination_range: string;
90
- pagination_total: string;
91
- unknow_error: string;
92
- to: string;
93
- };
94
- metric: {
95
- current: string;
96
- empty: string;
97
- max: string;
98
- };
99
- };
100
- };
101
- export default locales;
@@ -1,7 +0,0 @@
1
- import enUS from "./en-US";
2
- import zhCN from "./zh-CN";
3
- var locales = {
4
- "en-US": enUS,
5
- "zh-CN": zhCN,
6
- };
7
- export default locales;
@@ -1,27 +0,0 @@
1
- {
2
- "_action_": "操作",
3
- "action": "操作",
4
- "all": "全部",
5
- "cancel": "取消",
6
- "clear_query": "清空筛选条件",
7
- "close": "关闭",
8
- "contains": "包含",
9
- "confirm": "确定",
10
- "empty": "无",
11
- "enable": "启用",
12
- "error": "错误",
13
- "next_step": "下一步",
14
- "not_contains": "不包含",
15
- "not_enable": "不启用",
16
- "prev_step": "上一步",
17
- "io": "I/O 总数",
18
- "load_failed": "加载失败",
19
- "param": "参数",
20
- "no": "否",
21
- "message": "信息",
22
- "architecture": "CPU 架构",
23
- "calculation": "计算中",
24
- "on": "开启",
25
- "error_message": "错误信息",
26
- "retry": "重试"
27
- }
@@ -1,15 +0,0 @@
1
- {
2
- "contains": "包含",
3
- "custom_column": "自定义列的展示和顺序",
4
- "in": "属于",
5
- "not": "不为",
6
- "not_contains": "不包含",
7
- "or": "或",
8
- "previous_items": "前 {size} 项",
9
- "next_items": "后 {size} 项",
10
- "push_to": "跳转至",
11
- "pagination_range": "第 {range1} – {range2} 项",
12
- "pagination_total": "第 {range1} – {range2} 项,共 {total} 项",
13
- "unknow_error": "未知错误",
14
- "to": "至"
15
- }
@@ -1,50 +0,0 @@
1
- declare const locale: {
2
- common: {
3
- _action_: string;
4
- action: string;
5
- all: string;
6
- cancel: string;
7
- clear_query: string;
8
- close: string;
9
- contains: string;
10
- confirm: string;
11
- empty: string;
12
- enable: string;
13
- error: string;
14
- next_step: string;
15
- not_contains: string;
16
- not_enable: string;
17
- prev_step: string;
18
- io: string;
19
- load_failed: string;
20
- param: string;
21
- no: string;
22
- message: string;
23
- architecture: string;
24
- calculation: string;
25
- on: string;
26
- error_message: string;
27
- retry: string;
28
- };
29
- components: {
30
- contains: string;
31
- custom_column: string;
32
- in: string;
33
- not: string;
34
- not_contains: string;
35
- or: string;
36
- previous_items: string;
37
- next_items: string;
38
- push_to: string;
39
- pagination_range: string;
40
- pagination_total: string;
41
- unknow_error: string;
42
- to: string;
43
- };
44
- metric: {
45
- current: string;
46
- empty: string;
47
- max: string;
48
- };
49
- };
50
- export default locale;
@@ -1,9 +0,0 @@
1
- import common from "./common.json";
2
- import components from "./components.json";
3
- import metric from "./metric.json";
4
- var locale = {
5
- common: common,
6
- components: components,
7
- metric: metric,
8
- };
9
- export default locale;
@@ -1,5 +0,0 @@
1
- {
2
- "current": "当前值",
3
- "empty": "该时间范围内没有数据",
4
- "max": "最大值"
5
- }
@@ -1,4 +0,0 @@
1
- import { Callback, InitOptions } from "i18next";
2
- declare const parrotI18n: import("i18next").i18n;
3
- export default parrotI18n;
4
- export declare const initParrotI18n: (options: InitOptions, callback?: Callback | undefined) => void;
@@ -1,33 +0,0 @@
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
- };
12
- import i18next from "i18next";
13
- import locales from "./locales";
14
- var parrotI18n = i18next.createInstance({
15
- lng: "zh-CN",
16
- fallbackLng: "en-US",
17
- interpolation: {
18
- prefix: "{",
19
- suffix: "}",
20
- },
21
- resources: {
22
- "en-US": {
23
- translation: __assign({}, locales["en-US"]),
24
- },
25
- "zh-CN": {
26
- translation: __assign({}, locales["zh-CN"]),
27
- },
28
- },
29
- });
30
- export default parrotI18n;
31
- export var initParrotI18n = function (options, callback) {
32
- parrotI18n.init(options, callback);
33
- };