@prosopo/locale 3.11.0 → 3.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.
Files changed (129) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +15 -15
  2. package/.turbo/turbo-build$colon$tsc.log +5 -5
  3. package/.turbo/turbo-build.log +21 -21
  4. package/CHANGELOG.md +53 -0
  5. package/README.md +11 -9
  6. package/dist/cjs/errorMessage.cjs +11 -10
  7. package/dist/cjs/index.cjs +2 -1
  8. package/dist/cjs/locales/en/widget.cjs +45 -2
  9. package/dist/cjs/translationKey.cjs +3 -3
  10. package/dist/errorMessage.d.ts +6 -4
  11. package/dist/errorMessage.d.ts.map +1 -1
  12. package/dist/errorMessage.js +10 -10
  13. package/dist/errorMessage.js.map +1 -1
  14. package/dist/index.d.ts +2 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/locales/af/widget.json +42 -1
  19. package/dist/locales/am/widget.json +42 -1
  20. package/dist/locales/an/widget.json +42 -1
  21. package/dist/locales/ar/widget.json +42 -1
  22. package/dist/locales/as/widget.json +42 -1
  23. package/dist/locales/ast/widget.json +42 -1
  24. package/dist/locales/az/widget.json +42 -1
  25. package/dist/locales/be/widget.json +42 -1
  26. package/dist/locales/bg/widget.json +42 -1
  27. package/dist/locales/bn/widget.json +42 -1
  28. package/dist/locales/bs/widget.json +42 -1
  29. package/dist/locales/ca/widget.json +42 -1
  30. package/dist/locales/cs/widget.json +42 -1
  31. package/dist/locales/cy/widget.json +42 -1
  32. package/dist/locales/da/widget.json +42 -1
  33. package/dist/locales/de/widget.json +42 -1
  34. package/dist/locales/el/widget.json +42 -1
  35. package/dist/locales/en/widget.js +45 -3
  36. package/dist/locales/en/widget.json +42 -1
  37. package/dist/locales/eo/widget.json +42 -1
  38. package/dist/locales/es/widget.json +42 -1
  39. package/dist/locales/et/widget.json +42 -1
  40. package/dist/locales/eu/widget.json +42 -1
  41. package/dist/locales/fa/widget.json +42 -1
  42. package/dist/locales/fi/widget.json +42 -1
  43. package/dist/locales/fil/widget.json +42 -1
  44. package/dist/locales/fr/widget.json +42 -1
  45. package/dist/locales/fy/widget.json +42 -1
  46. package/dist/locales/ga/widget.json +42 -1
  47. package/dist/locales/gd/widget.json +42 -1
  48. package/dist/locales/gl/widget.json +42 -1
  49. package/dist/locales/gu/widget.json +42 -1
  50. package/dist/locales/he/widget.json +42 -1
  51. package/dist/locales/hi/widget.json +42 -1
  52. package/dist/locales/hr/widget.json +42 -1
  53. package/dist/locales/hu/widget.json +42 -1
  54. package/dist/locales/hy/widget.json +42 -1
  55. package/dist/locales/ia/widget.json +42 -1
  56. package/dist/locales/id/widget.json +42 -1
  57. package/dist/locales/is/widget.json +42 -1
  58. package/dist/locales/it/widget.json +42 -1
  59. package/dist/locales/ja/widget.json +42 -1
  60. package/dist/locales/jv/widget.json +42 -1
  61. package/dist/locales/ka/widget.json +42 -1
  62. package/dist/locales/kk/widget.json +42 -1
  63. package/dist/locales/km/widget.json +42 -1
  64. package/dist/locales/kn/widget.json +42 -1
  65. package/dist/locales/ko/widget.json +42 -1
  66. package/dist/locales/ky/widget.json +42 -1
  67. package/dist/locales/lo/widget.json +42 -1
  68. package/dist/locales/lt/widget.json +42 -1
  69. package/dist/locales/lv/widget.json +42 -1
  70. package/dist/locales/mk/widget.json +42 -1
  71. package/dist/locales/ml/widget.json +42 -1
  72. package/dist/locales/mn/widget.json +42 -1
  73. package/dist/locales/mr/widget.json +42 -1
  74. package/dist/locales/ms/widget.json +42 -1
  75. package/dist/locales/my/widget.json +42 -1
  76. package/dist/locales/ne/widget.json +42 -1
  77. package/dist/locales/nl/widget.json +42 -1
  78. package/dist/locales/nn/widget.json +42 -1
  79. package/dist/locales/no/widget.json +42 -1
  80. package/dist/locales/oc/widget.json +42 -1
  81. package/dist/locales/or/widget.json +42 -1
  82. package/dist/locales/pa/widget.json +42 -1
  83. package/dist/locales/pl/widget.json +42 -1
  84. package/dist/locales/pt/widget.json +42 -1
  85. package/dist/locales/pt-BR/widget.json +42 -1
  86. package/dist/locales/rm/widget.json +42 -1
  87. package/dist/locales/ro/widget.json +42 -1
  88. package/dist/locales/ru/widget.json +42 -1
  89. package/dist/locales/sco/widget.json +42 -1
  90. package/dist/locales/si/widget.json +42 -1
  91. package/dist/locales/sk/widget.json +42 -1
  92. package/dist/locales/sl/widget.json +42 -1
  93. package/dist/locales/sq/widget.json +42 -1
  94. package/dist/locales/sr/widget.json +42 -1
  95. package/dist/locales/sv/widget.json +42 -1
  96. package/dist/locales/sw/widget.json +42 -1
  97. package/dist/locales/ta/widget.json +42 -1
  98. package/dist/locales/te/widget.json +42 -1
  99. package/dist/locales/tg/widget.json +42 -1
  100. package/dist/locales/th/widget.json +42 -1
  101. package/dist/locales/tr/widget.json +42 -1
  102. package/dist/locales/uk/widget.json +42 -1
  103. package/dist/locales/ur/widget.json +42 -1
  104. package/dist/locales/uz/widget.json +42 -1
  105. package/dist/locales/vi/widget.json +42 -1
  106. package/dist/locales/xh/widget.json +42 -1
  107. package/dist/locales/zh/widget.json +42 -1
  108. package/dist/locales/zh-CN/widget.json +42 -1
  109. package/dist/locales/zh-HK/widget.json +42 -1
  110. package/dist/locales/zh-TW/widget.json +42 -1
  111. package/dist/locales/zu/widget.json +42 -1
  112. package/dist/tests/errorMessage.unit.test.js +41 -31
  113. package/dist/tests/errorMessage.unit.test.js.map +1 -1
  114. package/dist/tests/i18nBackendFiles.unit.test.js +2 -2
  115. package/dist/tests/i18nBackendFiles.unit.test.js.map +1 -1
  116. package/dist/tests/locales.unit.test.js +2 -2
  117. package/dist/tests/locales.unit.test.js.map +1 -1
  118. package/dist/tests/resultReasonKeys.unit.test.d.ts +2 -0
  119. package/dist/tests/resultReasonKeys.unit.test.d.ts.map +1 -0
  120. package/dist/tests/resultReasonKeys.unit.test.js +26 -0
  121. package/dist/tests/resultReasonKeys.unit.test.js.map +1 -0
  122. package/dist/tests/translationKey.unit.test.js +1 -0
  123. package/dist/tests/translationKey.unit.test.js.map +1 -1
  124. package/dist/translationKey.js +3 -3
  125. package/package.json +10 -10
  126. package/dist/tests/thrownErrorKeys.unit.test.d.ts +0 -2
  127. package/dist/tests/thrownErrorKeys.unit.test.d.ts.map +0 -1
  128. package/dist/tests/thrownErrorKeys.unit.test.js +0 -51
  129. package/dist/tests/thrownErrorKeys.unit.test.js.map +0 -1
@@ -5,7 +5,7 @@ ViteCommonJSConfig: .
5
5
  }
6
6
  { externals: [ '@prosopo/util' ] }
7
7
  The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
8
- vite v8.1.5 building ssr environment for production...
8
+ vite v8.1.6 building ssr environment for production...
9
9
  Bundle build started
10
10
  
11
11
  ✓ 22 modules transformed.
@@ -15,26 +15,26 @@ dist/cjs/util.cjs 0.28 kB │ gzip: 0.17 kB
15
15
  dist/cjs/i18SharedOptions.cjs 0.37 kB │ gzip: 0.23 kB
16
16
  dist/cjs/i18nMiddleware.cjs 0.51 kB │ gzip: 0.26 kB
17
17
  dist/cjs/untranslatedI18n.cjs 0.62 kB │ gzip: 0.38 kB
18
- dist/cjs/errorMessage.cjs 0.75 kB │ gzip: 0.42 kB
19
18
  dist/cjs/process.cjs 0.78 kB │ gzip: 0.46 kB
19
+ dist/cjs/errorMessage.cjs 0.82 kB │ gzip: 0.47 kB
20
20
  dist/cjs/translator.cjs 0.92 kB │ gzip: 0.47 kB
21
21
  dist/cjs/requestLanguageDetector.cjs 0.98 kB │ gzip: 0.50 kB
22
22
  dist/cjs/_virtual/_rolldown/runtime.cjs 1.00 kB │ gzip: 0.50 kB
23
23
  dist/cjs/serverTranslationKeys.cjs 1.72 kB │ gzip: 0.72 kB
24
- dist/cjs/translationKey.cjs 1.80 kB │ gzip: 0.92 kB
25
24
  dist/cjs/translations.cjs 1.82 kB │ gzip: 0.84 kB
25
+ dist/cjs/translationKey.cjs 1.84 kB │ gzip: 0.94 kB
26
26
  dist/cjs/loadI18next.cjs 2.04 kB │ gzip: 0.85 kB
27
27
  dist/cjs/i18nBackend.cjs 2.62 kB │ gzip: 0.88 kB
28
- dist/cjs/index.cjs 2.86 kB │ gzip: 0.63 kB
28
+ dist/cjs/index.cjs 2.92 kB │ gzip: 0.66 kB
29
29
  dist/cjs/direction.cjs 2.94 kB │ gzip: 1.61 kB
30
30
  dist/cjs/locales/en/translation.cjs 3.63 kB │ gzip: 1.39 kB
31
31
  dist/cjs/i18nFrontend.cjs 5.08 kB │ gzip: 2.03 kB
32
32
  dist/cjs/languagePreference.cjs 6.30 kB │ gzip: 2.44 kB
33
- dist/cjs/locales/en/widget.cjs 7.35 kB │ gzip: 2.89 kB
34
33
  dist/cjs/locales/en/target.cjs 7.69 kB │ gzip: 2.55 kB
34
+ dist/cjs/locales/en/widget.cjs 9.72 kB │ gzip: 3.07 kB
35
35
  dist/cjs/browserUiLanguages.cjs 10.85 kB │ gzip: 1.86 kB
36
36
 
37
- ✓ built in 71ms
37
+ ✓ built in 63ms
38
38
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/af/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/af/target.json
39
39
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/af/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/af/translation.json
40
40
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/af/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/af/widget.json
@@ -50,12 +50,12 @@ dist/cjs/browserUiLanguages.cjs 10.85 kB │ gzip: 1.86 kB
50
50
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/as/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/as/target.json
51
51
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/as/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/as/translation.json
52
52
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/as/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/as/widget.json
53
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/az/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/az/target.json
54
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/az/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/az/translation.json
55
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/az/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/az/widget.json
56
53
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ast/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ast/target.json
57
54
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ast/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ast/translation.json
58
55
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ast/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ast/widget.json
56
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/az/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/az/target.json
57
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/az/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/az/translation.json
58
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/az/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/az/widget.json
59
59
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/be/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/be/target.json
60
60
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/be/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/be/translation.json
61
61
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/be/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/be/widget.json
@@ -71,12 +71,12 @@ dist/cjs/browserUiLanguages.cjs 10.85 kB │ gzip: 1.86 kB
71
71
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ca/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ca/target.json
72
72
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ca/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ca/translation.json
73
73
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ca/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ca/widget.json
74
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/cy/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/cy/target.json
75
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/cy/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/cy/translation.json
76
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/cy/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/cy/widget.json
77
74
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/cs/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/cs/target.json
78
75
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/cs/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/cs/translation.json
79
76
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/cs/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/cs/widget.json
77
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/cy/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/cy/target.json
78
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/cy/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/cy/translation.json
79
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/cy/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/cy/widget.json
80
80
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/da/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/da/target.json
81
81
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/da/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/da/translation.json
82
82
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/da/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/da/widget.json
@@ -200,12 +200,12 @@ dist/cjs/browserUiLanguages.cjs 10.85 kB │ gzip: 1.86 kB
200
200
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mr/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mr/target.json
201
201
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mr/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mr/translation.json
202
202
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mr/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mr/widget.json
203
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/my/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/my/target.json
204
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/my/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/my/translation.json
205
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/my/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/my/widget.json
206
203
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ms/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ms/target.json
207
204
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ms/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ms/translation.json
208
205
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ms/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ms/widget.json
206
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/my/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/my/target.json
207
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/my/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/my/translation.json
208
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/my/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/my/widget.json
209
209
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ne/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ne/target.json
210
210
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ne/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ne/translation.json
211
211
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ne/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ne/widget.json
@@ -1,14 +1,14 @@
1
1
  $ tsc --build --verbose
2
- 10:01:11 AM - Projects in this build:
2
+ 5:07:29 PM - Projects in this build:
3
3
  * ../../dev/config/tsconfig.json
4
4
  * ../util/tsconfig.json
5
5
  * tsconfig.json
6
6
 
7
- 10:01:11 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
7
+ 5:07:29 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
8
8
 
9
- 10:01:11 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
9
+ 5:07:29 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
10
10
 
11
- 10:01:11 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
11
+ 5:07:29 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
12
12
 
13
- 10:01:11 AM - Building project '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json'...
13
+ 5:07:29 PM - Building project '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json'...
14
14
 
@@ -6,7 +6,7 @@ ViteEsmConfig: .
6
6
  }
7
7
  { externals: [ '@prosopo/util' ] }
8
8
  The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
9
- vite v8.1.5 building ssr environment for production...
9
+ vite v8.1.6 building ssr environment for production...
10
10
  Bundle build started
11
11
  
12
12
  ✓ 22 modules transformed.
@@ -17,13 +17,13 @@ dist/util.js 0.25 kB │ gzip: 0.16 kB
17
17
  dist/i18nMiddleware.js 0.31 kB │ gzip: 0.19 kB
18
18
  dist/i18SharedOptions.js 0.33 kB │ gzip: 0.23 kB
19
19
  dist/untranslatedI18n.js 0.60 kB │ gzip: 0.37 kB
20
- dist/errorMessage.js 0.71 kB │ gzip: 0.41 kB
20
+ dist/errorMessage.js 0.75 kB │ gzip: 0.45 kB
21
21
  dist/process.js 0.77 kB │ gzip: 0.46 kB
22
22
  dist/translator.js 0.84 kB │ gzip: 0.46 kB
23
23
  dist/requestLanguageDetector.js 0.88 kB │ gzip: 0.48 kB
24
- dist/index.js 1.52 kB │ gzip: 0.48 kB
25
24
  dist/serverTranslationKeys.js 1.53 kB │ gzip: 0.71 kB
26
- dist/translationKey.js 1.70 kB │ gzip: 0.90 kB
25
+ dist/index.js 1.55 kB │ gzip: 0.49 kB
26
+ dist/translationKey.js 1.74 kB │ gzip: 0.92 kB
27
27
  dist/translations.js 1.76 kB │ gzip: 0.83 kB
28
28
  dist/i18nBackend.js 1.82 kB │ gzip: 0.77 kB
29
29
  dist/loadI18next.js 1.95 kB │ gzip: 0.84 kB
@@ -31,11 +31,11 @@ dist/direction.js 2.92 kB │ gzip: 1.60 kB
31
31
  dist/locales/en/translation.js 3.52 kB │ gzip: 1.37 kB
32
32
  dist/i18nFrontend.js 4.86 kB │ gzip: 2.01 kB
33
33
  dist/languagePreference.js 5.79 kB │ gzip: 2.39 kB
34
- dist/locales/en/widget.js 7.25 kB │ gzip: 2.88 kB
35
34
  dist/locales/en/target.js 7.68 kB │ gzip: 2.55 kB
35
+ dist/locales/en/widget.js 9.60 kB │ gzip: 3.05 kB
36
36
  dist/browserUiLanguages.js 10.83 kB │ gzip: 1.86 kB
37
37
 
38
- ✓ built in 35ms
38
+ ✓ built in 177ms
39
39
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/af/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/af/target.json
40
40
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/af/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/af/translation.json
41
41
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/af/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/af/widget.json
@@ -54,15 +54,15 @@ dist/browserUiLanguages.js 10.83 kB │ gzip: 1.86 kB
54
54
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ast/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ast/target.json
55
55
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ast/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ast/translation.json
56
56
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ast/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ast/widget.json
57
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/be/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/be/target.json
58
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/be/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/be/translation.json
59
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/be/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/be/widget.json
60
57
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/az/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/az/target.json
61
58
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/az/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/az/translation.json
62
59
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/az/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/az/widget.json
63
60
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/bg/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/bg/target.json
64
61
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/bg/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/bg/translation.json
65
62
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/bg/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/bg/widget.json
63
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/be/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/be/target.json
64
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/be/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/be/translation.json
65
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/be/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/be/widget.json
66
66
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/bn/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/bn/target.json
67
67
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/bn/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/bn/translation.json
68
68
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/bn/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/bn/widget.json
@@ -81,9 +81,6 @@ dist/browserUiLanguages.js 10.83 kB │ gzip: 1.86 kB
81
81
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/da/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/da/target.json
82
82
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/da/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/da/translation.json
83
83
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/da/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/da/widget.json
84
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/de/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/de/target.json
85
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/de/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/de/translation.json
86
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/de/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/de/widget.json
87
84
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/el/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/el/target.json
88
85
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/el/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/el/translation.json
89
86
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/el/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/el/widget.json
@@ -99,6 +96,9 @@ dist/browserUiLanguages.js 10.83 kB │ gzip: 1.86 kB
99
96
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/et/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/et/target.json
100
97
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/et/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/et/translation.json
101
98
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/et/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/et/widget.json
99
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/de/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/de/target.json
100
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/de/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/de/translation.json
101
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/de/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/de/widget.json
102
102
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/eu/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/eu/target.json
103
103
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/eu/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/eu/translation.json
104
104
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/eu/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/eu/widget.json
@@ -195,6 +195,9 @@ dist/browserUiLanguages.js 10.83 kB │ gzip: 1.86 kB
195
195
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ml/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ml/target.json
196
196
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ml/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ml/translation.json
197
197
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ml/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ml/widget.json
198
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mn/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mn/target.json
199
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mn/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mn/translation.json
200
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mn/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mn/widget.json
198
201
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mr/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mr/target.json
199
202
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mr/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mr/translation.json
200
203
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mr/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mr/widget.json
@@ -204,9 +207,6 @@ dist/browserUiLanguages.js 10.83 kB │ gzip: 1.86 kB
204
207
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/my/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/my/target.json
205
208
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/my/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/my/translation.json
206
209
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/my/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/my/widget.json
207
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mn/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mn/target.json
208
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mn/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mn/translation.json
209
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/mn/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/mn/widget.json
210
210
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ne/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ne/target.json
211
211
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ne/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ne/translation.json
212
212
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/ne/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/ne/widget.json
@@ -216,15 +216,15 @@ dist/browserUiLanguages.js 10.83 kB │ gzip: 1.86 kB
216
216
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/nn/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/nn/target.json
217
217
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/nn/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/nn/translation.json
218
218
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/nn/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/nn/widget.json
219
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/no/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/no/target.json
220
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/no/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/no/translation.json
221
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/no/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/no/widget.json
222
219
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/oc/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/oc/target.json
223
220
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/oc/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/oc/translation.json
224
221
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/oc/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/oc/widget.json
225
222
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/or/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/or/target.json
226
223
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/or/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/or/translation.json
227
224
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/or/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/or/widget.json
225
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/no/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/no/target.json
226
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/no/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/no/translation.json
227
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/no/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/no/widget.json
228
228
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/pa/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/pa/target.json
229
229
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/pa/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/pa/translation.json
230
230
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/pa/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/pa/widget.json
@@ -255,12 +255,12 @@ dist/browserUiLanguages.js 10.83 kB │ gzip: 1.86 kB
255
255
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sk/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sk/target.json
256
256
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sk/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sk/translation.json
257
257
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sk/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sk/widget.json
258
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sl/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sl/target.json
259
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sl/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sl/translation.json
260
- [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sl/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sl/widget.json
261
258
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sq/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sq/target.json
262
259
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sq/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sq/translation.json
263
260
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sq/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sq/widget.json
261
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sl/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sl/target.json
262
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sl/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sl/translation.json
263
+ [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sl/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sl/widget.json
264
264
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sr/target.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sr/target.json
265
265
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sr/translation.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sr/translation.json
266
266
  [copy-plugin] copying /home/runner/work/captcha/captcha/packages/locale/src/locales/sr/widget.json to /home/runner/work/captcha/captcha/packages/locale/dist/locales/sr/widget.json
package/CHANGELOG.md CHANGED
@@ -1,5 +1,58 @@
1
1
  # @prosopo/locale
2
2
 
3
+ ## 3.12.0
4
+ ### Minor Changes
5
+
6
+ - d2148c8: Errors now carry a fixed code and a site instead of a translation key.
7
+
8
+ Every error is a `ProsopoError` with a `code` from one list in
9
+ `@prosopo/common` (`ERROR_CODES`) and an `errorSite` such as `PROV-12`, which
10
+ names the one place it was thrown. Together they make the `errorId`, e.g.
11
+ `SITE_KEY_INVALID:PROV-31`, which the widget shows after the message so a
12
+ screenshot is enough to find the throw.
13
+
14
+ What a client sees:
15
+
16
+ - A public error (bad site key, blocked network, and so on) sends its code,
17
+ English message, data and errorId.
18
+ - Anything else sends only `BACKEND_ERROR:<site>` (or `FRONTEND_ERROR:<site>`
19
+ from the widget) and a status. Internal details never leave the server.
20
+
21
+ The provider no longer translates errors. The widget looks up
22
+ `ERRORS.<CODE>` in its catalogue and falls back to the English message. The
23
+ old error classes (`ProsopoApiError`, `ProsopoEnvError` and the rest), the
24
+ `key`/`messageEn` fields and `localiseErrorMessage` are gone.
25
+
26
+ Other changes in behaviour:
27
+
28
+ - An error with no specific code is a hidden 500.
29
+ - Errors no longer log themselves when they are created. The server logs each
30
+ unhandled one once: 5xx as errors, 4xx at debug.
31
+ - An invalid PoW signature is a 401 instead of a 500.
32
+ - `stringifyBigInts` returns a copy instead of changing its input, so frozen
33
+ error context can be logged.
34
+ - The provider's last hand-written error replies now use the same error body.
35
+ These were the missing-header 401s, the access-policy block, autoBan, the
36
+ metrics 401/403 and the rate limiter. The rate limiter answers with a new
37
+ public `RATE_LIMITED` (429) code.
38
+
39
+ ### Patch Changes
40
+
41
+ - 46b97b7: Roll up the open Dependabot updates: express 5 (with `@types/express` 5), dotenv 18, undici 8, geolib 4, vitest 5, vite 8.1.6 everywhere, 17 minor and patch bumps (Babel, mongoose, i18next, ip-address, turbo and others), `@angular/router` in the Angular demo, and a GitHub Actions bump.
42
+
43
+ The whole vitest family moves to 5.0.4, including `@vitest/coverage-v8`, because `@vitest/browser-playwright` 5 only works with vitest 5. The `@types/express-serve-static-core` override moves to 5.1.3 to match `@types/express` 5.
44
+
45
+ `@prosopo/dotenv` now loads env files with `quiet: true`. Since dotenv 17, every load prints an "injected env" line to stderr unless told not to.
46
+ - Updated dependencies [46b97b7]
47
+ - Updated dependencies [d2148c8]
48
+ - @prosopo/util@3.3.16
49
+
50
+ ## 3.11.1
51
+ ### Patch Changes
52
+
53
+ - b6e9459: The colon after the "Select all …" prompt is added by the widget again, rather than being part of each translation. Every language's `WIDGET.SELECT_ALL` no longer ends with a colon, and the widget renders it as `<prompt>: <target>`. A locale test now fails if a translation brings its own colon back.
54
+ - @prosopo/util@3.3.15
55
+
3
56
  ## 3.11.0
4
57
  ### Minor Changes
5
58
 
package/README.md CHANGED
@@ -10,7 +10,7 @@ Each language has one file per i18next namespace (`NAMESPACES` in
10
10
 
11
11
  | File | Sections | Loaded by |
12
12
  | --- | --- | --- |
13
- | `widget.json` | WIDGET, API, CAPTCHA, GENERAL, ACCOUNT, DEVELOPER | widget and provider |
13
+ | `widget.json` | WIDGET, API, CAPTCHA, GENERAL, ACCOUNT, DEVELOPER, ERRORS | widget and provider |
14
14
  | `target.json` | TARGET (image labels) | provider |
15
15
  | `translation.json` | DATABASE, DATASET, CONTRACT, CONFIG, PORTAL, CLI, FS | provider |
16
16
 
@@ -25,17 +25,19 @@ Each language has one file per i18next namespace (`NAMESPACES` in
25
25
  `target.json`. Each captcha in the image challenge carries the translated
26
26
  `target`, its `targetKey` and its English `targetEn`, and the response names
27
27
  its `language` (`packages/provider/src/api/captcha/localiseTarget.ts`).
28
- - Provider errors carry their key. The widget re-translates keys it has
29
- (`isWidgetTranslationKey`) and shows the provider's message for the rest. For
30
- those, the provider also sends `messageEn` (`unwrapError` in
31
- `packages/common/src/error.ts`), so the widget has English for every string
32
- it shows. The bundle build copies `widget.json` whole, rather than stripping
33
- keys its code never names (`packages/procaptcha-bundle/vite.config.ts`).
28
+ - Errors are translated by code, never by the provider. A ProsopoError
29
+ (`packages/common/src/error.ts`) reaches the widget as `{code, errorId,
30
+ message?}`; `localiseError` (`src/errorMessage.ts`) shows
31
+ `ERRORS.<code>` in the widget's language, else the English `message`, else
32
+ "Something went wrong", followed by the errorId. A non-public error arrives
33
+ as BACKEND_ERROR or FRONTEND_ERROR, so it has text too. Every `ERRORS` key
34
+ must be an `ErrorCode` (`packages/common/src/tests/error.unit.test.ts`). The
35
+ bundle build copies `widget.json` whole, rather than stripping keys its code
36
+ never names (`packages/procaptcha-bundle/vite.config.ts`).
34
37
  - `englishText(key)`, `isTranslationKey` and `isTargetKey`
35
38
  (`src/serverTranslationKeys.ts`) import every English catalogue, so only
36
39
  server code calls them. They read English whatever language i18next is in.
37
- Code that also runs in the widget, such as `ProsopoError`'s message
38
- translation, asks the i18n instance instead (`canTranslate`, which uses
40
+ Code that also runs in the widget asks the i18n instance instead (`canTranslate`, which uses
39
41
  `exists`). That keeps `target.json` and `translation.json` out of the widget
40
42
  bundle.
41
43
  - A section moves between files by moving it in every language. The tests in
@@ -1,16 +1,17 @@
1
1
  const require_translationKey = require("./translationKey.cjs");
2
2
  //#region src/errorMessage.ts
3
+ var FALLBACK_ERROR_TEXT = "Something went wrong";
3
4
  /**
4
- * The provider translates error messages into the request's Accept-Language,
5
- * which is the browser's language rather than the widget's. Re-translating the
6
- * error key on the client shows the error in the language the widget renders
7
- * in. Free text and keys outside the widget namespace (which the browser has no
8
- * text for) keep the server's message.
5
+ * The widget translates errors by code (`ERRORS.<CODE>`) in its own language;
6
+ * the provider sends English only. A code the catalogue does not know keeps the
7
+ * provider's English message. The errorId is always shown so a user's report
8
+ * names the exact place that failed.
9
9
  */
10
- var localiseErrorMessage = (i18n, error) => {
11
- const { key, message } = error;
12
- if (!key || !require_translationKey.isWidgetTranslationKey(key) || !i18n?.isInitialized) return message;
13
- return i18n.t(key, { defaultValue: message });
10
+ var localiseError = (i18n, error) => {
11
+ const key = `ERRORS.${error.code}`;
12
+ const fallback = error.message ?? "Something went wrong";
13
+ return `${i18n?.isInitialized && require_translationKey.isWidgetTranslationKey(key) ? i18n.t(key, { defaultValue: fallback }) : fallback} (${error.errorId})`;
14
14
  };
15
15
  //#endregion
16
- exports.localiseErrorMessage = localiseErrorMessage;
16
+ exports.FALLBACK_ERROR_TEXT = FALLBACK_ERROR_TEXT;
17
+ exports.localiseError = localiseError;
@@ -12,6 +12,7 @@ const require_translator = require("./translator.cjs");
12
12
  const require_untranslatedI18n = require("./untranslatedI18n.cjs");
13
13
  const require_errorMessage = require("./errorMessage.cjs");
14
14
  exports.BROWSER_UI_LANGUAGES = require_browserUiLanguages.BROWSER_UI_LANGUAGES;
15
+ exports.FALLBACK_ERROR_TEXT = require_errorMessage.FALLBACK_ERROR_TEXT;
15
16
  exports.LANGUAGE_HEADER = require_languagePreference.LANGUAGE_HEADER;
16
17
  exports.LANGUAGE_QUERY_PARAM = require_languagePreference.LANGUAGE_QUERY_PARAM;
17
18
  exports.LanguageCodes = require_translations.LanguageCodes;
@@ -31,7 +32,7 @@ exports.isTranslationKey = require_serverTranslationKeys.isTranslationKey;
31
32
  exports.isWidgetTranslationKey = require_translationKey.isWidgetTranslationKey;
32
33
  exports.languageHeaders = require_languagePreference.languageHeaders;
33
34
  exports.loadI18next = require_loadI18next.default;
34
- exports.localiseErrorMessage = require_errorMessage.localiseErrorMessage;
35
+ exports.localiseError = require_errorMessage.localiseError;
35
36
  exports.matchLanguage = require_languagePreference.matchLanguage;
36
37
  exports.matchLanguageTag = require_languagePreference.matchLanguageTag;
37
38
  exports.negotiateLanguage = require_languagePreference.negotiateLanguage;
@@ -1,7 +1,7 @@
1
1
  //#region src/locales/en/widget.json
2
2
  var ACCOUNT = { "NO_POLKADOT_EXTENSION": "Polkadot extension not found" };
3
3
  var WIDGET = {
4
- "SELECT_ALL": "Select all containing the following:",
4
+ "SELECT_ALL": "Select all containing the following",
5
5
  "IF_NONE_CLICK_NEXT": "If there are none, click Next",
6
6
  "NEXT": "Next",
7
7
  "SUBMIT": "Submit",
@@ -144,19 +144,62 @@ var DEVELOPER = {
144
144
  "GENERAL": "General Dev Error, see context",
145
145
  "METHOD_NOT_IMPLEMENTED": "Method not implemented"
146
146
  };
147
+ var ERRORS = {
148
+ "BACKEND_ERROR": "Internal server error",
149
+ "FRONTEND_ERROR": "Unknown API error",
150
+ "INVALID_REQUEST": "BadRequest",
151
+ "UNAUTHORIZED": "Unauthorized",
152
+ "FORBIDDEN": "Forbidden",
153
+ "SITE_KEY_INVALID": "Invalid site key",
154
+ "SITE_KEY_NOT_REGISTERED": "Site key not registered",
155
+ "ORIGIN_NOT_ALLOWED": "Unauthorized origin URL",
156
+ "INVALID_IP": "Invalid IP",
157
+ "INVALID_SOLUTION": "Invalid solution",
158
+ "INVALID_SALT": "Invalid salt",
159
+ "INVALID_TIMESTAMP": "Invalid timestamp",
160
+ "TIMESTAMP_TOO_OLD": "Timestamp too old",
161
+ "NO_SESSION_FOUND": "No session found",
162
+ "SOLUTION_NOT_FOUND": "Solution not found",
163
+ "INCORRECT_CAPTCHA_TYPE": "Incorrect CAPTCHA type",
164
+ "CAPTCHA_FAILED": "You answered one or more captchas incorrectly. Please try again",
165
+ "CLIENT_SESSION_MISMATCH": "Session mismatch. The captcha was not completed in this session.",
166
+ "DECISION_MACHINE_DENIED": "Denied by the decision machine",
167
+ "WALLET_NOT_FOUND": "No extension found",
168
+ "SITE_KEY_MISSING": "SITE KEY missing",
169
+ "INSECURE_CONTEXT": "Procaptcha requires a secure (HTTPS) connection",
170
+ "ACCOUNT_NOT_FOUND": "Account not found",
171
+ "FAILED_IP_VALIDATION": "IP validation failed",
172
+ "ACCESS_POLICY_BLOCK": "Access blocked by policy",
173
+ "ABUSER_BLOCKED": "Requests from networks flagged for abuse are not allowed for this site",
174
+ "CRAWLER_BLOCKED": "Requests from known crawlers are not allowed for this site",
175
+ "DATACENTER_BLOCKED": "Requests from datacenter IP addresses are not allowed for this site",
176
+ "DISALLOWED_WEBVIEW": "Requests from in-app browsers (WebViews) are not allowed for this site",
177
+ "MOBILE_BLOCKED": "Requests from mobile network connections are not allowed for this site",
178
+ "PROXY_BLOCKED": "Requests from proxy servers are not allowed for this site",
179
+ "SATELLITE_BLOCKED": "Requests from satellite connections are not allowed for this site",
180
+ "TOR_BLOCKED": "Requests from Tor exit nodes are not allowed for this site",
181
+ "VPN_BLOCKED": "Requests from VPN connections are not allowed for this site",
182
+ "TOO_MANY_LOCALHOST": "Too many CAPTCHA requests from localhost for this site key",
183
+ "SPAM_EMAIL_DOMAIN": "Email domain not allowed",
184
+ "SPAM_EMAIL_RULE": "Email address blocked by spam filter rules",
185
+ "SPAM_EMAIL_COUNT_EXCEEDED": "Too many submissions from this email address",
186
+ "PROVIDER_VERIFY_FAILED": "Provider verification failed"
187
+ };
147
188
  var widget_default = {
148
189
  ACCOUNT,
149
190
  WIDGET,
150
191
  GENERAL,
151
192
  CAPTCHA,
152
193
  API,
153
- DEVELOPER
194
+ DEVELOPER,
195
+ ERRORS
154
196
  };
155
197
  //#endregion
156
198
  exports.ACCOUNT = ACCOUNT;
157
199
  exports.API = API;
158
200
  exports.CAPTCHA = CAPTCHA;
159
201
  exports.DEVELOPER = DEVELOPER;
202
+ exports.ERRORS = ERRORS;
160
203
  exports.GENERAL = GENERAL;
161
204
  exports.WIDGET = WIDGET;
162
205
  exports.default = widget_default;
@@ -4,9 +4,9 @@ const require_widget = require("./locales/en/widget.cjs");
4
4
  * The catalogue is split into i18next namespaces so the browser downloads only
5
5
  * what it renders. Keys keep their section prefix (`WIDGET.`, `TARGET.`), so a
6
6
  * key reads the same whichever namespace holds it:
7
- * - `widget`: the widget's own text and the errors it shows (WIDGET, API,
8
- * CAPTCHA, GENERAL, ACCOUNT, DEVELOPER). The only namespace the browser
9
- * fetches.
7
+ * - `widget`: the widget's own text and the errors it shows (WIDGET, ERRORS,
8
+ * API, CAPTCHA, GENERAL, ACCOUNT, DEVELOPER). The only namespace the browser
9
+ * fetches. ERRORS is keyed by error code.
10
10
  * - `target`: image labels. The provider translates these into the challenge.
11
11
  * - `translation` (i18next's default): server-only text (DATABASE, DATASET,
12
12
  * CONTRACT, CONFIG, PORTAL, CLI, FS).
@@ -1,7 +1,9 @@
1
1
  import type { Ti18n } from "./types.js";
2
- export interface KeyedErrorMessage {
3
- message: string;
4
- key?: string;
2
+ export interface DisplayedError {
3
+ code: string;
4
+ errorId: string;
5
+ message?: string;
5
6
  }
6
- export declare const localiseErrorMessage: (i18n: Ti18n | undefined, error: KeyedErrorMessage) => string;
7
+ export declare const FALLBACK_ERROR_TEXT = "Something went wrong";
8
+ export declare const localiseError: (i18n: Ti18n | undefined, error: DisplayedError) => string;
7
9
  //# sourceMappingURL=errorMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../src/errorMessage.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AASD,eAAO,MAAM,oBAAoB,SAC1B,KAAK,GAAG,SAAS,SAChB,iBAAiB,KACtB,MAMF,CAAC"}
1
+ {"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../src/errorMessage.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAQ1D,eAAO,MAAM,aAAa,SACnB,KAAK,GAAG,SAAS,SAChB,cAAc,KACnB,MAQF,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { isWidgetTranslationKey } from "./translationKey.js";
2
2
  //#region src/errorMessage.ts
3
+ var FALLBACK_ERROR_TEXT = "Something went wrong";
3
4
  /**
4
- * The provider translates error messages into the request's Accept-Language,
5
- * which is the browser's language rather than the widget's. Re-translating the
6
- * error key on the client shows the error in the language the widget renders
7
- * in. Free text and keys outside the widget namespace (which the browser has no
8
- * text for) keep the server's message.
5
+ * The widget translates errors by code (`ERRORS.<CODE>`) in its own language;
6
+ * the provider sends English only. A code the catalogue does not know keeps the
7
+ * provider's English message. The errorId is always shown so a user's report
8
+ * names the exact place that failed.
9
9
  */
10
- var localiseErrorMessage = (i18n, error) => {
11
- const { key, message } = error;
12
- if (!key || !isWidgetTranslationKey(key) || !i18n?.isInitialized) return message;
13
- return i18n.t(key, { defaultValue: message });
10
+ var localiseError = (i18n, error) => {
11
+ const key = `ERRORS.${error.code}`;
12
+ const fallback = error.message ?? "Something went wrong";
13
+ return `${i18n?.isInitialized && isWidgetTranslationKey(key) ? i18n.t(key, { defaultValue: fallback }) : fallback} (${error.errorId})`;
14
14
  };
15
15
  //#endregion
16
- export { localiseErrorMessage };
16
+ export { FALLBACK_ERROR_TEXT, localiseError };
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessage.js","sourceRoot":"","sources":["../src/errorMessage.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAe7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CACnC,IAAuB,EACvB,KAAwB,EACf,EAAE;IACX,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC/B,IAAI,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC;QAClE,OAAO,OAAO,CAAC;IAChB,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC"}
1
+ {"version":3,"file":"errorMessage.js","sourceRoot":"","sources":["../src/errorMessage.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAU7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAQ1D,MAAM,CAAC,MAAM,aAAa,GAAG,CAC5B,IAAuB,EACvB,KAAqB,EACZ,EAAE;IACX,MAAM,GAAG,GAAG,UAAU,KAAK,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,IAAI,mBAAmB,CAAC;IACtD,MAAM,IAAI,GACT,IAAI,EAAE,aAAa,IAAI,sBAAsB,CAAC,GAAG,CAAC;QACjD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;QACzC,CAAC,CAAC,QAAQ,CAAC;IACb,OAAO,GAAG,IAAI,KAAK,KAAK,CAAC,OAAO,GAAG,CAAC;AACrC,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -16,6 +16,6 @@ export { createTranslator } from "./translator.js";
16
16
  export { createUntranslatedI18n } from "./untranslatedI18n.js";
17
17
  export type { Translator } from "./translator.js";
18
18
  export type { I18nEvent, I18nLookup, Ti18n, TranslateFn, TranslateOptions, } from "./types.js";
19
- export { localiseErrorMessage } from "./errorMessage.js";
20
- export type { KeyedErrorMessage } from "./errorMessage.js";
19
+ export { FALLBACK_ERROR_TEXT, localiseError } from "./errorMessage.js";
20
+ export type { DisplayedError } from "./errorMessage.js";
21
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACN,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,eAAe,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,YAAY,EACZ,sBAAsB,EACtB,UAAU,GACV,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACX,SAAS,EACT,SAAS,EACT,cAAc,EACd,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EACX,SAAS,EACT,UAAU,EACV,KAAK,EACL,WAAW,EACX,gBAAgB,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACN,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,eAAe,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,YAAY,EACZ,sBAAsB,EACtB,UAAU,GACV,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACX,SAAS,EACT,SAAS,EACT,cAAc,EACd,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EACX,SAAS,EACT,UAAU,EACV,KAAK,EACL,WAAW,EACX,gBAAgB,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}