@prosopo/locale 3.9.0 → 3.10.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.
- package/.turbo/turbo-build$colon$cjs.log +267 -14
- package/.turbo/turbo-build$colon$tsc.log +5 -5
- package/.turbo/turbo-build.log +266 -13
- package/CHANGELOG.md +43 -0
- package/README.md +203 -0
- package/dist/browserUiLanguages.d.ts +10 -0
- package/dist/browserUiLanguages.d.ts.map +1 -0
- package/dist/browserUiLanguages.js +768 -0
- package/dist/browserUiLanguages.js.map +1 -0
- package/dist/cjs/browserUiLanguages.cjs +768 -0
- package/dist/cjs/direction.cjs +30 -15
- package/dist/cjs/errorMessage.cjs +3 -2
- package/dist/cjs/i18SharedOptions.cjs +0 -1
- package/dist/cjs/i18nBackend.cjs +32 -20
- package/dist/cjs/i18nFrontend.cjs +23 -73
- package/dist/cjs/index.cjs +23 -2
- package/dist/cjs/languagePreference.cjs +142 -0
- package/dist/cjs/loadI18next.cjs +4 -4
- package/dist/cjs/locales/en/target.cjs +304 -0
- package/dist/cjs/locales/en/translation.cjs +1 -459
- package/dist/cjs/locales/en/widget.cjs +162 -0
- package/dist/cjs/requestLanguageDetector.cjs +24 -0
- package/dist/cjs/serverTranslationKeys.cjs +38 -0
- package/dist/cjs/translationKey.cjs +29 -7
- package/dist/cjs/translations.cjs +63 -2
- package/dist/cjs/translator.cjs +2 -1
- package/dist/direction.d.ts.map +1 -1
- package/dist/direction.js +30 -15
- package/dist/direction.js.map +1 -1
- package/dist/errorMessage.d.ts.map +1 -1
- package/dist/errorMessage.js +4 -3
- package/dist/errorMessage.js.map +1 -1
- package/dist/i18SharedOptions.d.ts +0 -1
- package/dist/i18SharedOptions.d.ts.map +1 -1
- package/dist/i18SharedOptions.js +0 -1
- package/dist/i18SharedOptions.js.map +1 -1
- package/dist/i18nBackend.d.ts +3 -1
- package/dist/i18nBackend.d.ts.map +1 -1
- package/dist/i18nBackend.js +32 -22
- package/dist/i18nBackend.js.map +1 -1
- package/dist/i18nFrontend.d.ts.map +1 -1
- package/dist/i18nFrontend.js +23 -73
- package/dist/i18nFrontend.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/languagePreference.d.ts +17 -0
- package/dist/languagePreference.d.ts.map +1 -0
- package/dist/languagePreference.js +132 -0
- package/dist/languagePreference.js.map +1 -0
- package/dist/loadI18next.js +4 -4
- package/dist/locales/af/target.json +301 -0
- package/dist/locales/af/translation.json +71 -0
- package/dist/locales/af/widget.json +149 -0
- package/dist/locales/am/target.json +301 -0
- package/dist/locales/am/translation.json +71 -0
- package/dist/locales/am/widget.json +149 -0
- package/dist/locales/an/target.json +301 -0
- package/dist/locales/an/translation.json +71 -0
- package/dist/locales/an/widget.json +149 -0
- package/dist/locales/ar/target.json +301 -0
- package/dist/locales/ar/translation.json +0 -446
- package/dist/locales/ar/widget.json +149 -0
- package/dist/locales/as/target.json +301 -0
- package/dist/locales/as/translation.json +71 -0
- package/dist/locales/as/widget.json +149 -0
- package/dist/locales/ast/target.json +301 -0
- package/dist/locales/ast/translation.json +71 -0
- package/dist/locales/ast/widget.json +149 -0
- package/dist/locales/az/target.json +301 -0
- package/dist/locales/az/translation.json +0 -446
- package/dist/locales/az/widget.json +149 -0
- package/dist/locales/be/target.json +301 -0
- package/dist/locales/be/translation.json +71 -0
- package/dist/locales/be/widget.json +149 -0
- package/dist/locales/bg/target.json +301 -0
- package/dist/locales/bg/translation.json +71 -0
- package/dist/locales/bg/widget.json +149 -0
- package/dist/locales/bn/target.json +301 -0
- package/dist/locales/bn/translation.json +71 -0
- package/dist/locales/bn/widget.json +149 -0
- package/dist/locales/bs/target.json +301 -0
- package/dist/locales/bs/translation.json +71 -0
- package/dist/locales/bs/widget.json +149 -0
- package/dist/locales/ca/target.json +301 -0
- package/dist/locales/ca/translation.json +71 -0
- package/dist/locales/ca/widget.json +149 -0
- package/dist/locales/cs/target.json +301 -0
- package/dist/locales/cs/translation.json +0 -446
- package/dist/locales/cs/widget.json +149 -0
- package/dist/locales/cy/target.json +301 -0
- package/dist/locales/cy/translation.json +71 -0
- package/dist/locales/cy/widget.json +149 -0
- package/dist/locales/da/target.json +301 -0
- package/dist/locales/da/translation.json +71 -0
- package/dist/locales/da/widget.json +149 -0
- package/dist/locales/de/target.json +301 -0
- package/dist/locales/de/translation.json +0 -446
- package/dist/locales/de/widget.json +149 -0
- package/dist/locales/el/target.json +301 -0
- package/dist/locales/el/translation.json +0 -446
- package/dist/locales/el/widget.json +149 -0
- package/dist/locales/en/target.js +303 -0
- package/dist/locales/en/target.json +301 -0
- package/dist/locales/en/translation.js +2 -453
- package/dist/locales/en/translation.json +0 -446
- package/dist/locales/en/widget.js +156 -0
- package/dist/locales/en/widget.json +149 -0
- package/dist/locales/eo/target.json +301 -0
- package/dist/locales/eo/translation.json +71 -0
- package/dist/locales/eo/widget.json +149 -0
- package/dist/locales/es/target.json +301 -0
- package/dist/locales/es/translation.json +0 -446
- package/dist/locales/es/widget.json +149 -0
- package/dist/locales/et/target.json +301 -0
- package/dist/locales/et/translation.json +71 -0
- package/dist/locales/et/widget.json +149 -0
- package/dist/locales/eu/target.json +301 -0
- package/dist/locales/eu/translation.json +71 -0
- package/dist/locales/eu/widget.json +149 -0
- package/dist/locales/fa/target.json +301 -0
- package/dist/locales/fa/translation.json +71 -0
- package/dist/locales/fa/widget.json +149 -0
- package/dist/locales/fi/target.json +301 -0
- package/dist/locales/fi/translation.json +0 -446
- package/dist/locales/fi/widget.json +149 -0
- package/dist/locales/fil/target.json +301 -0
- package/dist/locales/fil/translation.json +71 -0
- package/dist/locales/fil/widget.json +149 -0
- package/dist/locales/fr/target.json +301 -0
- package/dist/locales/fr/translation.json +0 -446
- package/dist/locales/fr/widget.json +149 -0
- package/dist/locales/fy/target.json +301 -0
- package/dist/locales/fy/translation.json +71 -0
- package/dist/locales/fy/widget.json +149 -0
- package/dist/locales/ga/target.json +301 -0
- package/dist/locales/ga/translation.json +71 -0
- package/dist/locales/ga/widget.json +149 -0
- package/dist/locales/gd/target.json +301 -0
- package/dist/locales/gd/translation.json +71 -0
- package/dist/locales/gd/widget.json +149 -0
- package/dist/locales/gl/target.json +301 -0
- package/dist/locales/gl/translation.json +71 -0
- package/dist/locales/gl/widget.json +149 -0
- package/dist/locales/gu/target.json +301 -0
- package/dist/locales/gu/translation.json +71 -0
- package/dist/locales/gu/widget.json +149 -0
- package/dist/locales/he/target.json +301 -0
- package/dist/locales/he/translation.json +71 -0
- package/dist/locales/he/widget.json +149 -0
- package/dist/locales/hi/target.json +301 -0
- package/dist/locales/hi/translation.json +0 -446
- package/dist/locales/hi/widget.json +149 -0
- package/dist/locales/hr/target.json +301 -0
- package/dist/locales/hr/translation.json +71 -0
- package/dist/locales/hr/widget.json +149 -0
- package/dist/locales/hu/target.json +301 -0
- package/dist/locales/hu/translation.json +0 -446
- package/dist/locales/hu/widget.json +149 -0
- package/dist/locales/hy/target.json +301 -0
- package/dist/locales/hy/translation.json +71 -0
- package/dist/locales/hy/widget.json +149 -0
- package/dist/locales/ia/target.json +301 -0
- package/dist/locales/ia/translation.json +71 -0
- package/dist/locales/ia/widget.json +149 -0
- package/dist/locales/id/target.json +301 -0
- package/dist/locales/id/translation.json +10 -456
- package/dist/locales/id/widget.json +149 -0
- package/dist/locales/is/target.json +301 -0
- package/dist/locales/is/translation.json +71 -0
- package/dist/locales/is/widget.json +149 -0
- package/dist/locales/it/target.json +301 -0
- package/dist/locales/it/translation.json +0 -446
- package/dist/locales/it/widget.json +149 -0
- package/dist/locales/ja/target.json +301 -0
- package/dist/locales/ja/translation.json +0 -446
- package/dist/locales/ja/widget.json +149 -0
- package/dist/locales/jv/target.json +301 -0
- package/dist/locales/jv/translation.json +47 -493
- package/dist/locales/jv/widget.json +149 -0
- package/dist/locales/ka/target.json +301 -0
- package/dist/locales/ka/translation.json +71 -0
- package/dist/locales/ka/widget.json +149 -0
- package/dist/locales/kk/target.json +301 -0
- package/dist/locales/kk/translation.json +71 -0
- package/dist/locales/kk/widget.json +149 -0
- package/dist/locales/km/target.json +301 -0
- package/dist/locales/km/translation.json +71 -0
- package/dist/locales/km/widget.json +149 -0
- package/dist/locales/kn/target.json +301 -0
- package/dist/locales/kn/translation.json +71 -0
- package/dist/locales/kn/widget.json +149 -0
- package/dist/locales/ko/target.json +301 -0
- package/dist/locales/ko/translation.json +0 -446
- package/dist/locales/ko/widget.json +149 -0
- package/dist/locales/ky/target.json +301 -0
- package/dist/locales/ky/translation.json +71 -0
- package/dist/locales/ky/widget.json +149 -0
- package/dist/locales/lo/target.json +301 -0
- package/dist/locales/lo/translation.json +71 -0
- package/dist/locales/lo/widget.json +149 -0
- package/dist/locales/lt/target.json +301 -0
- package/dist/locales/lt/translation.json +71 -0
- package/dist/locales/lt/widget.json +149 -0
- package/dist/locales/lv/target.json +301 -0
- package/dist/locales/lv/translation.json +71 -0
- package/dist/locales/lv/widget.json +149 -0
- package/dist/locales/mk/target.json +301 -0
- package/dist/locales/mk/translation.json +71 -0
- package/dist/locales/mk/widget.json +149 -0
- package/dist/locales/ml/target.json +301 -0
- package/dist/locales/ml/translation.json +47 -493
- package/dist/locales/ml/widget.json +149 -0
- package/dist/locales/mn/target.json +301 -0
- package/dist/locales/mn/translation.json +71 -0
- package/dist/locales/mn/widget.json +149 -0
- package/dist/locales/mr/target.json +301 -0
- package/dist/locales/mr/translation.json +71 -0
- package/dist/locales/mr/widget.json +149 -0
- package/dist/locales/ms/target.json +301 -0
- package/dist/locales/ms/translation.json +47 -493
- package/dist/locales/ms/widget.json +149 -0
- package/dist/locales/my/target.json +301 -0
- package/dist/locales/my/translation.json +71 -0
- package/dist/locales/my/widget.json +149 -0
- package/dist/locales/ne/target.json +301 -0
- package/dist/locales/ne/translation.json +71 -0
- package/dist/locales/ne/widget.json +149 -0
- package/dist/locales/nl/target.json +301 -0
- package/dist/locales/nl/translation.json +0 -446
- package/dist/locales/nl/widget.json +149 -0
- package/dist/locales/nn/target.json +301 -0
- package/dist/locales/nn/translation.json +71 -0
- package/dist/locales/nn/widget.json +149 -0
- package/dist/locales/no/target.json +301 -0
- package/dist/locales/no/translation.json +1 -447
- package/dist/locales/no/widget.json +149 -0
- package/dist/locales/oc/target.json +301 -0
- package/dist/locales/oc/translation.json +71 -0
- package/dist/locales/oc/widget.json +149 -0
- package/dist/locales/or/target.json +301 -0
- package/dist/locales/or/translation.json +71 -0
- package/dist/locales/or/widget.json +149 -0
- package/dist/locales/pa/target.json +301 -0
- package/dist/locales/pa/translation.json +71 -0
- package/dist/locales/pa/widget.json +149 -0
- package/dist/locales/pl/target.json +301 -0
- package/dist/locales/pl/translation.json +0 -446
- package/dist/locales/pl/widget.json +149 -0
- package/dist/locales/pt/target.json +301 -0
- package/dist/locales/pt/translation.json +0 -446
- package/dist/locales/pt/widget.json +149 -0
- package/dist/locales/pt-BR/target.json +301 -0
- package/dist/locales/pt-BR/translation.json +0 -446
- package/dist/locales/pt-BR/widget.json +149 -0
- package/dist/locales/rm/target.json +301 -0
- package/dist/locales/rm/translation.json +71 -0
- package/dist/locales/rm/widget.json +149 -0
- package/dist/locales/ro/target.json +301 -0
- package/dist/locales/ro/translation.json +0 -446
- package/dist/locales/ro/widget.json +149 -0
- package/dist/locales/ru/target.json +301 -0
- package/dist/locales/ru/translation.json +0 -446
- package/dist/locales/ru/widget.json +149 -0
- package/dist/locales/sco/target.json +301 -0
- package/dist/locales/sco/translation.json +71 -0
- package/dist/locales/sco/widget.json +149 -0
- package/dist/locales/si/target.json +301 -0
- package/dist/locales/si/translation.json +71 -0
- package/dist/locales/si/widget.json +149 -0
- package/dist/locales/sk/target.json +301 -0
- package/dist/locales/sk/translation.json +71 -0
- package/dist/locales/sk/widget.json +149 -0
- package/dist/locales/sl/target.json +301 -0
- package/dist/locales/sl/translation.json +71 -0
- package/dist/locales/sl/widget.json +149 -0
- package/dist/locales/sq/target.json +301 -0
- package/dist/locales/sq/translation.json +71 -0
- package/dist/locales/sq/widget.json +149 -0
- package/dist/locales/sr/target.json +301 -0
- package/dist/locales/sr/translation.json +0 -446
- package/dist/locales/sr/widget.json +149 -0
- package/dist/locales/sv/target.json +301 -0
- package/dist/locales/sv/translation.json +0 -446
- package/dist/locales/sv/widget.json +149 -0
- package/dist/locales/sw/target.json +301 -0
- package/dist/locales/sw/translation.json +71 -0
- package/dist/locales/sw/widget.json +149 -0
- package/dist/locales/ta/target.json +301 -0
- package/dist/locales/ta/translation.json +71 -0
- package/dist/locales/ta/widget.json +149 -0
- package/dist/locales/te/target.json +301 -0
- package/dist/locales/te/translation.json +71 -0
- package/dist/locales/te/widget.json +149 -0
- package/dist/locales/tg/target.json +301 -0
- package/dist/locales/tg/translation.json +71 -0
- package/dist/locales/tg/widget.json +149 -0
- package/dist/locales/th/target.json +301 -0
- package/dist/locales/th/translation.json +0 -446
- package/dist/locales/th/widget.json +149 -0
- package/dist/locales/tr/target.json +301 -0
- package/dist/locales/tr/translation.json +6 -452
- package/dist/locales/tr/widget.json +149 -0
- package/dist/locales/uk/target.json +301 -0
- package/dist/locales/uk/translation.json +47 -493
- package/dist/locales/uk/widget.json +149 -0
- package/dist/locales/ur/target.json +301 -0
- package/dist/locales/ur/translation.json +71 -0
- package/dist/locales/ur/widget.json +149 -0
- package/dist/locales/uz/target.json +301 -0
- package/dist/locales/uz/translation.json +71 -0
- package/dist/locales/uz/widget.json +149 -0
- package/dist/locales/vi/target.json +301 -0
- package/dist/locales/vi/translation.json +0 -446
- package/dist/locales/vi/widget.json +149 -0
- package/dist/locales/xh/target.json +301 -0
- package/dist/locales/xh/translation.json +71 -0
- package/dist/locales/xh/widget.json +149 -0
- package/dist/locales/zh/target.json +301 -0
- package/dist/locales/zh/translation.json +71 -0
- package/dist/locales/zh/widget.json +149 -0
- package/dist/locales/zh-CN/target.json +301 -0
- package/dist/locales/zh-CN/translation.json +0 -446
- package/dist/locales/zh-CN/widget.json +149 -0
- package/dist/locales/zh-HK/target.json +301 -0
- package/dist/locales/zh-HK/translation.json +71 -0
- package/dist/locales/zh-HK/widget.json +149 -0
- package/dist/locales/zh-TW/target.json +301 -0
- package/dist/locales/zh-TW/translation.json +71 -0
- package/dist/locales/zh-TW/widget.json +149 -0
- package/dist/locales/zu/target.json +301 -0
- package/dist/locales/zu/translation.json +71 -0
- package/dist/locales/zu/widget.json +149 -0
- package/dist/requestLanguageDetector.d.ts +3 -0
- package/dist/requestLanguageDetector.d.ts.map +1 -0
- package/dist/requestLanguageDetector.js +24 -0
- package/dist/requestLanguageDetector.js.map +1 -0
- package/dist/serverTranslationKeys.d.ts +7 -0
- package/dist/serverTranslationKeys.d.ts.map +1 -0
- package/dist/serverTranslationKeys.js +34 -0
- package/dist/serverTranslationKeys.js.map +1 -0
- package/dist/tests/browserBundle.unit.test.d.ts +2 -0
- package/dist/tests/browserBundle.unit.test.d.ts.map +1 -0
- package/dist/tests/browserBundle.unit.test.js +26 -0
- package/dist/tests/browserBundle.unit.test.js.map +1 -0
- package/dist/tests/browserUiLanguages.unit.test.d.ts +2 -0
- package/dist/tests/browserUiLanguages.unit.test.d.ts.map +1 -0
- package/dist/tests/browserUiLanguages.unit.test.js +55 -0
- package/dist/tests/browserUiLanguages.unit.test.js.map +1 -0
- package/dist/tests/catalogues.test-d.d.ts +2 -0
- package/dist/tests/catalogues.test-d.d.ts.map +1 -0
- package/dist/tests/catalogues.test-d.js +766 -0
- package/dist/tests/catalogues.test-d.js.map +1 -0
- package/dist/tests/direction.unit.test.js +216 -5
- package/dist/tests/direction.unit.test.js.map +1 -1
- package/dist/tests/errorMessage.unit.test.js +9 -1
- package/dist/tests/errorMessage.unit.test.js.map +1 -1
- package/dist/tests/i18SharedOptions.unit.test.js +0 -4
- package/dist/tests/i18SharedOptions.unit.test.js.map +1 -1
- package/dist/tests/i18nBackend.unit.test.js +100 -21
- package/dist/tests/i18nBackend.unit.test.js.map +1 -1
- package/dist/tests/i18nBackendFiles.unit.test.d.ts +2 -0
- package/dist/tests/i18nBackendFiles.unit.test.d.ts.map +1 -0
- package/dist/tests/i18nBackendFiles.unit.test.js +22 -0
- package/dist/tests/i18nBackendFiles.unit.test.js.map +1 -0
- package/dist/tests/i18nFrontend.unit.test.js +90 -54
- package/dist/tests/i18nFrontend.unit.test.js.map +1 -1
- package/dist/tests/keptAsIs.d.ts +4 -0
- package/dist/tests/keptAsIs.d.ts.map +1 -0
- package/dist/tests/keptAsIs.js +1236 -0
- package/dist/tests/keptAsIs.js.map +1 -0
- package/dist/tests/languagePreference.unit.test.d.ts +2 -0
- package/dist/tests/languagePreference.unit.test.d.ts.map +1 -0
- package/dist/tests/languagePreference.unit.test.js +204 -0
- package/dist/tests/languagePreference.unit.test.js.map +1 -0
- package/dist/tests/locale.test-d.js +20 -1
- package/dist/tests/locale.test-d.js.map +1 -1
- package/dist/tests/localePlaceholders.unit.test.js +5 -2
- package/dist/tests/localePlaceholders.unit.test.js.map +1 -1
- package/dist/tests/locales.unit.test.js +136 -43
- package/dist/tests/locales.unit.test.js.map +1 -1
- package/dist/tests/requestLanguageDetector.unit.test.d.ts +2 -0
- package/dist/tests/requestLanguageDetector.unit.test.d.ts.map +1 -0
- package/dist/tests/requestLanguageDetector.unit.test.js +106 -0
- package/dist/tests/requestLanguageDetector.unit.test.js.map +1 -0
- package/dist/tests/thrownErrorKeys.unit.test.js +2 -10
- package/dist/tests/thrownErrorKeys.unit.test.js.map +1 -1
- package/dist/tests/translationKey.unit.test.js +110 -5
- package/dist/tests/translationKey.unit.test.js.map +1 -1
- package/dist/tests/translations.unit.test.js +9 -5
- package/dist/tests/translations.unit.test.js.map +1 -1
- package/dist/tests/translator.unit.test.js +8 -2
- package/dist/tests/translator.unit.test.js.map +1 -1
- package/dist/translationKey.d.ts +16 -4
- package/dist/translationKey.d.ts.map +1 -1
- package/dist/translationKey.js +27 -6
- package/dist/translationKey.js.map +1 -1
- package/dist/translations.d.ts +63 -2
- package/dist/translations.d.ts.map +1 -1
- package/dist/translations.js +63 -2
- package/dist/translations.js.map +1 -1
- package/dist/translator.d.ts +2 -2
- package/dist/translator.d.ts.map +1 -1
- package/dist/translator.js +2 -1
- package/dist/translator.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const require_languagePreference = require("./languagePreference.cjs");
|
|
2
|
+
let i18next_http_middleware = require("i18next-http-middleware");
|
|
3
|
+
//#region src/requestLanguageDetector.ts
|
|
4
|
+
var DETECTOR_NAME = "prosopo";
|
|
5
|
+
/**
|
|
6
|
+
* The provider's request language detector: `?lng=`, then the Prosopo-Lang
|
|
7
|
+
* header, then Accept-Language, negotiated exactly as the widget negotiates
|
|
8
|
+
* (languagePreference.ts). It replaces the middleware's built-in
|
|
9
|
+
* header/query/cookie order, which read the cookie (set by the host site, not
|
|
10
|
+
* by us) and did not map `nb`/`nn` to `no`. Nothing is cached in a cookie.
|
|
11
|
+
*/
|
|
12
|
+
var createRequestLanguageDetector = () => {
|
|
13
|
+
const detector = new i18next_http_middleware.LanguageDetector(null, {
|
|
14
|
+
order: [DETECTOR_NAME],
|
|
15
|
+
caches: false
|
|
16
|
+
});
|
|
17
|
+
detector.addDetector({
|
|
18
|
+
name: DETECTOR_NAME,
|
|
19
|
+
lookup: (request) => require_languagePreference.requestLanguage(request)
|
|
20
|
+
});
|
|
21
|
+
return detector;
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.createRequestLanguageDetector = createRequestLanguageDetector;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const require_target = require("./locales/en/target.cjs");
|
|
2
|
+
const require_translation = require("./locales/en/translation.cjs");
|
|
3
|
+
const require_widget = require("./locales/en/widget.cjs");
|
|
4
|
+
const require_translationKey = require("./translationKey.cjs");
|
|
5
|
+
//#region src/serverTranslationKeys.ts
|
|
6
|
+
var translationEn = {
|
|
7
|
+
...require_translation.default,
|
|
8
|
+
...require_widget.default,
|
|
9
|
+
...require_target.default
|
|
10
|
+
};
|
|
11
|
+
var translationKeys = require_translationKey.getLeafFieldPath(translationEn);
|
|
12
|
+
var translationKeySet = new Set(translationKeys);
|
|
13
|
+
/** For keys that only exist at runtime, e.g. an error message. */
|
|
14
|
+
var isTranslationKey = (value) => translationKeySet.has(value);
|
|
15
|
+
var targetKeys = Object.keys(require_target.default.TARGET);
|
|
16
|
+
var targetKeySet = new Set(targetKeys);
|
|
17
|
+
/**
|
|
18
|
+
* For a dataset's target, which is only known at runtime. A dataset can carry
|
|
19
|
+
* a label the catalogue does not have yet, so callers must handle `false`.
|
|
20
|
+
*/
|
|
21
|
+
var isTargetKey = (value) => targetKeySet.has(value);
|
|
22
|
+
/**
|
|
23
|
+
* The English text for a key, whatever the request's language. The provider
|
|
24
|
+
* sends it beside translated text the widget cannot look up itself (image
|
|
25
|
+
* labels, server-only errors), so logs and crash reports can be read in
|
|
26
|
+
* English. Read from the bundled catalogues, not i18next, so it cannot depend
|
|
27
|
+
* on which languages the server has loaded.
|
|
28
|
+
*/
|
|
29
|
+
var englishText = (key) => {
|
|
30
|
+
const text = key.split(".").reduce((node, part) => typeof node === "object" ? node[part] : void 0, translationEn);
|
|
31
|
+
return typeof text === "string" ? text : key;
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.englishText = englishText;
|
|
35
|
+
exports.isTargetKey = isTargetKey;
|
|
36
|
+
exports.isTranslationKey = isTranslationKey;
|
|
37
|
+
exports.targetKeys = targetKeys;
|
|
38
|
+
exports.translationKeys = translationKeys;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_widget = require("./locales/en/widget.cjs");
|
|
2
2
|
//#region src/translationKey.ts
|
|
3
|
+
/**
|
|
4
|
+
* The catalogue is split into i18next namespaces so the browser downloads only
|
|
5
|
+
* what it renders. Keys keep their section prefix (`WIDGET.`, `TARGET.`), so a
|
|
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.
|
|
10
|
+
* - `target`: image labels. The provider translates these into the challenge.
|
|
11
|
+
* - `translation` (i18next's default): server-only text (DATABASE, DATASET,
|
|
12
|
+
* CONTRACT, CONFIG, PORTAL, CLI, FS).
|
|
13
|
+
*/
|
|
14
|
+
var NAMESPACES = {
|
|
15
|
+
widget: "widget",
|
|
16
|
+
target: "target",
|
|
17
|
+
server: "translation"
|
|
18
|
+
};
|
|
3
19
|
function getLeafFieldPath(obj) {
|
|
4
20
|
if (typeof obj === "string") return [];
|
|
5
21
|
return Object.keys(obj).reduce((arr, key) => {
|
|
@@ -12,11 +28,17 @@ function getLeafFieldPath(obj) {
|
|
|
12
28
|
}));
|
|
13
29
|
}, []);
|
|
14
30
|
}
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
var widgetKeySet = new Set(getLeafFieldPath(require_widget.default));
|
|
32
|
+
/** For a key from the provider, e.g. an error: can the widget translate it? */
|
|
33
|
+
var isWidgetTranslationKey = (value) => widgetKeySet.has(value);
|
|
34
|
+
/**
|
|
35
|
+
* For a key only known at runtime, e.g. an error message: does this instance
|
|
36
|
+
* have text for it? Every catalogue has English's keys, so a key it has text
|
|
37
|
+
* for is a `TranslationKey`.
|
|
38
|
+
*/
|
|
39
|
+
var canTranslate = (i18n, value) => i18n.exists(value);
|
|
19
40
|
//#endregion
|
|
41
|
+
exports.NAMESPACES = NAMESPACES;
|
|
42
|
+
exports.canTranslate = canTranslate;
|
|
20
43
|
exports.getLeafFieldPath = getLeafFieldPath;
|
|
21
|
-
exports.
|
|
22
|
-
exports.translationKeys = translationKeys;
|
|
44
|
+
exports.isWidgetTranslationKey = isWidgetTranslationKey;
|
|
@@ -1,37 +1,98 @@
|
|
|
1
1
|
//#region src/translations.ts
|
|
2
2
|
var Languages = {
|
|
3
|
+
afrikaans: "af",
|
|
4
|
+
amharic: "am",
|
|
5
|
+
aragonese: "an",
|
|
3
6
|
arabic: "ar",
|
|
7
|
+
assamese: "as",
|
|
8
|
+
asturian: "ast",
|
|
4
9
|
azerbaijani: "az",
|
|
10
|
+
belarusian: "be",
|
|
11
|
+
bulgarian: "bg",
|
|
12
|
+
bengali: "bn",
|
|
13
|
+
bosnian: "bs",
|
|
14
|
+
catalan: "ca",
|
|
5
15
|
czech: "cs",
|
|
16
|
+
welsh: "cy",
|
|
17
|
+
danish: "da",
|
|
6
18
|
german: "de",
|
|
7
19
|
greek: "el",
|
|
8
20
|
english: "en",
|
|
21
|
+
esperanto: "eo",
|
|
9
22
|
spanish: "es",
|
|
23
|
+
estonian: "et",
|
|
24
|
+
basque: "eu",
|
|
25
|
+
persian: "fa",
|
|
10
26
|
finnish: "fi",
|
|
27
|
+
filipino: "fil",
|
|
11
28
|
french: "fr",
|
|
29
|
+
frisian: "fy",
|
|
30
|
+
irish: "ga",
|
|
31
|
+
scottishGaelic: "gd",
|
|
32
|
+
galician: "gl",
|
|
33
|
+
gujarati: "gu",
|
|
34
|
+
hebrew: "he",
|
|
12
35
|
hindi: "hi",
|
|
36
|
+
croatian: "hr",
|
|
13
37
|
hungarian: "hu",
|
|
38
|
+
armenian: "hy",
|
|
39
|
+
interlingua: "ia",
|
|
14
40
|
indonesian: "id",
|
|
41
|
+
icelandic: "is",
|
|
15
42
|
italian: "it",
|
|
16
43
|
japanese: "ja",
|
|
17
44
|
javanese: "jv",
|
|
45
|
+
georgian: "ka",
|
|
46
|
+
kazakh: "kk",
|
|
47
|
+
khmer: "km",
|
|
48
|
+
kannada: "kn",
|
|
18
49
|
korean: "ko",
|
|
50
|
+
kyrgyz: "ky",
|
|
51
|
+
lao: "lo",
|
|
52
|
+
lithuanian: "lt",
|
|
53
|
+
latvian: "lv",
|
|
54
|
+
macedonian: "mk",
|
|
19
55
|
malayalam: "ml",
|
|
56
|
+
mongolian: "mn",
|
|
57
|
+
marathi: "mr",
|
|
20
58
|
malay: "ms",
|
|
59
|
+
burmese: "my",
|
|
60
|
+
nepali: "ne",
|
|
21
61
|
dutch: "nl",
|
|
62
|
+
norwegianNynorsk: "nn",
|
|
22
63
|
norwegian: "no",
|
|
64
|
+
occitan: "oc",
|
|
65
|
+
odia: "or",
|
|
66
|
+
punjabi: "pa",
|
|
23
67
|
polish: "pl",
|
|
24
|
-
portugeseBrazil: "pt-BR",
|
|
25
68
|
portuguese: "pt",
|
|
69
|
+
portugeseBrazil: "pt-BR",
|
|
70
|
+
romansh: "rm",
|
|
26
71
|
romanian: "ro",
|
|
27
72
|
russian: "ru",
|
|
73
|
+
scots: "sco",
|
|
74
|
+
sinhala: "si",
|
|
75
|
+
slovak: "sk",
|
|
76
|
+
slovenian: "sl",
|
|
77
|
+
albanian: "sq",
|
|
28
78
|
serbian: "sr",
|
|
29
79
|
swedish: "sv",
|
|
80
|
+
swahili: "sw",
|
|
81
|
+
tamil: "ta",
|
|
82
|
+
telugu: "te",
|
|
83
|
+
tajik: "tg",
|
|
30
84
|
thai: "th",
|
|
31
85
|
turkish: "tr",
|
|
32
86
|
ukrainian: "uk",
|
|
87
|
+
urdu: "ur",
|
|
88
|
+
uzbek: "uz",
|
|
33
89
|
vietnamese: "vi",
|
|
34
|
-
|
|
90
|
+
xhosa: "xh",
|
|
91
|
+
chinese: "zh",
|
|
92
|
+
chineseChina: "zh-CN",
|
|
93
|
+
chineseHongKong: "zh-HK",
|
|
94
|
+
chineseTaiwan: "zh-TW",
|
|
95
|
+
zulu: "zu"
|
|
35
96
|
};
|
|
36
97
|
var LanguageCodes = Object.values(Languages);
|
|
37
98
|
var isLanguage = (value) => LanguageCodes.includes(value);
|
package/dist/cjs/translator.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
const require_translationKey = require("./translationKey.cjs");
|
|
1
2
|
const require_i18nFrontend = require("./i18nFrontend.cjs");
|
|
2
3
|
//#region src/translator.ts
|
|
3
|
-
var NAMESPACE =
|
|
4
|
+
var NAMESPACE = require_translationKey.NAMESPACES.widget;
|
|
4
5
|
/**
|
|
5
6
|
* Vanilla replacement for the `useTranslation` hook: the instance's `t` plus
|
|
6
7
|
* the three events that used to trigger a React re-render.
|
package/dist/direction.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../src/direction.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../src/direction.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,CAAC;AAmG1C,eAAO,MAAM,oBAAoB,aAAc,MAAM,KAAG,aACO,CAAC"}
|
package/dist/direction.js
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
//#region src/direction.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
]);
|
|
14
|
-
var getLanguageDirection = (language) => {
|
|
15
|
-
const primary = language.split(/[-_]/)[0]?.toLowerCase() ?? "";
|
|
16
|
-
return RTL_LANGUAGES.has(primary) ? "rtl" : "ltr";
|
|
2
|
+
var words = (list) => new Set(list.split(" "));
|
|
3
|
+
var RTL_SCRIPTS = words("adlm arab armi avst chrs cprt elym gara hatr hebr hung khar lydi mand mani mend merc mero narb nbat nkoo orkh ougr palm phli phlp phnx prti rohg samr sarb sidt sogd sogo syrc thaa yezi");
|
|
4
|
+
var RTL_LANGUAGES = words("aao abh abv acm acq acw acx adf ae aeb aec aee aeq afb aib aii aij aiq ajp ajt aju amw apc apd ar ara arb arc arq ars ary arz ask atn auj auz avd ave avl ayh ayl ayn ayp azb bal bcc bdz bej bft bgn bgp bhe bhm bhn bjf bjm bqi brh brk bsh bsk chg cja ckb cld clh czk dcc def deh dgl div dmk dml drw dv ecy esh fa fas fay faz fia fub gbz ggg gha ghr gig gjk gju glh glk grr gwc gwf gwt gzi hac haz hbo he heb hkh hnd hno hoh hrt hrz hss huy isk itk iw jad jat jbe jbn jdg ji jnd jog jpa jpr jrb jye kas kbu kby kcy kfm khw klj kmz kqd ks ktl kvx kxp kzh lad lah lhs lki lrc lrk lrl lsa lsd lss luv luz mby mde mey mfa mfi mhj mid mki mnj mve mvy myz mzb mzn nli nlm nqo ntz nyq oar obm odk oru ota otk oui pal pbt pbu per pes pgd phl phn phr phv plk pmu pnb prc prd prs prx ps psh psi pst pus qxq rdb rhg rmt sam sbn scl sd sdb sdf sdg sdh sds sgl sgr sgy shd shm shu shv siy siz skr smp smy snd sog sqo sqt srh srz ssh sts swb syc syn syr tjo tks tmr tnf tov tra trg trm trw ug uig ur urd ush uzs vaf vgr vmh wbk wlo wne wni wsv xco xhe xka xkc xkj xkp xld xly xmn xmr xna xpr xsa xsd xvi ydd ydg yhd yi yid yih yud zba zdj zrp zum");
|
|
5
|
+
var RTL_LANGUAGE_REGIONS = words("az-iq az-ir ha-cm ha-sd kk-af kk-cn kk-ir kk-mn ku-iq ku-ir ku-lb ky-cn ms-cc pa-pk tg-pk uz-af");
|
|
6
|
+
var isRtlByIntl = (tag) => {
|
|
7
|
+
try {
|
|
8
|
+
const locale = new Intl.Locale(tag);
|
|
9
|
+
return (typeof locale.getTextInfo === "function" ? locale.getTextInfo() : locale.textInfo)?.direction === "rtl";
|
|
10
|
+
} catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
17
13
|
};
|
|
14
|
+
var SCRIPT_SUBTAG = /^[a-z]{4}$/;
|
|
15
|
+
var REGION_SUBTAG = /^([a-z]{2}|[0-9]{3})$/;
|
|
16
|
+
var isRtlByList = (tag) => {
|
|
17
|
+
const [language = "", ...subtags] = tag.toLowerCase().split(/[-_]/);
|
|
18
|
+
const extensionStart = subtags.findIndex((subtag) => subtag.length === 1);
|
|
19
|
+
const own = extensionStart === -1 ? subtags : subtags.slice(0, extensionStart);
|
|
20
|
+
const script = own.find((subtag) => SCRIPT_SUBTAG.test(subtag));
|
|
21
|
+
if (script) return RTL_SCRIPTS.has(script);
|
|
22
|
+
const region = own.find((subtag) => REGION_SUBTAG.test(subtag));
|
|
23
|
+
return RTL_LANGUAGES.has(language) || region !== void 0 && RTL_LANGUAGE_REGIONS.has(`${language}-${region}`);
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The direction a BCP 47 tag is written in. Right to left if our CLDR lists
|
|
27
|
+
* say so or the browser's Intl does: the lists give every browser the same
|
|
28
|
+
* answer for the languages they know, and Intl covers languages CLDR adds
|
|
29
|
+
* after them. An explicit script wins over the language and region (`pa-Arab`
|
|
30
|
+
* is rtl, `az-Latn-IR` ltr).
|
|
31
|
+
*/
|
|
32
|
+
var getLanguageDirection = (language) => isRtlByList(language) || isRtlByIntl(language) ? "rtl" : "ltr";
|
|
18
33
|
//#endregion
|
|
19
34
|
export { getLanguageDirection };
|
package/dist/direction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direction.js","sourceRoot":"","sources":["../src/direction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"direction.js","sourceRoot":"","sources":["../src/direction.ts"],"names":[],"mappings":"AAsBA,MAAM,KAAK,GAAG,CAAC,IAAY,EAAuB,EAAE,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE9E,MAAM,WAAW,GAAG,KAAK,CACxB,mEAAmE;IAClE,mEAAmE;IACnE,wDAAwD,CACzD,CAAC;AAKF,MAAM,aAAa,GAAG,KAAK,CAC1B,qEAAqE;IACpE,qEAAqE;IACrE,kEAAkE;IAClE,kEAAkE;IAClE,oEAAoE;IACpE,kEAAkE;IAClE,oEAAoE;IACpE,qEAAqE;IACrE,qEAAqE;IACrE,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I,CAAC,MAAM,CAAC,CAAC,CAAC;IACxE,IAAI,MAAM,EAAE,CAAC;QACZ,OAAO,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACxE,OAAO,CACN,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC3B,CAAC,MAAM,KAAK,SAAS,IAAI,oBAAoB,CAAC,GAAG,CAAC,GAAG,QAAQ,IAAI,MAAM,EAAE,CAAC,CAAC,CAC3E,CAAC;AACH,CAAC,CAAC;AASF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAgB,EAAiB,EAAE,CACvE,WAAW,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC"}
|
|
@@ -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;
|
|
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"}
|
package/dist/errorMessage.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isWidgetTranslationKey } from "./translationKey.js";
|
|
2
2
|
//#region src/errorMessage.ts
|
|
3
3
|
/**
|
|
4
4
|
* The provider translates error messages into the request's Accept-Language,
|
|
5
5
|
* which is the browser's language rather than the widget's. Re-translating the
|
|
6
6
|
* error key on the client shows the error in the language the widget renders
|
|
7
|
-
* in. Free text and keys the
|
|
7
|
+
* in. Free text and keys outside the widget namespace (which the browser has no
|
|
8
|
+
* text for) keep the server's message.
|
|
8
9
|
*/
|
|
9
10
|
var localiseErrorMessage = (i18n, error) => {
|
|
10
11
|
const { key, message } = error;
|
|
11
|
-
if (!key || !
|
|
12
|
+
if (!key || !isWidgetTranslationKey(key) || !i18n?.isInitialized) return message;
|
|
12
13
|
return i18n.t(key, { defaultValue: message });
|
|
13
14
|
};
|
|
14
15
|
//#endregion
|
package/dist/errorMessage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorMessage.js","sourceRoot":"","sources":["../src/errorMessage.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18SharedOptions.d.ts","sourceRoot":"","sources":["../src/i18SharedOptions.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"i18SharedOptions.d.ts","sourceRoot":"","sources":["../src/i18SharedOptions.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,iBAAiB;;;;;CAK7B,CAAC"}
|
package/dist/i18SharedOptions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18SharedOptions.js","sourceRoot":"","sources":["../src/i18SharedOptions.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAM7D,MAAM,QAAQ,GAAG,UAAU,EAAE,EAAE,GAAG,EAAE,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,KAAK,EAAE,QAAQ,KAAK,OAAO;IAC3B,WAAW,EAAE,SAAS,CAAC,OAAO;IAC9B,
|
|
1
|
+
{"version":3,"file":"i18SharedOptions.js","sourceRoot":"","sources":["../src/i18SharedOptions.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAM7D,MAAM,QAAQ,GAAG,UAAU,EAAE,EAAE,GAAG,EAAE,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,KAAK,EAAE,QAAQ,KAAK,OAAO;IAC3B,WAAW,EAAE,SAAS,CAAC,OAAO;IAC9B,aAAa,EAAE,aAAa;IAC5B,wBAAwB,EAAE,KAAK;CAC/B,CAAC"}
|
package/dist/i18nBackend.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import i18n from "i18next";
|
|
1
|
+
import i18n, { type BackendModule, type NewableModule } from "i18next";
|
|
2
|
+
export declare const localesDirectory: (moduleDirectory: string, exists?: (file: string) => boolean) => string;
|
|
3
|
+
export declare const fsBackend: (loaded?: unknown) => NewableModule<BackendModule>;
|
|
2
4
|
export declare function initializeI18n(i18nLoadedCallback?: (value: typeof i18n) => void): import("i18next").i18n;
|
|
3
5
|
export default initializeI18n;
|
|
4
6
|
//# sourceMappingURL=i18nBackend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nBackend.d.ts","sourceRoot":"","sources":["../src/i18nBackend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18nBackend.d.ts","sourceRoot":"","sources":["../src/i18nBackend.ts"],"names":[],"mappings":"AAiBA,OAAO,IAAI,EAAE,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AASvE,eAAO,MAAM,gBAAgB,oBACX,MAAM,WACf,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,KAC/B,MAMF,CAAC;AAmBF,eAAO,MAAM,SAAS,YACb,OAAO,KACb,aAAa,CAAC,aAAa,CAK7B,CAAC;AAEF,wBAAgB,cAAc,CAC7B,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,IAAI,KAAK,IAAI,0BAqCjD;AAED,eAAe,cAAc,CAAC"}
|
package/dist/i18nBackend.js
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
import "./_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { isServerSide } from "./util.js";
|
|
3
|
+
import { NAMESPACES } from "./translationKey.js";
|
|
3
4
|
import { i18nSharedOptions } from "./i18SharedOptions.js";
|
|
5
|
+
import { createRequestLanguageDetector } from "./requestLanguageDetector.js";
|
|
4
6
|
import i18n from "i18next";
|
|
5
|
-
import {
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
6
8
|
import path from "node:path";
|
|
7
|
-
import
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import FSBackendCjs from "i18next-fs-backend/cjs";
|
|
8
11
|
//#region src/i18nBackend.ts
|
|
9
|
-
var
|
|
12
|
+
var localesDirectory = (moduleDirectory, exists = existsSync) => {
|
|
13
|
+
const beside = path.join(moduleDirectory, "locales");
|
|
14
|
+
const above = path.join(moduleDirectory, "..", "locales");
|
|
15
|
+
const hasCatalogues = (directory) => exists(path.join(directory, "en", `${NAMESPACES.server}.json`));
|
|
16
|
+
return !hasCatalogues(beside) && hasCatalogues(above) ? above : beside;
|
|
17
|
+
};
|
|
18
|
+
var loadPath = path.join(localesDirectory(path.dirname(fileURLToPath(import.meta.url))), "{{lng}}", "{{ns}}.json");
|
|
19
|
+
var isBackendClass = (value) => typeof value === "function" && "type" in value && value.type === "backend";
|
|
20
|
+
var fsBackend = (loaded = FSBackendCjs) => {
|
|
21
|
+
if (!isBackendClass(loaded)) throw new Error("i18next-fs-backend/cjs did not export a backend class");
|
|
22
|
+
return loaded;
|
|
23
|
+
};
|
|
10
24
|
function initializeI18n(i18nLoadedCallback) {
|
|
11
|
-
if (!i18n.isInitialized && isServerSide()) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
notified = true;
|
|
26
|
-
i18nLoadedCallback?.(i18n);
|
|
27
|
-
});
|
|
28
|
-
} else i18nLoadedCallback?.(i18n);
|
|
25
|
+
if (!i18n.isInitialized && isServerSide()) i18n.use(fsBackend()).use(createRequestLanguageDetector()).init({
|
|
26
|
+
...i18nSharedOptions,
|
|
27
|
+
ns: [
|
|
28
|
+
NAMESPACES.server,
|
|
29
|
+
NAMESPACES.widget,
|
|
30
|
+
NAMESPACES.target
|
|
31
|
+
],
|
|
32
|
+
defaultNS: NAMESPACES.server,
|
|
33
|
+
fallbackNS: [NAMESPACES.widget, NAMESPACES.target],
|
|
34
|
+
backend: { loadPath }
|
|
35
|
+
}, () => {
|
|
36
|
+
i18nLoadedCallback?.(i18n);
|
|
37
|
+
});
|
|
38
|
+
else i18nLoadedCallback?.(i18n);
|
|
29
39
|
return i18n;
|
|
30
40
|
}
|
|
31
41
|
//#endregion
|
|
32
|
-
export { initializeI18n as default, initializeI18n };
|
|
42
|
+
export { initializeI18n as default, initializeI18n, fsBackend, localesDirectory };
|
package/dist/i18nBackend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nBackend.js","sourceRoot":"","sources":["../src/i18nBackend.ts"],"names":[],"mappings":"AAcA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"i18nBackend.js","sourceRoot":"","sources":["../src/i18nBackend.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAgD,MAAM,SAAS,CAAC;AACvE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC/B,eAAuB,EACvB,SAAoC,UAAU,EACrC,EAAE;IACX,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC1D,MA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U,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;YAClD,OAAO,EAAE;gBACR,QAAQ;aACR;SACD,EAOD,GAAG,EAAE;YACJ,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CACD,CAAC;IACJ,CAAC;SAAM,CAAC;QAMP,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nFrontend.d.ts","sourceRoot":"","sources":["../src/i18nFrontend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18nFrontend.d.ts","sourceRoot":"","sources":["../src/i18nFrontend.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAa,KAAK,EAAoB,MAAM,YAAY,CAAC;AAqKrE,wBAAgB,cAAc,CAC7B,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,EAC3C,GAAG,CAAC,EAAE,MAAM,GACV,KAAK,CAeP;AAED,eAAe,cAAc,CAAC"}
|
package/dist/i18nFrontend.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { browserLanguages, matchLanguage, resolveLanguageList } from "./languagePreference.js";
|
|
3
|
+
import widget_default from "./locales/en/widget.js";
|
|
4
|
+
import { NAMESPACES } from "./translationKey.js";
|
|
2
5
|
import { i18nSharedOptions } from "./i18SharedOptions.js";
|
|
3
6
|
import { flatten } from "@prosopo/util";
|
|
4
7
|
//#region src/i18nFrontend.ts
|
|
5
|
-
var NAMESPACE =
|
|
8
|
+
var NAMESPACE = NAMESPACES.widget;
|
|
6
9
|
var FALLBACK_LANGUAGE = i18nSharedOptions.fallbackLng;
|
|
7
|
-
var STORAGE_KEY = "i18nextLng";
|
|
8
|
-
var COOKIE_KEY = "i18next";
|
|
9
|
-
var COOKIE_MAX_AGE_SECONDS = 10080 * 60;
|
|
10
10
|
/**
|
|
11
11
|
* How long to wait for a catalogue before rendering untranslated.
|
|
12
12
|
*
|
|
@@ -15,7 +15,12 @@ var COOKIE_MAX_AGE_SECONDS = 10080 * 60;
|
|
|
15
15
|
* catalogue that never arrives degrades rather than blocks.
|
|
16
16
|
*/
|
|
17
17
|
var CATALOGUE_FETCH_TIMEOUT_MS = 1e4;
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* English ships inside the bundle: the key checks in translationKey.ts import
|
|
20
|
+
* it anyway, and it means the widget always has English text, for its own
|
|
21
|
+
* fallback and for logs and crash reports, without a second fetch.
|
|
22
|
+
*/
|
|
23
|
+
var bundledEnglish = flatten(widget_default);
|
|
19
24
|
/**
|
|
20
25
|
* Locale JSON sits next to the bundle that asked for it. The widget is embedded
|
|
21
26
|
* by third parties and cannot know a base URL, but it does know where its own
|
|
@@ -26,63 +31,11 @@ var catalogueUrl = (language) => {
|
|
|
26
31
|
return `${moduleUrl.slice(0, moduleUrl.lastIndexOf("/"))}/locales/${language}/${NAMESPACE}.json`;
|
|
27
32
|
};
|
|
28
33
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
var resolveLanguage = (candidate) => {
|
|
33
|
-
if (!candidate) return;
|
|
34
|
-
if (SUPPORTED_LANGUAGES.includes(candidate)) return candidate;
|
|
35
|
-
const base = candidate.split("-")[0];
|
|
36
|
-
return base && SUPPORTED_LANGUAGES.includes(base) ? base : void 0;
|
|
37
|
-
};
|
|
38
|
-
var readCookie = () => {
|
|
39
|
-
try {
|
|
40
|
-
const match = document.cookie.match(new RegExp(`(?:^|; )${COOKIE_KEY}=([^;]*)`));
|
|
41
|
-
return match?.[1] ? decodeURIComponent(match[1]) : void 0;
|
|
42
|
-
} catch {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
var readStorage = () => {
|
|
47
|
-
try {
|
|
48
|
-
return localStorage.getItem(STORAGE_KEY) ?? void 0;
|
|
49
|
-
} catch {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var navigatorLanguages = () => {
|
|
54
|
-
try {
|
|
55
|
-
return navigator.languages?.length ? navigator.languages : [navigator.language];
|
|
56
|
-
} catch {
|
|
57
|
-
return [];
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Cookie and localStorage are both written, matching what the widget did when
|
|
62
|
-
* i18next-browser-languagedetector handled this, so a visitor's choice survives
|
|
63
|
-
* across pages that embed the widget. Either store can throw in a sandboxed
|
|
64
|
-
* iframe or with third-party storage blocked; neither is load-bearing.
|
|
34
|
+
* Only the browser's own list. Nothing is read from or written to cookies or
|
|
35
|
+
* storage: the widget runs on other people's sites, where the i18next cookie
|
|
36
|
+
* and `i18nextLng` key may belong to the site's own i18n.
|
|
65
37
|
*/
|
|
66
|
-
var
|
|
67
|
-
try {
|
|
68
|
-
localStorage.setItem(STORAGE_KEY, language);
|
|
69
|
-
} catch {}
|
|
70
|
-
try {
|
|
71
|
-
document.cookie = `${COOKIE_KEY}=${encodeURIComponent(language)};max-age=${COOKIE_MAX_AGE_SECONDS};path=/`;
|
|
72
|
-
} catch {}
|
|
73
|
-
};
|
|
74
|
-
var detectLanguage = () => {
|
|
75
|
-
const candidates = [
|
|
76
|
-
readCookie(),
|
|
77
|
-
readStorage(),
|
|
78
|
-
...navigatorLanguages()
|
|
79
|
-
];
|
|
80
|
-
for (const candidate of candidates) {
|
|
81
|
-
const resolved = resolveLanguage(candidate);
|
|
82
|
-
if (resolved) return resolved;
|
|
83
|
-
}
|
|
84
|
-
return FALLBACK_LANGUAGE;
|
|
85
|
-
};
|
|
38
|
+
var detectLanguage = () => matchLanguage(browserLanguages()) ?? FALLBACK_LANGUAGE;
|
|
86
39
|
var fetchCatalogue = async (language) => {
|
|
87
40
|
const controller = new AbortController();
|
|
88
41
|
const timer = setTimeout(() => controller.abort(), CATALOGUE_FETCH_TIMEOUT_MS);
|
|
@@ -99,26 +52,23 @@ var fetchCatalogue = async (language) => {
|
|
|
99
52
|
};
|
|
100
53
|
var interpolate = (template, options) => options ? template.replace(/\{\{(\w+)\}\}/g, (placeholder, name) => name in options ? String(options[name]) : placeholder) : template;
|
|
101
54
|
var createBrowserI18n = (requested) => {
|
|
102
|
-
const catalogues = /* @__PURE__ */ new Map();
|
|
55
|
+
const catalogues = /* @__PURE__ */ new Map([[FALLBACK_LANGUAGE, bundledEnglish]]);
|
|
103
56
|
const listeners = /* @__PURE__ */ new Map();
|
|
104
|
-
let language =
|
|
57
|
+
let language = resolveLanguageList(requested) ?? detectLanguage();
|
|
105
58
|
let initialised = false;
|
|
106
59
|
const emit = (event) => {
|
|
107
60
|
for (const listener of listeners.get(event) ?? []) listener();
|
|
108
61
|
};
|
|
109
62
|
/**
|
|
110
|
-
*
|
|
111
|
-
* missing from a translation still renders
|
|
112
|
-
*
|
|
63
|
+
* Only the active language's widget namespace is fetched. English is
|
|
64
|
+
* already loaded, so a key missing from a translation still renders
|
|
65
|
+
* English rather than its key, the key-level fallback i18next gives via
|
|
66
|
+
* `fallbackLng`.
|
|
113
67
|
*/
|
|
114
68
|
const loadCatalogues = async (target) => {
|
|
115
|
-
|
|
116
|
-
await Promise.all(wanted.map(async (candidate) => {
|
|
117
|
-
catalogues.set(candidate, await fetchCatalogue(candidate));
|
|
118
|
-
}));
|
|
69
|
+
if (!catalogues.has(target)) catalogues.set(target, await fetchCatalogue(target));
|
|
119
70
|
};
|
|
120
71
|
const lookup = (candidate, key) => catalogues.get(candidate)?.[key];
|
|
121
|
-
cacheLanguage(language);
|
|
122
72
|
const loading = loadCatalogues(language).then(() => {
|
|
123
73
|
initialised = true;
|
|
124
74
|
emit("initialized");
|
|
@@ -132,12 +82,12 @@ var createBrowserI18n = (requested) => {
|
|
|
132
82
|
return initialised;
|
|
133
83
|
},
|
|
134
84
|
t: (key, options) => interpolate(lookup(language, key) ?? lookup(FALLBACK_LANGUAGE, key) ?? options?.defaultValue ?? key, options),
|
|
85
|
+
exists: (key) => lookup(language, key) !== void 0 || lookup(FALLBACK_LANGUAGE, key) !== void 0,
|
|
135
86
|
hasLoadedNamespace: (namespace) => namespace === NAMESPACE && catalogues.has(language),
|
|
136
87
|
changeLanguage: async (next) => {
|
|
137
|
-
const resolved =
|
|
88
|
+
const resolved = resolveLanguageList(next) ?? FALLBACK_LANGUAGE;
|
|
138
89
|
if (resolved !== language) {
|
|
139
90
|
language = resolved;
|
|
140
|
-
cacheLanguage(resolved);
|
|
141
91
|
await loadCatalogues(resolved);
|
|
142
92
|
emit("loaded");
|
|
143
93
|
emit("languageChanged");
|
package/dist/i18nFrontend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nFrontend.js","sourceRoot":"","sources":["../src/i18nFrontend.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"i18nFrontend.js","sourceRoot":"","sources":["../src/i18nFrontend.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,QAAQ,MAAM,0BAA0B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC;AACpC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,WAAW,CAAC;AASxD,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAS1C,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