@etsoo/appscript 1.4.2 → 1.4.3

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,227 @@
1
+ {
2
+ "accountant": "会计",
3
+ "actions": "操作",
4
+ "add": "添加",
5
+ "assignedId": "分配的编号",
6
+ "audits": "操作历史",
7
+ "author": "作者",
8
+ "authorizer": "授权人",
9
+ "applicant": "申请人",
10
+ "approve": "批准",
11
+ "back": "后退",
12
+ "cancel": "取消",
13
+ "changePassword": "修改密码",
14
+ "clickForDetails": "点击查看详情",
15
+ "city": "城市",
16
+ "clear": "清除",
17
+ "close": "关闭",
18
+ "confirm": "确认",
19
+ "confirmAction": "确定要{0}吗?",
20
+ "completeTip": "已完成 {0}",
21
+ "continentAF": "非洲",
22
+ "continentAN": "南极洲",
23
+ "continentAS": "亚洲",
24
+ "continentEU": "欧洲",
25
+ "continentNA": "北美洲",
26
+ "continentOC": "大洋洲",
27
+ "continentSA": "南美洲",
28
+ "copy": "复制",
29
+ "creation": "登记时间",
30
+ "currentPassword": "当前密码",
31
+ "currentPasswordRequired": "请输入现在使用的密码",
32
+ "currency": "币种",
33
+ "currencyAUD": "澳元",
34
+ "currencyCAD": "加元",
35
+ "currencyCNY": "人民币",
36
+ "currencyEUR": "欧元",
37
+ "currencyGBP": "英镑",
38
+ "currencyHKD": "港币",
39
+ "currencyJPY": "日元",
40
+ "currencyNZD": "纽币",
41
+ "currencySGD": "新币",
42
+ "currencyUSD": "美元",
43
+ "data": "数据",
44
+ "dataComparison": "数据对比",
45
+ "dataPrivacy": "数据隐私",
46
+ "dataPrivacyAdmin": "管理员可见",
47
+ "dataPrivacyCustomer": "客户可见",
48
+ "dataPrivacyDept": "部门可见",
49
+ "dataPrivacyInternal": "所有用户",
50
+ "dataPrivacyPrivate": "创建者私有",
51
+ "dataPrivacyPublic": "完全公开",
52
+ "default": "默认",
53
+ "delete": "删除",
54
+ "deleteConfirm": "确定要永久删除此{0}吗?",
55
+ "description": "描述",
56
+ "district": "区/县",
57
+ "done": "完成",
58
+ "download": "下载",
59
+ "dragIndicator": "拖动指示",
60
+ "edit": "修改",
61
+ "email": "电子邮箱",
62
+ "emailAddresses": "电子邮箱",
63
+ "enabled": "已启用",
64
+ "entityStatus": "状态",
65
+ "environmentChanged": "运行环境已改变,请重新登录",
66
+ "error": "错误",
67
+ "etsoo": "亿速思维",
68
+ "expiry": "到期时间",
69
+ "exportToPdf": "导出为PDF",
70
+ "failed": "操作失败",
71
+ "field": "字段",
72
+ "fileDownloaded": "文件已下载",
73
+ "help": "帮助",
74
+ "id": "编号",
75
+ "info": "信息",
76
+ "item": "项目",
77
+ "itemExists": "'{0}'已经存在",
78
+ "keywords": "关键词",
79
+ "loading": "正在加载...",
80
+ "login": "登录",
81
+ "me": "我",
82
+ "menuHome": "首页",
83
+ "message": "留言",
84
+ "mobile": "手机号码",
85
+ "mobilePhones": "手机号码",
86
+ "monthLabel": "{0}个月",
87
+ "months": [
88
+ "1月",
89
+ "2月",
90
+ "3月",
91
+ "4月",
92
+ "5月",
93
+ "6月",
94
+ "7月",
95
+ "8月",
96
+ "9月",
97
+ "10月",
98
+ "11月",
99
+ "12月"
100
+ ],
101
+ "more": "更多",
102
+ "moreTag": "({0}+)",
103
+ "name": "姓名",
104
+ "nameB": "名称",
105
+ "newPassword": "新密码",
106
+ "newPasswordRequired": "请输入新密码",
107
+ "newPasswordTip": "请设置一个和现在的密码不一样的新密码",
108
+ "newValue": "新值",
109
+ "nextStep": "下一步",
110
+ "no": "否",
111
+ "noChanges": "还没有任何修改",
112
+ "noData": "没有有效数据",
113
+ "noMatches": "没有匹配项",
114
+ "none": "暂时没有",
115
+ "noOptions": "没有选项",
116
+ "noRows": "没有数据",
117
+ "ok": "确定",
118
+ "oldValue": "旧值",
119
+ "open": "打开",
120
+ "openMenu": "打开菜单",
121
+ "operationSucceeded": "操作成功",
122
+ "others": "其他",
123
+ "pageNotFound": "找不到页面",
124
+ "passwordChangeSuccess": "密码修改成功,请重新登录",
125
+ "passwordRepeatError": "两次输入的密码不一致",
126
+ "passwordTip": "密码不能少于6个字符,且至少包含一个字母和数字",
127
+ "pinYin": "拼音首字母",
128
+ "pdf": "PDF",
129
+ "previousStep": "上一步",
130
+ "print": "打印",
131
+ "prompt": "输入",
132
+ "pullToRefresh": "下拉刷新",
133
+ "quarters": ["一季度", "二季度", "三季度", "四季度"],
134
+ "reactivateTip": "等待超时,请点击确定按钮重新激活",
135
+ "record": "记录",
136
+ "refresh": "刷新",
137
+ "refreshing": "正在刷新",
138
+ "region": "国家或地区",
139
+ "regionAU": "澳大利亚",
140
+ "regionCA": "加拿大",
141
+ "regionCN": "中国大陆",
142
+ "regionDE": "德国",
143
+ "regionFR": "法国",
144
+ "regionGB": "英国",
145
+ "regionHK": "中国香港",
146
+ "regionIE": "爱尔兰",
147
+ "regionJP": "日本",
148
+ "regionNZ": "新西兰",
149
+ "regionSG": "新加坡",
150
+ "regionUS": "美国",
151
+ "releaseToRefresh": "释放刷新",
152
+ "reloginTip": "请输入您的登录密码,登录成功后请重新提交数据",
153
+ "remove": "移除",
154
+ "renew": "续费",
155
+ "repeatPassword": "重复密码",
156
+ "repeatPasswordRequired": "请重复输入新密码",
157
+ "reports": "统计报表",
158
+ "requiredField": "'{0}'不能为空",
159
+ "resending": "重新发送",
160
+ "reset": "重置",
161
+ "rotateLeft": "左旋转90°",
162
+ "rotateRight": "右旋转90°",
163
+ "save": "保存",
164
+ "scrollToTop": "回到顶部",
165
+ "search": "搜索",
166
+ "send": "发送",
167
+ "setAsDefault": "设为默认",
168
+ "settings": "系统设置",
169
+ "showIt": "显示",
170
+ "signout": "退出",
171
+ "smartERP": "司友®云ERP",
172
+ "sortTip": "拖拽项目进行排序",
173
+ "state": "省/州",
174
+ "status": "状态",
175
+ "statusApproved": "已批准",
176
+ "statusArchived": "已归档",
177
+ "statusAudited": "已审核",
178
+ "statusCompleted": "已完成",
179
+ "statusDeleted": "已删除",
180
+ "statusDoing": "处理中",
181
+ "statusFlaged": "已标记",
182
+ "statusNormal": "正常",
183
+ "statusInactivated": "已停用",
184
+ "submit": "提交",
185
+ "success": "成功",
186
+ "taxId": "税号",
187
+ "taxIdHelp": "用于实名认证和开具发票",
188
+ "taxCABN": "营业编号(BN)",
189
+ "taxCNUSCC": "统一信用代码",
190
+ "taxHKBRN": "商业登记号码(BRN)",
191
+ "taxNZIRD": "IRD",
192
+ "taxUSEIN": "雇主识别号码(EIN)",
193
+ "timeDifferenceInvalid": "设备时间和服务器时间差为{0},超过{1}秒的限制,请调整设备时间,如果异常请告知管理员",
194
+ "title": "标题",
195
+ "tokenExpiry": "您的会话即将过期。点击 取消 按钮继续使用",
196
+ "type": "类型",
197
+ "yes": "是",
198
+ "uid": "通用标识",
199
+ "unknownError": "未知错误",
200
+ "unitJoin": "每{0}",
201
+ "unitPC": "件",
202
+ "unitSET": "套",
203
+ "unitHOUR": "小时",
204
+ "unitDAY": "天",
205
+ "unitYEAR": "年",
206
+ "unitWEEK": "周",
207
+ "unitFORTNIGHT": "两周",
208
+ "unitFOURWEEK": "四周",
209
+ "unitMONEY": "储值",
210
+ "unitMONTH": "月",
211
+ "unitBIMONTH": "两月",
212
+ "unitQUATER": "季度",
213
+ "unitHALFYEAR": "半年",
214
+ "unitGRAM": "克",
215
+ "unitJIN": "斤",
216
+ "unitKILOGRAM": "公斤",
217
+ "unitTIME": "次",
218
+ "unitTON": "吨",
219
+ "update": "更新",
220
+ "updateReady": "更新就绪",
221
+ "updateTip": "重新启动应用程序以使用最新功能",
222
+ "user": "用户",
223
+ "users": "用户",
224
+ "view": "查看",
225
+ "warning": "警告",
226
+ "welcome": "{0}, 欢迎光临!"
227
+ }
@@ -0,0 +1,226 @@
1
+ {
2
+ "accountant": "會計",
3
+ "actions": "操作",
4
+ "add": "添加",
5
+ "assignedId": "分配的編號",
6
+ "audits": "操作歷史",
7
+ "author": "作者",
8
+ "authorizer": "授權人",
9
+ "applicant": "申請人",
10
+ "approve": "批准",
11
+ "back": "後退",
12
+ "cancel": "取消",
13
+ "changePassword": "修改密碼",
14
+ "clickForDetails": "點擊查看詳情",
15
+ "city": "城市",
16
+ "clear": "清除",
17
+ "close": "關閉",
18
+ "confirm": "確認",
19
+ "confirmAction": "確定要{0}嗎?",
20
+ "completeTip": "已完成 {0}",
21
+ "continentAF": "非洲",
22
+ "continentAN": "南極洲",
23
+ "continentAS": "亞洲",
24
+ "continentEU": "歐洲",
25
+ "continentNA": "北美洲",
26
+ "continentOC": "大洋洲",
27
+ "continentSA": "南美洲",
28
+ "copy": "複製",
29
+ "creation": "登記時間",
30
+ "currentPassword": "當前密碼",
31
+ "currentPasswordRequired": "請輸入現在使用的密碼",
32
+ "currency": "幣種",
33
+ "currencyAUD": "澳元",
34
+ "currencyCAD": "加元",
35
+ "currencyCNY": "人民幣",
36
+ "currencyEUR": "歐元",
37
+ "currencyGBP": "英鎊",
38
+ "currencyHKD": "港幣",
39
+ "currencyJPY": "日元",
40
+ "currencyNZD": "紐幣",
41
+ "currencySGD": "新幣",
42
+ "currencyUSD": "美元",
43
+ "data": "數據",
44
+ "dataComparison": "數據對比",
45
+ "dataPrivacy": "數據隱私",
46
+ "dataPrivacyAdmin": "管理員可見",
47
+ "dataPrivacyCustomer": "客戶可見",
48
+ "dataPrivacyDept": "部門可見",
49
+ "dataPrivacyInternal": "所有用户",
50
+ "dataPrivacyPrivate": "創建者私有",
51
+ "dataPrivacyPublic": "完全公開",
52
+ "default": "默認",
53
+ "delete": "刪除",
54
+ "deleteConfirm": "確定要永久刪除此{0}嗎?",
55
+ "description": "描述",
56
+ "district": "區/縣",
57
+ "done": "完成",
58
+ "download": "下載",
59
+ "dragIndicator": "拖動指示",
60
+ "edit": "修改",
61
+ "email": "電子郵箱",
62
+ "emailAddresses": "電子郵箱",
63
+ "enabled": "已啟用",
64
+ "entityStatus": "狀態",
65
+ "environmentChanged": "運行環境已改變,請重新登錄",
66
+ "error": "錯誤",
67
+ "etsoo": "億速思維",
68
+ "expiry": "到期時間",
69
+ "exportToPdf": "導出為PDF",
70
+ "failed": "操作失敗",
71
+ "field": "字段",
72
+ "fileDownloaded": "文件已下載",
73
+ "help": "幫助",
74
+ "id": "編號",
75
+ "info": "信息",
76
+ "item": "項目",
77
+ "itemExists": "'{0}'已经存在",
78
+ "keywords": "關鍵詞",
79
+ "loading": "正在加載...",
80
+ "login": "登錄",
81
+ "me": "我",
82
+ "menuHome": "首頁",
83
+ "message": "留言",
84
+ "mobilePhone": "手機號碼",
85
+ "mobilePhones": "手機號碼",
86
+ "monthLabel": "{0}個月",
87
+ "months": [
88
+ "1月",
89
+ "2月",
90
+ "3月",
91
+ "4月",
92
+ "5月",
93
+ "6月",
94
+ "7月",
95
+ "8月",
96
+ "9月",
97
+ "10月",
98
+ "11月",
99
+ "12月"
100
+ ],
101
+ "more": "更多",
102
+ "moreTag": "({0}+)",
103
+ "name": "姓名",
104
+ "nameB": "名稱",
105
+ "newPassword": "新密碼",
106
+ "newPasswordRequired": "請輸入新密碼",
107
+ "newPasswordTip": "請設置一個和現在的密碼不一樣的新密碼",
108
+ "newValue": "舊值",
109
+ "nextStep": "下一步",
110
+ "no": "否",
111
+ "noChanges": "還沒有任何修改",
112
+ "noData": "沒有有效數據",
113
+ "noMatches": "没有匹配项",
114
+ "none": "暫時沒有",
115
+ "noOptions": "沒有選項",
116
+ "noRows": "沒有數據",
117
+ "ok": "確定",
118
+ "oldValue": "舊值",
119
+ "open": "打開",
120
+ "openMenu": "打開菜單",
121
+ "operationSucceeded": "操作成功",
122
+ "others": "其他",
123
+ "pageNotFound": "找不到頁面",
124
+ "passwordChangeSuccess": "密碼修改成功,請重新登錄",
125
+ "passwordRepeatError": "兩次輸入的密碼不一致",
126
+ "passwordTip": "密碼不能少於6個字符,且至少包含一個字母和數字",
127
+ "pdf": "PDF",
128
+ "pinYin": "拼音首字母",
129
+ "previousStep": "上一步",
130
+ "print": "打印",
131
+ "prompt": "輸入",
132
+ "pullToRefresh": "下拉刷新",
133
+ "quarters": ["一季度", "二季度", "三季度", "四季度"],
134
+ "reactivateTip": "等待超時,請點擊確定按鈕重新激活",
135
+ "record": "記錄",
136
+ "refresh": "刷新",
137
+ "refreshing": "正在刷新",
138
+ "region": "國家或地區",
139
+ "regionAU": "澳大利亞",
140
+ "regionCA": "加拿大",
141
+ "regionCN": "中國大陸",
142
+ "regionDE": "德國",
143
+ "regionFR": "法國",
144
+ "regionGB": "英國",
145
+ "regionHK": "中國香港",
146
+ "regionIE": "愛爾蘭",
147
+ "regionJP": "日本",
148
+ "regionNZ": "新西蘭",
149
+ "regionSG": "新加坡",
150
+ "regionUS": "美國",
151
+ "releaseToRefresh": "釋放刷新",
152
+ "reloginTip": "請輸入您的登錄密碼,登錄成功後請重新提交數據",
153
+ "remove": "移除",
154
+ "renew": "續費",
155
+ "reports": "統計報表",
156
+ "requiredField": "'{0}'不能為空",
157
+ "repeatPassword": "重複密碼",
158
+ "repeatPasswordRequired": "請重複輸入新密碼",
159
+ "resending": "重新發送",
160
+ "reset": "重置",
161
+ "rotateLeft": "左旋轉90°",
162
+ "rotateRight": "右旋轉90°",
163
+ "save": "保存",
164
+ "scrollToTop": "回到頂部",
165
+ "search": "搜索",
166
+ "send": "發送",
167
+ "setAsDefault": "設為默認",
168
+ "settings": "系統設置",
169
+ "showIt": "顯示",
170
+ "signout": "退出",
171
+ "smartERP": "司友®雲ERP",
172
+ "sortTip": "拖拽項目進行排序",
173
+ "state": "省/州",
174
+ "status": "狀態",
175
+ "statusApproved": "已批准",
176
+ "statusArchived": "已歸檔",
177
+ "statusAudited": "已審核",
178
+ "statusCompleted": "已完成",
179
+ "statusDeleted": "已刪除",
180
+ "statusDoing": "處理中",
181
+ "statusFlaged": "已標記",
182
+ "statusNormal": "正常",
183
+ "statusInactivated": "已停用",
184
+ "submit": "提交",
185
+ "success": "成功",
186
+ "taxId": "稅號",
187
+ "taxIdHelp": "用於實名認證和開具發票",
188
+ "taxCABN": "營業編號(BN)",
189
+ "taxCNUSCC": "統一信用代碼",
190
+ "taxHKBRN": "商業登記號碼(BRN)",
191
+ "taxNZIRD": "IRD",
192
+ "taxUSEIN": "雇主識別號碼(EIN)",
193
+ "timeDifferenceInvalid": "設備時間和服務器時間差為{0},超過{1}秒的限制,請調整設備時間,如果異常請告知管理員",
194
+ "title": "標題",
195
+ "tokenExpiry": "您的會話即將過期。點擊 取消 按鈕繼續使用",
196
+ "type": "類型",
197
+ "yes": "是",
198
+ "uid": "通用標識",
199
+ "unknownError": "未知錯誤",
200
+ "unitJoin": "每{0}",
201
+ "unitPC": "件",
202
+ "unitSET": "套",
203
+ "unitHOUR": "小時",
204
+ "unitDAY": "天",
205
+ "unitYEAR": "年",
206
+ "unitWEEK": "週",
207
+ "unitFORTNIGHT": "兩週",
208
+ "unitFOURWEEK": "四周",
209
+ "unitMONEY": "儲值",
210
+ "unitMONTH": "月",
211
+ "unitBIMONTH": "兩月",
212
+ "unitQUATER": "季度",
213
+ "unitHALFYEAR": "半年",
214
+ "unitGRAM": "克",
215
+ "unitJIN": "斤",
216
+ "unitKILOGRAM": "公斤",
217
+ "unitTIME": "次",
218
+ "update": "更新",
219
+ "updateReady": "更新就緒",
220
+ "updateTip": "重新啟動應用程序以使用最新功能",
221
+ "user": "用戶",
222
+ "users": "用戶",
223
+ "view": "查看",
224
+ "warning": "警告",
225
+ "welcome": "{0}, 歡迎光臨!"
226
+ }
@@ -1,7 +1,7 @@
1
- import { i18nResource } from './i18nResources';
1
+ import { DataTypes } from '@etsoo/shared';
2
2
  /**
3
3
  * Get zh-Hans neutral cultrue
4
4
  * @param localResources Local resources
5
5
  * @returns Full culture
6
6
  */
7
- export declare const zhHans: (resources: i18nResource) => import("@etsoo/shared").DataTypes.CultureDefinition<import("@etsoo/shared").DataTypes.StringRecord>;
7
+ export declare const zhHans: (resources: object | (() => Promise<object>)) => DataTypes.CultureDefinition<DataTypes.StringRecord>;
@@ -1,8 +1,20 @@
1
1
  import { DomUtils } from '@etsoo/shared';
2
- import { i18nResourceCreator } from './i18nResources';
3
2
  /**
4
3
  * Get zh-Hans neutral cultrue
5
4
  * @param localResources Local resources
6
5
  * @returns Full culture
7
6
  */
8
- export const zhHans = (resources) => DomUtils.en(i18nResourceCreator('./zh-Hans.json', resources));
7
+ export const zhHans = (resources) => DomUtils.en(async () => {
8
+ const [r1, r2] = await Promise.all([
9
+ import('./zh-Hans.json'),
10
+ new Promise((resolve) => {
11
+ if (typeof resources === 'object') {
12
+ resolve(resources);
13
+ }
14
+ else {
15
+ resources().then((result) => resolve(result));
16
+ }
17
+ })
18
+ ]);
19
+ return { ...r1, ...r2 };
20
+ });
@@ -1,7 +1,7 @@
1
- import { i18nResource } from './i18nResources';
1
+ import { DataTypes } from '@etsoo/shared';
2
2
  /**
3
3
  * Get zh-Hant neutral cultrue
4
4
  * @param localResources Local resources
5
5
  * @returns Full culture
6
6
  */
7
- export declare const zhHant: (resources: i18nResource) => import("@etsoo/shared").DataTypes.CultureDefinition<import("@etsoo/shared").DataTypes.StringRecord>;
7
+ export declare const zhHant: (resources: object | (() => Promise<object>)) => DataTypes.CultureDefinition<DataTypes.StringRecord>;
@@ -1,8 +1,20 @@
1
1
  import { DomUtils } from '@etsoo/shared';
2
- import { i18nResourceCreator } from './i18nResources';
3
2
  /**
4
3
  * Get zh-Hant neutral cultrue
5
4
  * @param localResources Local resources
6
5
  * @returns Full culture
7
6
  */
8
- export const zhHant = (resources) => DomUtils.en(i18nResourceCreator('./zh-Hant.json', resources));
7
+ export const zhHant = (resources) => DomUtils.en(async () => {
8
+ const [r1, r2] = await Promise.all([
9
+ import('./zh-Hant.json'),
10
+ new Promise((resolve) => {
11
+ if (typeof resources === 'object') {
12
+ resolve(resources);
13
+ }
14
+ else {
15
+ resources().then((result) => resolve(result));
16
+ }
17
+ })
18
+ ]);
19
+ return { ...r1, ...r2 };
20
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
package/src/i18n/en.ts CHANGED
@@ -1,10 +1,21 @@
1
- import { DomUtils } from '@etsoo/shared';
2
- import { i18nResource, i18nResourceCreator } from './i18nResources';
1
+ import { DataTypes, DomUtils } from '@etsoo/shared';
3
2
 
4
3
  /**
5
4
  * Get en neutral culture
6
5
  * @param localResources Local resources
7
6
  * @returns Full culture
8
7
  */
9
- export const en = (resources: i18nResource) =>
10
- DomUtils.en(i18nResourceCreator('./en.json', resources));
8
+ export const en = (resources: object | (() => Promise<object>)) =>
9
+ DomUtils.en(async () => {
10
+ const [r1, r2] = await Promise.all([
11
+ import('./en.json'),
12
+ new Promise<object>((resolve) => {
13
+ if (typeof resources === 'object') {
14
+ resolve(resources);
15
+ } else {
16
+ resources().then((result) => resolve(result));
17
+ }
18
+ })
19
+ ]);
20
+ return { ...r1, ...r2 } as DataTypes.StringRecord;
21
+ });
@@ -1,10 +1,21 @@
1
- import { DomUtils } from '@etsoo/shared';
2
- import { i18nResource, i18nResourceCreator } from './i18nResources';
1
+ import { DataTypes, DomUtils } from '@etsoo/shared';
3
2
 
4
3
  /**
5
4
  * Get zh-Hans neutral cultrue
6
5
  * @param localResources Local resources
7
6
  * @returns Full culture
8
7
  */
9
- export const zhHans = (resources: i18nResource) =>
10
- DomUtils.en(i18nResourceCreator('./zh-Hans.json', resources));
8
+ export const zhHans = (resources: object | (() => Promise<object>)) =>
9
+ DomUtils.en(async () => {
10
+ const [r1, r2] = await Promise.all([
11
+ import('./zh-Hans.json'),
12
+ new Promise<object>((resolve) => {
13
+ if (typeof resources === 'object') {
14
+ resolve(resources);
15
+ } else {
16
+ resources().then((result) => resolve(result));
17
+ }
18
+ })
19
+ ]);
20
+ return { ...r1, ...r2 } as DataTypes.StringRecord;
21
+ });
@@ -1,10 +1,21 @@
1
- import { DomUtils } from '@etsoo/shared';
2
- import { i18nResource, i18nResourceCreator } from './i18nResources';
1
+ import { DataTypes, DomUtils } from '@etsoo/shared';
3
2
 
4
3
  /**
5
4
  * Get zh-Hant neutral cultrue
6
5
  * @param localResources Local resources
7
6
  * @returns Full culture
8
7
  */
9
- export const zhHant = (resources: i18nResource) =>
10
- DomUtils.en(i18nResourceCreator('./zh-Hant.json', resources));
8
+ export const zhHant = (resources: object | (() => Promise<object>)) =>
9
+ DomUtils.en(async () => {
10
+ const [r1, r2] = await Promise.all([
11
+ import('./zh-Hant.json'),
12
+ new Promise<object>((resolve) => {
13
+ if (typeof resources === 'object') {
14
+ resolve(resources);
15
+ } else {
16
+ resources().then((result) => resolve(result));
17
+ }
18
+ })
19
+ ]);
20
+ return { ...r1, ...r2 } as DataTypes.StringRecord;
21
+ });
@@ -1,3 +0,0 @@
1
- import { DataTypes } from '@etsoo/shared';
2
- export type i18nResource = object | (() => Promise<object>);
3
- export declare function i18nResourceCreator(file: string, resources: i18nResource): () => Promise<DataTypes.StringRecord>;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.i18nResourceCreator = void 0;
27
- function i18nResourceCreator(file, resources) {
28
- return async () => {
29
- const [r1, r2] = await Promise.all([
30
- Promise.resolve(`${file}`).then(s => __importStar(require(s))),
31
- new Promise((resolve) => {
32
- if (typeof resources === 'object') {
33
- resolve(resources);
34
- }
35
- else {
36
- resources().then((result) => resolve(result));
37
- }
38
- })
39
- ]);
40
- return { ...r1, ...r2 };
41
- };
42
- }
43
- exports.i18nResourceCreator = i18nResourceCreator;
@@ -1,3 +0,0 @@
1
- import { DataTypes } from '@etsoo/shared';
2
- export type i18nResource = object | (() => Promise<object>);
3
- export declare function i18nResourceCreator(file: string, resources: i18nResource): () => Promise<DataTypes.StringRecord>;