@prosopo/locale 3.6.2 → 3.7.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.
Files changed (106) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +3 -6
  2. package/.turbo/turbo-build$colon$tsc.log +6 -9
  3. package/.turbo/turbo-build.log +5 -11
  4. package/CHANGELOG.md +16 -0
  5. package/LICENSE +201 -0
  6. package/dist/cjs/locales/en/translation.cjs +2 -1
  7. package/dist/locales/ar/translation.json +2 -1
  8. package/dist/locales/az/translation.json +2 -1
  9. package/dist/locales/cs/translation.json +2 -1
  10. package/dist/locales/de/translation.json +2 -1
  11. package/dist/locales/el/translation.json +2 -1
  12. package/dist/locales/en/translation.js +2 -1
  13. package/dist/locales/en/translation.json +2 -1
  14. package/dist/locales/es/translation.json +2 -1
  15. package/dist/locales/fi/translation.json +2 -1
  16. package/dist/locales/fr/translation.json +2 -1
  17. package/dist/locales/hi/translation.json +2 -1
  18. package/dist/locales/hu/translation.json +2 -1
  19. package/dist/locales/id/translation.json +2 -1
  20. package/dist/locales/it/translation.json +2 -1
  21. package/dist/locales/ja/translation.json +2 -1
  22. package/dist/locales/jv/translation.json +2 -1
  23. package/dist/locales/ko/translation.json +2 -1
  24. package/dist/locales/ml/translation.json +2 -1
  25. package/dist/locales/ms/translation.json +2 -1
  26. package/dist/locales/nl/translation.json +2 -1
  27. package/dist/locales/no/translation.json +2 -1
  28. package/dist/locales/pl/translation.json +2 -1
  29. package/dist/locales/pt/translation.json +2 -1
  30. package/dist/locales/pt-BR/translation.json +2 -1
  31. package/dist/locales/ro/translation.json +2 -1
  32. package/dist/locales/ru/translation.json +2 -1
  33. package/dist/locales/sr/translation.json +2 -1
  34. package/dist/locales/sv/translation.json +2 -1
  35. package/dist/locales/th/translation.json +2 -1
  36. package/dist/locales/tr/translation.json +2 -1
  37. package/dist/locales/uk/translation.json +2 -1
  38. package/dist/locales/vi/translation.json +2 -1
  39. package/dist/locales/zh-CN/translation.json +2 -1
  40. package/package.json +65 -66
  41. package/src/direction.ts +0 -36
  42. package/src/errorMessage.ts +0 -37
  43. package/src/i18SharedOptions.ts +0 -29
  44. package/src/i18nBackend.ts +0 -69
  45. package/src/i18nFrontend.ts +0 -267
  46. package/src/i18nMiddleware.ts +0 -35
  47. package/src/index.ts +0 -33
  48. package/src/loadI18next.ts +0 -136
  49. package/src/locales/ar/translation.json +0 -493
  50. package/src/locales/az/translation.json +0 -493
  51. package/src/locales/cs/translation.json +0 -493
  52. package/src/locales/de/translation.json +0 -493
  53. package/src/locales/el/translation.json +0 -493
  54. package/src/locales/en/translation.json +0 -493
  55. package/src/locales/es/translation.json +0 -493
  56. package/src/locales/fi/translation.json +0 -493
  57. package/src/locales/fr/translation.json +0 -493
  58. package/src/locales/hi/translation.json +0 -493
  59. package/src/locales/hu/translation.json +0 -493
  60. package/src/locales/id/translation.json +0 -493
  61. package/src/locales/it/translation.json +0 -493
  62. package/src/locales/ja/translation.json +0 -493
  63. package/src/locales/jv/translation.json +0 -493
  64. package/src/locales/ko/translation.json +0 -493
  65. package/src/locales/ml/translation.json +0 -493
  66. package/src/locales/ms/translation.json +0 -493
  67. package/src/locales/nl/translation.json +0 -493
  68. package/src/locales/no/translation.json +0 -493
  69. package/src/locales/pl/translation.json +0 -493
  70. package/src/locales/pt/translation.json +0 -493
  71. package/src/locales/pt-BR/translation.json +0 -493
  72. package/src/locales/ro/translation.json +0 -493
  73. package/src/locales/ru/translation.json +0 -493
  74. package/src/locales/sr/translation.json +0 -493
  75. package/src/locales/sv/translation.json +0 -493
  76. package/src/locales/th/translation.json +0 -493
  77. package/src/locales/tr/translation.json +0 -493
  78. package/src/locales/uk/translation.json +0 -493
  79. package/src/locales/vi/translation.json +0 -493
  80. package/src/locales/zh-CN/translation.json +0 -493
  81. package/src/process.ts +0 -29
  82. package/src/tests/direction.unit.test.ts +0 -52
  83. package/src/tests/errorMessage.unit.test.ts +0 -84
  84. package/src/tests/i18SharedOptions.unit.test.ts +0 -139
  85. package/src/tests/i18nBackend.unit.test.ts +0 -241
  86. package/src/tests/i18nFrontend.unit.test.ts +0 -404
  87. package/src/tests/i18nMiddleware.unit.test.ts +0 -159
  88. package/src/tests/loadI18next.unit.test.ts +0 -443
  89. package/src/tests/locale.test-d.ts +0 -184
  90. package/src/tests/localePlaceholders.unit.test.ts +0 -81
  91. package/src/tests/locales.unit.test.ts +0 -79
  92. package/src/tests/process.unit.test.ts +0 -33
  93. package/src/tests/thrownErrorKeys.unit.test.ts +0 -91
  94. package/src/tests/translationKey.unit.test.ts +0 -155
  95. package/src/tests/translations.unit.test.ts +0 -97
  96. package/src/tests/translator.unit.test.ts +0 -213
  97. package/src/tests/util.unit.test.ts +0 -102
  98. package/src/translationKey.ts +0 -73
  99. package/src/translations.ts +0 -55
  100. package/src/translator.ts +0 -69
  101. package/src/types.ts +0 -47
  102. package/src/util.ts +0 -25
  103. package/tsconfig.cjs.json +0 -21
  104. package/tsconfig.json +0 -22
  105. package/tsconfig.tsbuildinfo +0 -1
  106. package/tsconfig.types.json +0 -9
@@ -1,493 +0,0 @@
1
- {
2
- "GENERAL": {
3
- "MISSING_SECRET_KEY": "缺少密钥",
4
- "SITE_KEY_NOT_FOUND": "站点密钥未找到",
5
- "JSON_LOAD_FAILED": "无法加载JSON文件",
6
- "MNEMONIC_UNDEFINED": "未定义助记词。请在环境变量中设置助记词",
7
- "NO_MNEMONIC_OR_SEED": "没有提供助记词或种子",
8
- "CANT_FIND_KEYRINGPAIR": "找不到{{address}}的密钥对",
9
- "ENVIRONMENT_NOT_READY": "环境尚未准备好",
10
- "INVALID_SIGNATURE": "无效的签名",
11
- "SITE_KEY_MISSING": "缺少SITE KEY",
12
- "ACCOUNT_NOT_FOUND": "找不到帐户",
13
- "INVALID_TIMESTAMP": "无效的时间戳",
14
- "MISSING_AUTH_HEADER": "缺少授权标头",
15
- "INVALID_JWT": "无效的 JWT"
16
- },
17
- "API": {
18
- "INSUFFICIENT_PERMISSIONS": "权限不足,无法执行此操作",
19
- "MISSING_QUERY_PARAMETERS": "缺少查询参数",
20
- "MISSING_AUTHORIZATION_HEADER": "缺少授权头",
21
- "TIMESTAMP_TOO_OLD": "时间戳过旧",
22
- "FAILED_IP_VALIDATION": "IP验证失败",
23
- "ACCESS_POLICY_BLOCK": "访问被策略阻止",
24
- "CLIENT_SESSION_MISMATCH": "会话不匹配。此验证码不是在本会话中完成的。",
25
- "FORBIDDEN": "禁止",
26
- "PROVIDER_VERIFY_FAILED": "提供商验证失败",
27
- "SPAM_EMAIL_DOMAIN": "不允许此电子邮件域名",
28
- "UNAUTHORIZED": "未授权",
29
- "MISSING_BODY": "缺少主体",
30
- "NO_CONTENT_TYPE_HEADER": "没有内容类型标头。假定为JSON编码主体,但无法解析。",
31
- "CAPTCHA_FAILED": "您回答了一个或多个验证码不正确。请重试",
32
- "CAPTCHA_PASSED": "您正确回答了验证码",
33
- "BAD_REQUEST": "错误的请求",
34
- "USER_VERIFIED": "用户已验证",
35
- "USER_NOT_VERIFIED": "用户未验证",
36
- "USER_NOT_VERIFIED_TIME_EXPIRED": "用户未验证。验证码解决方案已过期。",
37
- "USER_NOT_VERIFIED_NO_SOLUTION": "用户未验证。找不到验证码解决方案。",
38
- "USER_ALREADY_VERIFIED": "此解决方案已经验证。用户应完成新的验证码。",
39
- "UNKNOWN": "未知API错误",
40
- "SITE_KEY_NOT_REGISTERED": "站点密钥未注册",
41
- "INCORRECT_CAPTCHA_TYPE": "CAPTCHA类型不正确",
42
- "INVALID_SITE_KEY": "无效的站点密钥",
43
- "UNAUTHORIZED_ORIGIN_URL": "未授权的来源URL",
44
- "INVALID_IP": "无效的IP",
45
- "INVALID_URL": "无效的URL",
46
- "INVALID_BODY": "无效的主体",
47
- "PARSE_ERROR": "解析请求时出错",
48
- "SPAM_EMAIL_RULE": "电子邮件地址被垃圾邮件过滤规则拦截",
49
- "SPAM_EMAIL_COUNT_EXCEEDED": "该电子邮件地址提交次数过多",
50
- "VPN_BLOCKED": "此网站不允许来自VPN连接的请求",
51
- "PROXY_BLOCKED": "此网站不允许来自代理服务器的请求",
52
- "TOO_MANY_LOCALHOST": "此站点密钥来自 localhost 的 CAPTCHA 请求过多",
53
- "TOR_BLOCKED": "此网站不允许来自Tor出口节点的请求",
54
- "ABUSER_BLOCKED": "此网站不允许来自被标记为滥用的网络的请求",
55
- "DATACENTER_BLOCKED": "此网站不允许来自数据中心IP地址的请求",
56
- "MOBILE_BLOCKED": "此网站不允许来自移动网络连接的请求",
57
- "SATELLITE_BLOCKED": "此网站不允许来自卫星连接的请求",
58
- "CRAWLER_BLOCKED": "此网站不允许来自已知爬虫的请求",
59
- "DISALLOWED_WEBVIEW": "此站点不允许来自应用内浏览器 (WebView) 的请求",
60
- "INTERNAL_SERVER_ERROR": "服务器内部错误"
61
- },
62
- "PORTAL": {
63
- "CANNOT_MODIFY_OWNER_USER": "无法修改所有者用户",
64
- "CANNOT_DELETE_OWN_USER": "无法删除您自己的帐户",
65
- "CANNOT_DELETE_LAST_USER": "无法删除最后一个用户",
66
- "USER_ALREADY_EXISTS": "用户已经存在",
67
- "NO_SUGGESTIONS_FOUND": "未找到建议",
68
- "CANNOT_DEACTIVATE_LAST_SITE": "无法停用最后一个活动站点",
69
- "DUPLICATE_SITE_NAME": "已存在同名站点",
70
- "INVALID_SITE_NAME": "站点名称只能包含字母、数字、连字符和下划线"
71
- },
72
- "TARGET": {
73
- "airplanes": "飞机",
74
- "american-flag": "美国国旗",
75
- "bonsai": "盆景",
76
- "buddha": "佛陀",
77
- "cannon": "大炮",
78
- "coffee-mug": "咖啡杯",
79
- "flashlight": "手电筒",
80
- "floppy-disk": "软盘",
81
- "football-helmet": "橄榄球头盔",
82
- "grand-piano": "大钢琴",
83
- "jesus-christ": "耶稣基督",
84
- "knife": "刀",
85
- "leopards": "豹子",
86
- "sword": "剑",
87
- "syringe": "注射器",
88
- "tambourine": "铃鼓",
89
- "bird": "鸟",
90
- "bus": "公共汽车",
91
- "car": "轿车",
92
- "cat": "猫",
93
- "deer": "鹿",
94
- "dog": "狗",
95
- "horse": "马",
96
- "plane": "飞机",
97
- "train": "火车",
98
- "animals": "动物",
99
- "antelope": "羚羊",
100
- "backpack": "背包",
101
- "badger": "獾",
102
- "baseball-bat": "棒球棒",
103
- "baseball-glove": "棒球手套",
104
- "basketball-hoop": "篮球架",
105
- "bat": "蝙蝠",
106
- "bathtub": "浴缸",
107
- "bear": "熊",
108
- "bee": "蜜蜂",
109
- "beer-mug": "啤酒杯",
110
- "beetle": "甲虫",
111
- "billiards": "台球",
112
- "binoculars": "双筒望远镜",
113
- "birdbath": "鸟浴盆",
114
- "bison": "野牛",
115
- "blimp": "飞艇",
116
- "boar": "野猪",
117
- "bonsai-tree": "盆景树",
118
- "boom-box": "音乐播放器",
119
- "bowling-ball": "保龄球",
120
- "bowling-pin": "保龄球瓶",
121
- "boxing-glove": "拳击手套",
122
- "breadmaker": "面包机",
123
- "bulldozer": "推土机",
124
- "butterfly": "蝴蝶",
125
- "cactus": "仙人掌",
126
- "cake": "蛋糕",
127
- "calculator": "计算器",
128
- "camel": "骆驼",
129
- "canoe": "独木舟",
130
- "car-tire": "汽车轮胎",
131
- "caterpillar": "毛毛虫",
132
- "cd": "光盘",
133
- "cereal-box": "谷物盒",
134
- "chandelier": "吊灯",
135
- "chess-board": "国际象棋棋盘",
136
- "chimpanzee": "黑猩猩",
137
- "chopsticks": "筷子",
138
- "cockroach": "蟑螂",
139
- "coffin": "棺材",
140
- "coin": "硬币",
141
- "comet": "彗星",
142
- "computer-keyboard": "计算机键盘",
143
- "computer-monitor": "显示器",
144
- "computer-mouse": "鼠标",
145
- "conch": "海螺",
146
- "cormorant": "鸬鹚",
147
- "covered-wagon": "有盖大篷车",
148
- "cow": "奶牛",
149
- "cowboy-hat": "牛仔帽",
150
- "coyote": "coyote",
151
- "crab": "螃蟹",
152
- "crow": "乌鸦",
153
- "desk-globe": "地球仪",
154
- "diamond-ring": "钻戒",
155
- "dice": "骰子",
156
- "dolphin": "海豚",
157
- "donkey": "驴",
158
- "doorknob": "门把手",
159
- "dragonfly": "蜻蜓",
160
- "drinking-straw": "吸管",
161
- "duck": "鸭子",
162
- "dumb-bell": "哑铃",
163
- "eagle": "老鹰",
164
- "eiffel-tower": "埃菲尔铁塔",
165
- "electric-guitar": "电吉他",
166
- "elephant": "大象",
167
- "elk": "麋鹿",
168
- "eyeglasses": "眼镜",
169
- "fern": "蕨类植物",
170
- "fire-extinguisher": "灭火器",
171
- "fire-hydrant": "消防栓",
172
- "fire-truck": "消防车",
173
- "fireworks": "烟花",
174
- "flamingo": "火烈鸟",
175
- "fly": "苍蝇",
176
- "fox": "狐狸",
177
- "french-horn": "法国号",
178
- "fried-egg": "煎蛋",
179
- "frisbee": "飞盘",
180
- "frog": "青蛙",
181
- "frying-pan": "平底锅",
182
- "galaxy": "星系",
183
- "gas-pump": "加油站",
184
- "giraffe": "长颈鹿",
185
- "goat": "山羊",
186
- "golden-gate-bridge": "金门大桥",
187
- "goldfish": "金鱼",
188
- "golf-ball": "高尔夫球",
189
- "goose": "鹅",
190
- "gorilla": "大猩猩",
191
- "grapes": "葡萄",
192
- "grasshopper": "蚱蜢",
193
- "greyhound": "灰狗",
194
- "guitar-pick": "吉他拨片",
195
- "hamburger": "汉堡包",
196
- "hammock": "吊床",
197
- "hamster": "仓鼠",
198
- "hare": "野兔",
199
- "harmonica": "口琴",
200
- "harp": "竖琴",
201
- "harpsichord": "大键琴",
202
- "head-phones": "耳机",
203
- "hedgehog": "刺猬",
204
- "helicopter": "直升机",
205
- "hibiscus": "木槿",
206
- "hippopotamus": "河马",
207
- "homer-simpson": "辛普森一家",
208
- "hornbill": "犀鸟",
209
- "horseshoe-crab": "马蹄蟹",
210
- "hot-air-balloon": "热气球",
211
- "hot-dog": "热狗",
212
- "hot-tub": "热水浴缸",
213
- "hourglass": "沙漏",
214
- "house-fly": "家蝇",
215
- "hummingbird": "蜂鸟",
216
- "hyena": "鬣狗",
217
- "ice-cream-cone": "冰淇淋筒",
218
- "iguana": "鬣蜥",
219
- "ipod": "iPod",
220
- "jellyfish": "水母",
221
- "joy-stick": "游戏手柄",
222
- "kangaroo": "袋鼠",
223
- "kayak": "皮艇",
224
- "killer-whale": "虎鲸",
225
- "koala": "考拉",
226
- "ladder": "梯子",
227
- "ladybugs": "瓢虫",
228
- "laptop": "笔记本电脑",
229
- "leopard": "豹",
230
- "license-plate": "车牌",
231
- "light-house": "灯塔",
232
- "lightbulb": "灯泡",
233
- "lightning": "闪电",
234
- "lion": "狮子",
235
- "lizard": "蜥蜴",
236
- "llama": "美洲驼",
237
- "lobster": "龙虾",
238
- "mailbox": "邮箱",
239
- "mandolin": "曼陀林",
240
- "mars": "火星",
241
- "mattress": "床垫",
242
- "megaphone": "扩音器",
243
- "microscope": "显微镜",
244
- "microwave": "微波炉",
245
- "minaret": "尖塔",
246
- "minotaur": "牛头人",
247
- "mosquito": "蚊子",
248
- "moth": "蛾",
249
- "motorbikes": "摩托车",
250
- "mountain-bike": "山地车",
251
- "mouse": "老鼠",
252
- "mushroom": "蘑菇",
253
- "mussels": "贻贝",
254
- "necktie": "领带",
255
- "octopus": "章鱼",
256
- "okapi": "长颈鹿马",
257
- "orangutan": "猩猩",
258
- "ostrich": "鸵鸟",
259
- "otter": "水獭",
260
- "owl": "猫头鹰",
261
- "ox": "牛",
262
- "oyster": "牡蛎",
263
- "palm-pilot": "掌上电脑",
264
- "palm-tree": "棕榈树",
265
- "panda": "熊猫",
266
- "paper-shredder": "碎纸机",
267
- "paperclip": "订书钉",
268
- "parrot": "鹦鹉",
269
- "pci-card": "PCI卡",
270
- "pelecaniformes": "鹭形目",
271
- "penguin": "企鹅",
272
- "photocopier": "复印机",
273
- "piano": "钢琴",
274
- "picnic-table": "野餐桌",
275
- "pig": "猪",
276
- "pigeon": "鸽子",
277
- "playing-card": "扑克牌",
278
- "porcupine": "豪猪",
279
- "possum": "负鼠",
280
- "pram": "婴儿车",
281
- "pyramid": "金字塔",
282
- "raccoon": "浣熊",
283
- "radio-telescope": "射电望远镜",
284
- "rainbow": "彩虹",
285
- "rat": "老鼠",
286
- "refrigerator": "冰箱",
287
- "reindeer": "驯鹿",
288
- "rhinoceros": "犀牛",
289
- "rotary-phone": "旋转电话",
290
- "roulette-wheel": "轮盘",
291
- "saddle": "马鞍",
292
- "sandpiper": "滨鹬",
293
- "saturn": "土星",
294
- "school-bus": "校车",
295
- "screwdriver": "螺丝刀",
296
- "seahorse": "海马",
297
- "seal": "海豹",
298
- "segway": "独轮车",
299
- "self-propelled-lawn-mower": "自走式割草机",
300
- "shark": "鲨鱼",
301
- "sheep": "羊",
302
- "sheet-music": "乐谱",
303
- "skateboard": "滑板",
304
- "skunk": "臭鼬",
305
- "skyscraper": "摩天楼",
306
- "smokestack": "烟囱",
307
- "snail": "蜗牛",
308
- "snake": "蛇",
309
- "sneaker": "运动鞋",
310
- "snowmobile": "雪地摩托车",
311
- "soccer-ball": "足球",
312
- "socks": "袜子",
313
- "soda-can": "汽水罐",
314
- "spaghetti": "意大利面",
315
- "sparrow": "麻雀",
316
- "speed-boat": "快艇",
317
- "spoon": "勺子",
318
- "squid": "鱿鱼",
319
- "squirrel": "松鼠",
320
- "stained-glass": "彩色玻璃",
321
- "starfish": "海星",
322
- "steering-wheel": "方向盘",
323
- "stirrups": "马镫",
324
- "sunflower": "向日葵",
325
- "superman": "超人",
326
- "sushi": "寿司",
327
- "swan": "天鹅",
328
- "t-shirt": "T恤",
329
- "teapot": "茶壶",
330
- "teddy-bear": "泰迪熊",
331
- "telephone-box": "电话亭",
332
- "tennis-ball": "网球",
333
- "tennis-court": "网球场",
334
- "tennis-racket": "网球拍",
335
- "tiger": "老虎",
336
- "toad": "蟾蜍",
337
- "toaster": "烤面包机",
338
- "tomato": "番茄",
339
- "tombstone": "墓碑",
340
- "top-hat": "高礼帽",
341
- "touring-bike": "旅行自行车",
342
- "tower-pisa": "比萨斜塔",
343
- "traffic-light": "交通信号灯",
344
- "treadmill": "跑步机",
345
- "triceratops": "三角龙",
346
- "tricycle": "三轮车",
347
- "tripod": "三脚架",
348
- "tuning-fork": "音叉",
349
- "turkey": "火鸡",
350
- "turtle": "乌龟",
351
- "tweezer": "眉毛钳",
352
- "umbrella": "雨伞",
353
- "unicorn": "独角兽",
354
- "video-projector": "视频投影仪",
355
- "washing-machine": "洗衣机",
356
- "watch": "手表",
357
- "waterfall": "瀑布",
358
- "watermelon": "西瓜",
359
- "welding-mask": "焊接面具",
360
- "whale": "鲸鱼",
361
- "wheelbarrow": "手推车",
362
- "windmill": "风车",
363
- "wine-bottle": "酒瓶",
364
- "wolf": "狼",
365
- "wombat": "袋熊",
366
- "woodpecker": "啄木鸟",
367
- "xylophone": "木琴",
368
- "yo-yo": "悠悠球",
369
- "zebra": "斑马"
370
- },
371
- "ACCOUNT": {
372
- "NO_POLKADOT_EXTENSION": "找不到Polkadot插件"
373
- },
374
- "WIDGET": {
375
- "SELECT_ALL": "选择所有包含以下内容",
376
- "IF_NONE_CLICK_NEXT": "如果没有,请点击下一个",
377
- "NEXT": "下一个",
378
- "SUBMIT": "提交",
379
- "CANCEL": "取消",
380
- "I_AM_HUMAN": "我是人类",
381
- "NO_ACCOUNTS_FOUND": "找不到帐户",
382
- "ACCOUNT_NOT_FOUND": "找不到帐户",
383
- "NO_EXTENSION_FOUND": "找不到扩展",
384
- "INSECURE_CONTEXT": "Procaptcha 需要安全连接 (HTTPS)",
385
- "CHECKING": "正在验证您是真人",
386
- "IMAGE_DIALOG_LABEL": "图片验证",
387
- "CANNOT_LOAD": "无法加载验证码",
388
- "RELOAD": "重新加载",
389
- "VERIFIED_AGENT": "已验证的代理",
390
- "TRUSTED_REQUEST": "受信任的请求",
391
- "LOADING": "加载中",
392
- "PUZZLE": {
393
- "DIALOG_LABEL": "拼图验证",
394
- "DRAG": "将拼块拖到目标位置",
395
- "RETRY": "差一点 — 请再试一次",
396
- "PIECE_LABEL": "拼图块",
397
- "PIECE_ROLE": "可拖动的拼图块",
398
- "KEYBOARD_HINT": "用方向键移动拼块,按住 Shift 可以小步移动。按 Enter 提交,按 Home 让它回到起点,按 Escape 取消。",
399
- "POSITION": "距左边 {{x}} %,距顶部 {{y}} %",
400
- "CHECKING": "正在检查您的答案",
401
- "RETRY_ANNOUNCEMENT": "差一点。已加载新的拼图,拼块回到了起点。"
402
- }
403
- },
404
- "CONTRACT": {
405
- "INVALID_ADDRESS": "无法编码无效地址",
406
- "CAPTCHA_SOLUTION_COMMITMENT_DOES_NOT_EXIST": "验证码解决方案承诺不存在",
407
- "SIGNER_UNDEFINED": "签署者未定义",
408
- "CANNOT_FIND_KEYPAIR": "找不到密钥对",
409
- "INVALID_DATA_FORMAT": "无效的数据格式"
410
- },
411
- "CONFIG": {
412
- "UNKNOWN_ENVIRONMENT": "请求的环境未知",
413
- "INVALID_CAPTCHA_NUMBER": "请正确配置验证码配置",
414
- "INVALID_LOG_LEVEL": "无效的日志级别",
415
- "INVALID_PACKAGE_DIR": "无效的包目录"
416
- },
417
- "DATASET": {
418
- "DATASET_PARSE_ERROR": "解析数据集时出错",
419
- "SOLUTION_PARSE_ERROR": "解析数据集时出错",
420
- "HASH_ERROR": "哈希数据集时出错",
421
- "DATASET_ID_UNDEFINED": "数据集ID未定义",
422
- "NOT_ENOUGH_LABELS": "标签不足",
423
- "NOT_ENOUGH_IMAGES": "图像不足",
424
- "CAPTCHAS_COUNT_LESS_THAN_CONFIGURED": "数据集中的验证码数量少于配置的验证码数量",
425
- "SOLUTIONS_COUNT_LESS_THAN_CONFIGURED": "数据集中的解决方案数量少于配置的解决方案数量",
426
- "DUPLICATE_IMAGE": "检测到重复图像",
427
- "MERKLE_ERROR": "创建默克尔树时出错"
428
- },
429
- "DATABASE": {
430
- "DATABASE_IMPORT_FAILED": "导入数据库引擎失败",
431
- "DATABASE_UNDEFINED": "数据库客户端未连接",
432
- "DATABASE_HOST_UNDEFINED": "未定义数据库主机地址",
433
- "DATASET_LOAD_FAILED": "数据集加载失败",
434
- "DATASET_GET_FAILED": "获取数据集失败",
435
- "CAPTCHA_GET_FAILED": "获取验证码失败",
436
- "CAPTCHA_UPDATE_FAILED": "更新验证码失败",
437
- "IMAGE_GET_FAILED": "获取图像失败",
438
- "PENDING_RECORD_NOT_FOUND": "未找到待处理记录",
439
- "INVALID_HASH": "无效的哈希",
440
- "SOLUTION_GET_FAILED": "获取解决方案失败",
441
- "DATASET_WITH_SOLUTIONS_GET_FAILED": "找不到具有所需数量解决方案的数据集",
442
- "SOLUTION_APPROVE_FAILED": "批准解决方案失败",
443
- "SOLUTION_FLAG_FAILED": "标记解决方案为已处理失败",
444
- "TABLES_UNDEFINED": "未定义表",
445
- "CONNECTION_UNDEFINED": "连接未定义",
446
- "COMMITMENT_FLAG_FAILED": "标记承诺为已处理失败",
447
- "UNKNOWN": "未知数据库错误",
448
- "QUERY_ERROR": "数据库查询失败",
449
- "REDIS_ACCESS_RULES_CONNECTION_UNDEFINED": "访问规则的 Redis 连接未定义",
450
- "USER_ACCESS_RULES_STORAGE_UNDEFINED": "用户访问规则存储未定义",
451
- "SESSION_STORE_FAILED": "存储会话失败",
452
- "SESSION_CHECK_REMOVE_FAILED": "检查并移除会话失败",
453
- "SESSION_GET_FAILED": "获取会话失败"
454
- },
455
- "CAPTCHA": {
456
- "PARSE_ERROR": "解析验证码时出错",
457
- "INVALID_CAPTCHA_ID": "无效的验证码ID",
458
- "INVALID_ITEM_FORMAT": "仅允许图像和文本项目类型",
459
- "INVALID_SOLUTION_TYPE": "无效的解决方案类型",
460
- "INVALID_ITEM_HASH": "无效的项目哈希",
461
- "DIFFERENT_DATASET_IDS": "数据集ID不匹配",
462
- "ID_MISMATCH": "验证码ID不匹配",
463
- "MISSING_ITEM_HASH": "缺少项目哈希",
464
- "INVALID_CAPTCHA_CHALLENGE": "无效的验证码挑战",
465
- "DAPP_USER_SOLUTION_NOT_FOUND": "找不到Dapp用户解决方案",
466
- "NO_CAPTCHA": "找不到验证码",
467
- "NO_SESSION_FOUND": "找不到会话",
468
- "IP_ADDRESS_MISMATCH": "检测到 IP 地址不匹配",
469
- "INVALID_SALT": "盐值无效",
470
- "INVALID_TOKEN": "无效的令牌",
471
- "INVALID_SOLUTION": "无效的解决方案",
472
- "DECRYPTION_ERROR": "解密错误",
473
- "SOLUTION_NOT_FOUND": "未找到解答",
474
- "DECISION_MACHINE_DENIED": "被决策机拒绝",
475
- "INVALID_TIMESTAMP": "无效的时间戳"
476
- },
477
- "CLI": {
478
- "PARAMETER_ERROR": "无效的参数"
479
- },
480
- "DEVELOPER": {
481
- "PROSOPO_SITE_KEY_MISSING": "在.env文件中未设置PROSOPO_SITE_KEY",
482
- "PROVIDER_NO_CAPTCHA": "提供商未返回验证码",
483
- "MISSING_PROVIDER_PAIR": "缺少提供商对",
484
- "MISSING_ENV_VARIABLE": "缺少环境变量",
485
- "GENERAL": "一般开发错误,请参考上下文",
486
- "METHOD_NOT_IMPLEMENTED": "方法未实现"
487
- },
488
- "FS": {
489
- "FILE_NOT_FOUND": "未找到文件",
490
- "FILE_ALREADY_EXISTS": "文件已存在",
491
- "INVALID_DIR_FORMAT": "无效的目录格式"
492
- }
493
- }
package/src/process.ts DELETED
@@ -1,29 +0,0 @@
1
- // Copyright 2021-2026 Prosopo (UK) Ltd.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- /**
16
- * The `process` global, or undefined where there is none.
17
- *
18
- * This package is reached transitively from browser bundles, where `process`
19
- * may be missing entirely or present but stripped down. A bare `process.env`
20
- * read throws a ReferenceError in that case and takes the whole page down.
21
- *
22
- * It is a function, and it lives in its own module, so callers can be tested
23
- * against a runtime that has no `process` at all. Inlining the `typeof` check
24
- * at the point of use makes that branch untestable: vitest calls
25
- * `process.memoryUsage()` between suites, so stubbing the real global away
26
- * fails the run rather than the module under test.
27
- */
28
- export const getProcess = (): NodeJS.Process | undefined =>
29
- typeof process !== "undefined" ? process : undefined;
@@ -1,52 +0,0 @@
1
- // Copyright 2021-2026 Prosopo (UK) Ltd.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- import { describe, expect, test } from "vitest";
16
- import { getLanguageDirection } from "../direction.js";
17
- import { LanguageCodes } from "../translations.js";
18
-
19
- describe("getLanguageDirection", () => {
20
- test("is rtl for Arabic", () => {
21
- expect(getLanguageDirection("ar")).toBe("rtl");
22
- });
23
-
24
- test("is rtl for regional and differently-cased Arabic tags", () => {
25
- expect(getLanguageDirection("ar-EG")).toBe("rtl");
26
- expect(getLanguageDirection("AR_sa")).toBe("rtl");
27
- });
28
-
29
- test("is rtl for other right-to-left scripts", () => {
30
- for (const language of ["he", "fa", "ur", "yi"]) {
31
- expect(getLanguageDirection(language)).toBe("rtl");
32
- }
33
- });
34
-
35
- test("is ltr for every other shipped language", () => {
36
- const others: string[] = LanguageCodes.filter(
37
- (code: string) => code !== "ar",
38
- );
39
- for (const language of others) {
40
- expect(getLanguageDirection(language)).toBe("ltr");
41
- }
42
- });
43
-
44
- test("is ltr for an empty or unknown tag", () => {
45
- expect(getLanguageDirection("")).toBe("ltr");
46
- expect(getLanguageDirection("xx")).toBe("ltr");
47
- });
48
-
49
- test("matches only the primary subtag", () => {
50
- expect(getLanguageDirection("en-AR")).toBe("ltr");
51
- });
52
- });
@@ -1,84 +0,0 @@
1
- // Copyright 2021-2026 Prosopo (UK) Ltd.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
- import { flatten } from "@prosopo/util";
15
- import { describe, expect, test } from "vitest";
16
- import { localiseErrorMessage } from "../errorMessage.js";
17
- import de from "../locales/de/translation.json" with { type: "json" };
18
- import type { Ti18n, TranslateOptions } from "../types.js";
19
-
20
- // Same lookup order as the browser instance in i18nFrontend.ts: the active
21
- // catalogue, then the caller's defaultValue, then the key.
22
- const i18nIn = (
23
- catalogue: Record<string, unknown>,
24
- isInitialized = true,
25
- ): Ti18n => {
26
- const flat: Record<string, string> = flatten(catalogue);
27
- return {
28
- language: "de",
29
- isInitialized,
30
- t: (key: string, options?: TranslateOptions): string =>
31
- flat[key] ?? options?.defaultValue ?? key,
32
- changeLanguage: async (): Promise<void> => undefined,
33
- hasLoadedNamespace: (): boolean => isInitialized,
34
- on: (): void => undefined,
35
- off: (): void => undefined,
36
- };
37
- };
38
-
39
- const germanI18n = (): Ti18n => i18nIn(de);
40
-
41
- describe("localiseErrorMessage", () => {
42
- test("translates a catalogue key into the widget's language, not the server's", () => {
43
- const i18n = germanI18n();
44
- expect(
45
- localiseErrorMessage(i18n, {
46
- message: "Invalid site key",
47
- key: "API.INVALID_SITE_KEY",
48
- }),
49
- ).toBe("Ungültiger Site-Schlüssel");
50
- });
51
-
52
- test("keeps the server message when the key is not in the catalogue", () => {
53
- const i18n = germanI18n();
54
- expect(
55
- localiseErrorMessage(i18n, {
56
- message: "upstream timed out",
57
- key: "API.NOT_A_REAL_KEY",
58
- }),
59
- ).toBe("upstream timed out");
60
- });
61
-
62
- test("keeps the server message when there is no key", () => {
63
- const i18n = germanI18n();
64
- expect(localiseErrorMessage(i18n, { message: "Invalid site key" })).toBe(
65
- "Invalid site key",
66
- );
67
- });
68
-
69
- test("keeps the server message until i18n is initialised", () => {
70
- const i18n = i18nIn(de, false);
71
- expect(
72
- localiseErrorMessage(i18n, {
73
- message: "Invalid site key",
74
- key: "API.INVALID_SITE_KEY",
75
- }),
76
- ).toBe("Invalid site key");
77
- expect(
78
- localiseErrorMessage(undefined, {
79
- message: "Invalid site key",
80
- key: "API.INVALID_SITE_KEY",
81
- }),
82
- ).toBe("Invalid site key");
83
- });
84
- });