@unidy.io/sdk 1.1.8 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-Pb3mNuRv.js +10 -0
- package/dist/cjs/app-globals-Pb3mNuRv.js.map +1 -0
- package/dist/cjs/auth-ChsE2RD7.js +614 -0
- package/dist/cjs/auth-ChsE2RD7.js.map +1 -0
- package/dist/cjs/auth-store-BO38Txmj.js +187 -0
- package/dist/cjs/auth-store-BO38Txmj.js.map +1 -0
- package/dist/cjs/component-utils-bu3SY4dE.js +42 -0
- package/dist/cjs/component-utils-bu3SY4dE.js.map +1 -0
- package/dist/cjs/flash-store-D5vGuIFc.js +50 -0
- package/dist/cjs/flash-store-D5vGuIFc.js.map +1 -0
- package/dist/cjs/helpers-BcPlKlBG.js +11 -0
- package/dist/cjs/helpers-BcPlKlBG.js.map +1 -0
- package/dist/cjs/helpers-DJyRa0Qo.js +11 -0
- package/dist/cjs/helpers-DJyRa0Qo.js.map +1 -0
- package/dist/cjs/i18n-B2T1e9Mf.js +3072 -0
- package/dist/cjs/i18n-B2T1e9Mf.js.map +1 -0
- package/dist/cjs/index-BzhKFIXk.js +14706 -0
- package/dist/cjs/index-BzhKFIXk.js.map +1 -0
- package/dist/cjs/index-DmDGhWTM.js +6338 -0
- package/dist/cjs/index-DmDGhWTM.js.map +1 -0
- package/dist/cjs/index-DxENvy7x.js +283 -0
- package/dist/cjs/index-DxENvy7x.js.map +1 -0
- package/dist/cjs/index.cjs.js +64 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +14 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/newsletter-helpers-B5P7q8Xk.js +289 -0
- package/dist/cjs/newsletter-helpers-B5P7q8Xk.js.map +1 -0
- package/dist/cjs/newsletter-store-f5zhJljn.js +38 -0
- package/dist/cjs/newsletter-store-f5zhJljn.js.map +1 -0
- package/dist/cjs/pagination-store-DjGYEIqm.js +16 -0
- package/dist/cjs/pagination-store-DjGYEIqm.js.map +1 -0
- package/dist/cjs/profile-helpers-BcLjojeG.js +39 -0
- package/dist/cjs/profile-helpers-BcLjojeG.js.map +1 -0
- package/dist/cjs/profile-store-BWJ9qAcg.js +22 -0
- package/dist/cjs/profile-store-BWJ9qAcg.js.map +1 -0
- package/dist/cjs/sdk.cjs.js +53 -0
- package/dist/cjs/sdk.cjs.js.map +1 -0
- package/dist/cjs/u-conditional-render.cjs.entry.js +102 -0
- package/dist/cjs/u-conditional-render.entry.cjs.js.map +1 -0
- package/dist/cjs/u-config.cjs.entry.js +91 -0
- package/dist/cjs/u-config.entry.cjs.js.map +1 -0
- package/dist/cjs/u-email-field.cjs.entry.js +77 -0
- package/dist/cjs/u-email-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-error-message.cjs.entry.js +82 -0
- package/dist/cjs/u-error-message.entry.cjs.js.map +1 -0
- package/dist/cjs/u-field.u-raw-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-field_2.cjs.entry.js +371 -0
- package/dist/cjs/u-flash-message.cjs.entry.js +37 -0
- package/dist/cjs/u-flash-message.entry.cjs.js.map +1 -0
- package/dist/cjs/u-full-profile.cjs.entry.js +37 -0
- package/dist/cjs/u-full-profile.entry.cjs.js.map +1 -0
- package/dist/cjs/u-logout-button.u-signed-in.entry.cjs.js.map +1 -0
- package/dist/cjs/u-logout-button_2.cjs.entry.js +62 -0
- package/dist/cjs/u-magic-code-field.cjs.entry.js +91 -0
- package/dist/cjs/u-magic-code-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-missing-field.cjs.entry.js +22 -0
- package/dist/cjs/u-missing-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-missing-fields-submit-button.cjs.entry.js +46 -0
- package/dist/cjs/u-missing-fields-submit-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-checkbox.cjs.entry.js +77 -0
- package/dist/cjs/u-newsletter-checkbox.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-logout-button.cjs.entry.js +41 -0
- package/dist/cjs/u-newsletter-logout-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-preference-checkbox.cjs.entry.js +120 -0
- package/dist/cjs/u-newsletter-preference-checkbox.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-resend-doi-button.cjs.entry.js +49 -0
- package/dist/cjs/u-newsletter-resend-doi-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-root.cjs.entry.js +72 -0
- package/dist/cjs/u-newsletter-root.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-toggle-subscription-button.cjs.entry.js +73 -0
- package/dist/cjs/u-newsletter-toggle-subscription-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-pagination-button.cjs.entry.js +63 -0
- package/dist/cjs/u-pagination-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-pagination-page.cjs.entry.js +44 -0
- package/dist/cjs/u-pagination-page.entry.cjs.js.map +1 -0
- package/dist/cjs/u-passkey.cjs.entry.js +47 -0
- package/dist/cjs/u-passkey.entry.cjs.js.map +1 -0
- package/dist/cjs/u-password-field.cjs.entry.js +106 -0
- package/dist/cjs/u-password-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-profile.u-submit-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-profile_2.cjs.entry.js +329 -0
- package/dist/cjs/u-registration-button.cjs.entry.js +48 -0
- package/dist/cjs/u-registration-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-reset-password-button.cjs.entry.js +56 -0
- package/dist/cjs/u-reset-password-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-send-magic-code-button.cjs.entry.js +68 -0
- package/dist/cjs/u-send-magic-code-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-signin-root.cjs.entry.js +43 -0
- package/dist/cjs/u-signin-root.entry.cjs.js.map +1 -0
- package/dist/cjs/u-signin-step.cjs.entry.js +66 -0
- package/dist/cjs/u-signin-step.entry.cjs.js.map +1 -0
- package/dist/cjs/u-signin-strategy.cjs.entry.js +30 -0
- package/dist/cjs/u-signin-strategy.entry.cjs.js.map +1 -0
- package/dist/cjs/u-social-login-button.cjs.entry.js +100 -0
- package/dist/cjs/u-social-login-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-spinner.cjs.entry.js +18 -0
- package/dist/cjs/u-spinner.entry.cjs.js.map +1 -0
- package/dist/cjs/u-ticketable-list.cjs.entry.js +6097 -0
- package/dist/cjs/u-ticketable-list.entry.cjs.js.map +1 -0
- package/dist/cjs/unidy-store-zhdhlK0a.js +41 -0
- package/dist/cjs/unidy-store-zhdhlK0a.js.map +1 -0
- package/dist/collection/api/client.js +144 -0
- package/dist/collection/api/client.js.map +1 -0
- package/dist/collection/api/index.js +42 -0
- package/dist/collection/api/index.js.map +1 -0
- package/dist/collection/api/shared.js +18 -0
- package/dist/collection/api/shared.js.map +1 -0
- package/dist/collection/auth/api/auth.js +274 -0
- package/dist/collection/auth/api/auth.js.map +1 -0
- package/dist/collection/auth/auth-helpers.js +314 -0
- package/dist/collection/auth/auth-helpers.js.map +1 -0
- package/dist/collection/auth/auth.js +139 -0
- package/dist/collection/auth/auth.js.map +1 -0
- package/dist/collection/auth/components/helpers.js +5 -0
- package/dist/collection/auth/components/helpers.js.map +1 -0
- package/dist/collection/auth/components/logout-button/logout-button.js +94 -0
- package/dist/collection/auth/components/logout-button/logout-button.js.map +1 -0
- package/dist/collection/auth/components/magic-code-field/magic-code-field.css +1 -0
- package/dist/collection/auth/components/magic-code-field/magic-code-field.js +113 -0
- package/dist/collection/auth/components/magic-code-field/magic-code-field.js.map +1 -0
- package/dist/collection/auth/components/missing-field/missing-field.js +14 -0
- package/dist/collection/auth/components/missing-field/missing-field.js.map +1 -0
- package/dist/collection/auth/components/missing-fields-submit-button/missing-fields-submit-button.js +39 -0
- package/dist/collection/auth/components/missing-fields-submit-button/missing-fields-submit-button.js.map +1 -0
- package/dist/collection/auth/components/passkey/passkey.js +103 -0
- package/dist/collection/auth/components/passkey/passkey.js.map +1 -0
- package/dist/collection/auth/components/password-field/password-field.js +168 -0
- package/dist/collection/auth/components/password-field/password-field.js.map +1 -0
- package/dist/collection/auth/components/registration/registration-button.js +104 -0
- package/dist/collection/auth/components/registration/registration-button.js.map +1 -0
- package/dist/collection/auth/components/reset-pass-button/reset-pass-button.js +68 -0
- package/dist/collection/auth/components/reset-pass-button/reset-pass-button.js.map +1 -0
- package/dist/collection/auth/components/send-magic-code-button/send-magic-code-button.js +104 -0
- package/dist/collection/auth/components/send-magic-code-button/send-magic-code-button.js.map +1 -0
- package/dist/collection/auth/components/signed-in/signed-in.js +59 -0
- package/dist/collection/auth/components/signed-in/signed-in.js.map +1 -0
- package/dist/collection/auth/components/signin-root/signin-root.js +97 -0
- package/dist/collection/auth/components/signin-root/signin-root.js.map +1 -0
- package/dist/collection/auth/components/signin-step/signin-step.js +135 -0
- package/dist/collection/auth/components/signin-step/signin-step.js.map +1 -0
- package/dist/collection/auth/components/signin-strategy/signin-strategy.js +64 -0
- package/dist/collection/auth/components/signin-strategy/signin-strategy.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/apple.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/apple.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/discord.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/discord.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/facebook.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/facebook.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/google.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/google.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/linkedin.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/linkedin.js.map +1 -0
- package/dist/collection/auth/components/social-logins/social-login-button.css +1 -0
- package/dist/collection/auth/components/social-logins/social-login-button.js +188 -0
- package/dist/collection/auth/components/social-logins/social-login-button.js.map +1 -0
- package/dist/collection/auth/components/submit-button/auth-submit-button.js +62 -0
- package/dist/collection/auth/components/submit-button/auth-submit-button.js.map +1 -0
- package/dist/collection/auth/error-definitions.js +26 -0
- package/dist/collection/auth/error-definitions.js.map +1 -0
- package/dist/collection/auth/index.js +13 -0
- package/dist/collection/auth/index.js.map +1 -0
- package/dist/collection/auth/passkey-auth.js +106 -0
- package/dist/collection/auth/passkey-auth.js.map +1 -0
- package/dist/collection/auth/store/auth-store.js +178 -0
- package/dist/collection/auth/store/auth-store.js.map +1 -0
- package/dist/collection/collection-manifest.json +46 -0
- package/dist/collection/globalScript.js +18 -0
- package/dist/collection/globalScript.js.map +1 -0
- package/dist/collection/i18n.js +31 -0
- package/dist/collection/i18n.js.map +1 -0
- package/dist/collection/index.js +16 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/locales/de.json +133 -0
- package/dist/collection/locales/en.json +133 -0
- package/dist/collection/locales/fr.json +133 -0
- package/dist/collection/locales/it.json +133 -0
- package/dist/collection/locales/nl_be.json +133 -0
- package/dist/collection/locales/ro.json +133 -0
- package/dist/collection/logger.js +106 -0
- package/dist/collection/logger.js.map +1 -0
- package/dist/collection/newsletter/api/newsletters.js +189 -0
- package/dist/collection/newsletter/api/newsletters.js.map +1 -0
- package/dist/collection/newsletter/components/helpers.js +5 -0
- package/dist/collection/newsletter/components/helpers.js.map +1 -0
- package/dist/collection/newsletter/components/logout-button/logout-button.js +53 -0
- package/dist/collection/newsletter/components/logout-button/logout-button.js.map +1 -0
- package/dist/collection/newsletter/components/newsletter-checkbox/newsletter-checkbox.js +165 -0
- package/dist/collection/newsletter/components/newsletter-checkbox/newsletter-checkbox.js.map +1 -0
- package/dist/collection/newsletter/components/newsletter-root/newsletter-root.js +119 -0
- package/dist/collection/newsletter/components/newsletter-root/newsletter-root.js.map +1 -0
- package/dist/collection/newsletter/components/preference-checkbox/preference-checkbox.js +234 -0
- package/dist/collection/newsletter/components/preference-checkbox/preference-checkbox.js.map +1 -0
- package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.css +1 -0
- package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.js +89 -0
- package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.js.map +1 -0
- package/dist/collection/newsletter/components/submit-button/newsletter-submit-button.js +18 -0
- package/dist/collection/newsletter/components/submit-button/newsletter-submit-button.js.map +1 -0
- package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.css +1 -0
- package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.js +154 -0
- package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.js.map +1 -0
- package/dist/collection/newsletter/index.js +11 -0
- package/dist/collection/newsletter/index.js.map +1 -0
- package/dist/collection/newsletter/newsletter-helpers.js +277 -0
- package/dist/collection/newsletter/newsletter-helpers.js.map +1 -0
- package/dist/collection/newsletter/store/newsletter-store.js +34 -0
- package/dist/collection/newsletter/store/newsletter-store.js.map +1 -0
- package/dist/collection/profile/api/profile.js +168 -0
- package/dist/collection/profile/api/profile.js.map +1 -0
- package/dist/collection/profile/components/field/field.css +1 -0
- package/dist/collection/profile/components/field/field.js +355 -0
- package/dist/collection/profile/components/field/field.js.map +1 -0
- package/dist/collection/profile/components/full-profile/full-profile.css +1 -0
- package/dist/collection/profile/components/full-profile/full-profile.js +78 -0
- package/dist/collection/profile/components/full-profile/full-profile.js.map +1 -0
- package/dist/collection/profile/components/profile/profile.js +250 -0
- package/dist/collection/profile/components/profile/profile.js.map +1 -0
- package/dist/collection/profile/components/raw-field/raw-field.js +697 -0
- package/dist/collection/profile/components/raw-field/raw-field.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/Input.js +3 -0
- package/dist/collection/profile/components/raw-input-fields/Input.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/MultiSelect.js +8 -0
- package/dist/collection/profile/components/raw-input-fields/MultiSelect.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/RadioGroup.js +8 -0
- package/dist/collection/profile/components/raw-input-fields/RadioGroup.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/Select.js +11 -0
- package/dist/collection/profile/components/raw-input-fields/Select.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/Textarea.js +3 -0
- package/dist/collection/profile/components/raw-input-fields/Textarea.js.map +1 -0
- package/dist/collection/profile/components/submit-button/profile-submit-button.js +17 -0
- package/dist/collection/profile/components/submit-button/profile-submit-button.js.map +1 -0
- package/dist/collection/profile/index.js +12 -0
- package/dist/collection/profile/index.js.map +1 -0
- package/dist/collection/profile/profile-helpers.js +31 -0
- package/dist/collection/profile/profile-helpers.js.map +1 -0
- package/dist/collection/profile/store/profile-store.js +15 -0
- package/dist/collection/profile/store/profile-store.js.map +1 -0
- package/dist/collection/sdk.css +39 -0
- package/dist/collection/shared/component-utils.js +35 -0
- package/dist/collection/shared/component-utils.js.map +1 -0
- package/dist/collection/shared/components/conditional-render/conditional-render.js +177 -0
- package/dist/collection/shared/components/conditional-render/conditional-render.js.map +1 -0
- package/dist/collection/shared/components/config/config.js +284 -0
- package/dist/collection/shared/components/config/config.js.map +1 -0
- package/dist/collection/shared/components/email-field/email-field.css +1 -0
- package/dist/collection/shared/components/email-field/email-field.js +145 -0
- package/dist/collection/shared/components/email-field/email-field.js.map +1 -0
- package/dist/collection/shared/components/error-message/error-message.js +141 -0
- package/dist/collection/shared/components/error-message/error-message.js.map +1 -0
- package/dist/collection/shared/components/flash-message/close-icon.js +3 -0
- package/dist/collection/shared/components/flash-message/close-icon.js.map +1 -0
- package/dist/collection/shared/components/flash-message/flash-message.css +1 -0
- package/dist/collection/shared/components/flash-message/flash-message.js +79 -0
- package/dist/collection/shared/components/flash-message/flash-message.js.map +1 -0
- package/dist/collection/shared/components/spinner/spinner.css +1 -0
- package/dist/collection/shared/components/spinner/spinner.js +19 -0
- package/dist/collection/shared/components/spinner/spinner.js.map +1 -0
- package/dist/collection/shared/components/submit-button/context.js +10 -0
- package/dist/collection/shared/components/submit-button/context.js.map +1 -0
- package/dist/collection/shared/components/submit-button/submit-button.css +1 -0
- package/dist/collection/shared/components/submit-button/submit-button.js +198 -0
- package/dist/collection/shared/components/submit-button/submit-button.js.map +1 -0
- package/dist/collection/shared/store/flash-store.js +43 -0
- package/dist/collection/shared/store/flash-store.js.map +1 -0
- package/dist/collection/shared/store/unidy-store.js +33 -0
- package/dist/collection/shared/store/unidy-store.js.map +1 -0
- package/dist/collection/ticketable/api/get-with-schema.js +35 -0
- package/dist/collection/ticketable/api/get-with-schema.js.map +1 -0
- package/dist/collection/ticketable/api/schemas.js +12 -0
- package/dist/collection/ticketable/api/schemas.js.map +1 -0
- package/dist/collection/ticketable/api/subscriptions.js +47 -0
- package/dist/collection/ticketable/api/subscriptions.js.map +1 -0
- package/dist/collection/ticketable/api/tickets.js +48 -0
- package/dist/collection/ticketable/api/tickets.js.map +1 -0
- package/dist/collection/ticketable/components/pagination/pagination-button.js +108 -0
- package/dist/collection/ticketable/components/pagination/pagination-button.js.map +1 -0
- package/dist/collection/ticketable/components/pagination/pagination-page.js +69 -0
- package/dist/collection/ticketable/components/pagination/pagination-page.js.map +1 -0
- package/dist/collection/ticketable/components/ticketable-list/skeleton-helpers.js +54 -0
- package/dist/collection/ticketable/components/ticketable-list/skeleton-helpers.js.map +1 -0
- package/dist/collection/ticketable/components/ticketable-list/ticketable-list.js +505 -0
- package/dist/collection/ticketable/components/ticketable-list/ticketable-list.js.map +1 -0
- package/dist/collection/ticketable/index.js +13 -0
- package/dist/collection/ticketable/index.js.map +1 -0
- package/dist/collection/ticketable/store/pagination-store.js +9 -0
- package/dist/collection/ticketable/store/pagination-store.js.map +1 -0
- package/dist/components/auth-store.js +182 -0
- package/dist/components/auth-store.js.map +1 -0
- package/dist/components/auth.js +613 -0
- package/dist/components/auth.js.map +1 -0
- package/dist/components/component-utils.js +39 -0
- package/dist/components/component-utils.js.map +1 -0
- package/dist/components/exports.js +4262 -0
- package/dist/components/exports.js.map +1 -0
- package/dist/components/field.js +134 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/flash-store.js +47 -0
- package/dist/components/flash-store.js.map +1 -0
- package/dist/components/helpers.js +9 -0
- package/dist/components/helpers.js.map +1 -0
- package/dist/components/helpers2.js +9 -0
- package/dist/components/helpers2.js.map +1 -0
- package/dist/components/i18n.js +3070 -0
- package/dist/components/i18n.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +5929 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index2.js +6327 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/index3.js +281 -0
- package/dist/components/index3.js.map +1 -0
- package/dist/components/logger.js +111 -0
- package/dist/components/logger.js.map +1 -0
- package/dist/components/newsletter-helpers.js +278 -0
- package/dist/components/newsletter-helpers.js.map +1 -0
- package/dist/components/newsletter-store.js +34 -0
- package/dist/components/newsletter-store.js.map +1 -0
- package/dist/components/pagination-store.js +14 -0
- package/dist/components/pagination-store.js.map +1 -0
- package/dist/components/profile-helpers.js +36 -0
- package/dist/components/profile-helpers.js.map +1 -0
- package/dist/components/profile-store.js +18 -0
- package/dist/components/profile-store.js.map +1 -0
- package/dist/components/profile.js +151 -0
- package/dist/components/profile.js.map +1 -0
- package/dist/components/raw-field.js +318 -0
- package/dist/components/raw-field.js.map +1 -0
- package/dist/components/spinner.js +35 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/submit-button.js +233 -0
- package/dist/components/submit-button.js.map +1 -0
- package/dist/components/u-conditional-render.d.ts +11 -0
- package/dist/components/u-conditional-render.js +120 -0
- package/dist/components/u-conditional-render.js.map +1 -0
- package/dist/components/u-config.d.ts +11 -0
- package/dist/components/u-config.js +118 -0
- package/dist/components/u-config.js.map +1 -0
- package/dist/components/u-email-field.d.ts +11 -0
- package/dist/components/u-email-field.js +99 -0
- package/dist/components/u-email-field.js.map +1 -0
- package/dist/components/u-error-message.d.ts +11 -0
- package/dist/components/u-error-message.js +105 -0
- package/dist/components/u-error-message.js.map +1 -0
- package/dist/components/u-field.d.ts +11 -0
- package/dist/components/u-field.js +9 -0
- package/dist/components/u-field.js.map +1 -0
- package/dist/components/u-flash-message.d.ts +11 -0
- package/dist/components/u-flash-message.js +58 -0
- package/dist/components/u-flash-message.js.map +1 -0
- package/dist/components/u-full-profile.d.ts +11 -0
- package/dist/components/u-full-profile.js +87 -0
- package/dist/components/u-full-profile.js.map +1 -0
- package/dist/components/u-logout-button.d.ts +11 -0
- package/dist/components/u-logout-button.js +61 -0
- package/dist/components/u-logout-button.js.map +1 -0
- package/dist/components/u-magic-code-field.d.ts +11 -0
- package/dist/components/u-magic-code-field.js +106 -0
- package/dist/components/u-magic-code-field.js.map +1 -0
- package/dist/components/u-missing-field.d.ts +11 -0
- package/dist/components/u-missing-field.js +51 -0
- package/dist/components/u-missing-field.js.map +1 -0
- package/dist/components/u-missing-fields-submit-button.d.ts +11 -0
- package/dist/components/u-missing-fields-submit-button.js +70 -0
- package/dist/components/u-missing-fields-submit-button.js.map +1 -0
- package/dist/components/u-newsletter-checkbox.d.ts +11 -0
- package/dist/components/u-newsletter-checkbox.js +93 -0
- package/dist/components/u-newsletter-checkbox.js.map +1 -0
- package/dist/components/u-newsletter-logout-button.d.ts +11 -0
- package/dist/components/u-newsletter-logout-button.js +56 -0
- package/dist/components/u-newsletter-logout-button.js.map +1 -0
- package/dist/components/u-newsletter-preference-checkbox.d.ts +11 -0
- package/dist/components/u-newsletter-preference-checkbox.js +140 -0
- package/dist/components/u-newsletter-preference-checkbox.js.map +1 -0
- package/dist/components/u-newsletter-resend-doi-button.d.ts +11 -0
- package/dist/components/u-newsletter-resend-doi-button.js +70 -0
- package/dist/components/u-newsletter-resend-doi-button.js.map +1 -0
- package/dist/components/u-newsletter-root.d.ts +11 -0
- package/dist/components/u-newsletter-root.js +90 -0
- package/dist/components/u-newsletter-root.js.map +1 -0
- package/dist/components/u-newsletter-toggle-subscription-button.d.ts +11 -0
- package/dist/components/u-newsletter-toggle-subscription-button.js +97 -0
- package/dist/components/u-newsletter-toggle-subscription-button.js.map +1 -0
- package/dist/components/u-pagination-button.d.ts +11 -0
- package/dist/components/u-pagination-button.js +86 -0
- package/dist/components/u-pagination-button.js.map +1 -0
- package/dist/components/u-pagination-page.d.ts +11 -0
- package/dist/components/u-pagination-page.js +66 -0
- package/dist/components/u-pagination-page.js.map +1 -0
- package/dist/components/u-passkey.d.ts +11 -0
- package/dist/components/u-passkey.js +65 -0
- package/dist/components/u-passkey.js.map +1 -0
- package/dist/components/u-password-field.d.ts +11 -0
- package/dist/components/u-password-field.js +127 -0
- package/dist/components/u-password-field.js.map +1 -0
- package/dist/components/u-profile.d.ts +11 -0
- package/dist/components/u-profile.js +9 -0
- package/dist/components/u-profile.js.map +1 -0
- package/dist/components/u-raw-field.d.ts +11 -0
- package/dist/components/u-raw-field.js +9 -0
- package/dist/components/u-raw-field.js.map +1 -0
- package/dist/components/u-registration-button.d.ts +11 -0
- package/dist/components/u-registration-button.js +70 -0
- package/dist/components/u-registration-button.js.map +1 -0
- package/dist/components/u-reset-password-button.d.ts +11 -0
- package/dist/components/u-reset-password-button.js +72 -0
- package/dist/components/u-reset-password-button.js.map +1 -0
- package/dist/components/u-send-magic-code-button.d.ts +11 -0
- package/dist/components/u-send-magic-code-button.js +85 -0
- package/dist/components/u-send-magic-code-button.js.map +1 -0
- package/dist/components/u-signed-in.d.ts +11 -0
- package/dist/components/u-signed-in.js +44 -0
- package/dist/components/u-signed-in.js.map +1 -0
- package/dist/components/u-signin-root.d.ts +11 -0
- package/dist/components/u-signin-root.js +63 -0
- package/dist/components/u-signin-root.js.map +1 -0
- package/dist/components/u-signin-step.d.ts +11 -0
- package/dist/components/u-signin-step.js +84 -0
- package/dist/components/u-signin-step.js.map +1 -0
- package/dist/components/u-signin-strategy.d.ts +11 -0
- package/dist/components/u-signin-strategy.js +50 -0
- package/dist/components/u-signin-strategy.js.map +1 -0
- package/dist/components/u-social-login-button.d.ts +11 -0
- package/dist/components/u-social-login-button.js +125 -0
- package/dist/components/u-social-login-button.js.map +1 -0
- package/dist/components/u-spinner.d.ts +11 -0
- package/dist/components/u-spinner.js +9 -0
- package/dist/components/u-spinner.js.map +1 -0
- package/dist/components/u-submit-button.d.ts +11 -0
- package/dist/components/u-submit-button.js +9 -0
- package/dist/components/u-submit-button.js.map +1 -0
- package/dist/components/u-ticketable-list.d.ts +11 -0
- package/dist/components/u-ticketable-list.js +6130 -0
- package/dist/components/u-ticketable-list.js.map +1 -0
- package/dist/components/unidy-store.js +37 -0
- package/dist/components/unidy-store.js.map +1 -0
- package/dist/esm/app-globals-BHWOrMsm.js +8 -0
- package/dist/esm/app-globals-BHWOrMsm.js.map +1 -0
- package/dist/esm/auth-CAHM6e4m.js +612 -0
- package/dist/esm/auth-CAHM6e4m.js.map +1 -0
- package/dist/esm/auth-store-ItTnEMlF.js +182 -0
- package/dist/esm/auth-store-ItTnEMlF.js.map +1 -0
- package/dist/esm/component-utils-BGq0leDV.js +39 -0
- package/dist/esm/component-utils-BGq0leDV.js.map +1 -0
- package/dist/esm/flash-store-CMXH65i_.js +47 -0
- package/dist/esm/flash-store-CMXH65i_.js.map +1 -0
- package/dist/esm/helpers-BqFCd65h.js +9 -0
- package/dist/esm/helpers-BqFCd65h.js.map +1 -0
- package/dist/esm/helpers-DUHc_Cx7.js +9 -0
- package/dist/esm/helpers-DUHc_Cx7.js.map +1 -0
- package/dist/esm/i18n-OKf8uE5j.js +3069 -0
- package/dist/esm/i18n-OKf8uE5j.js.map +1 -0
- package/dist/esm/index-COQ27Nb6.js +14684 -0
- package/dist/esm/index-COQ27Nb6.js.map +1 -0
- package/dist/esm/index-DVkRTYPC.js +281 -0
- package/dist/esm/index-DVkRTYPC.js.map +1 -0
- package/dist/esm/index-Du3hUdhU.js +6325 -0
- package/dist/esm/index-Du3hUdhU.js.map +1 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +12 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/newsletter-helpers-ChXON0f4.js +278 -0
- package/dist/esm/newsletter-helpers-ChXON0f4.js.map +1 -0
- package/dist/esm/newsletter-store-CIsyE51r.js +34 -0
- package/dist/esm/newsletter-store-CIsyE51r.js.map +1 -0
- package/dist/esm/pagination-store-B9lk_lqK.js +14 -0
- package/dist/esm/pagination-store-B9lk_lqK.js.map +1 -0
- package/dist/esm/profile-helpers-Beduxnin.js +36 -0
- package/dist/esm/profile-helpers-Beduxnin.js.map +1 -0
- package/dist/esm/profile-store-CsSDT9Tb.js +18 -0
- package/dist/esm/profile-store-CsSDT9Tb.js.map +1 -0
- package/dist/esm/sdk.js +49 -0
- package/dist/esm/sdk.js.map +1 -0
- package/dist/esm/u-conditional-render.entry.js +100 -0
- package/dist/esm/u-conditional-render.entry.js.map +1 -0
- package/dist/esm/u-config.entry.js +89 -0
- package/dist/esm/u-config.entry.js.map +1 -0
- package/dist/esm/u-email-field.entry.js +75 -0
- package/dist/esm/u-email-field.entry.js.map +1 -0
- package/dist/esm/u-error-message.entry.js +80 -0
- package/dist/esm/u-error-message.entry.js.map +1 -0
- package/dist/esm/u-field.u-raw-field.entry.js.map +1 -0
- package/dist/esm/u-field_2.entry.js +368 -0
- package/dist/esm/u-flash-message.entry.js +35 -0
- package/dist/esm/u-flash-message.entry.js.map +1 -0
- package/dist/esm/u-full-profile.entry.js +35 -0
- package/dist/esm/u-full-profile.entry.js.map +1 -0
- package/dist/esm/u-logout-button.u-signed-in.entry.js.map +1 -0
- package/dist/esm/u-logout-button_2.entry.js +59 -0
- package/dist/esm/u-magic-code-field.entry.js +89 -0
- package/dist/esm/u-magic-code-field.entry.js.map +1 -0
- package/dist/esm/u-missing-field.entry.js +20 -0
- package/dist/esm/u-missing-field.entry.js.map +1 -0
- package/dist/esm/u-missing-fields-submit-button.entry.js +44 -0
- package/dist/esm/u-missing-fields-submit-button.entry.js.map +1 -0
- package/dist/esm/u-newsletter-checkbox.entry.js +75 -0
- package/dist/esm/u-newsletter-checkbox.entry.js.map +1 -0
- package/dist/esm/u-newsletter-logout-button.entry.js +39 -0
- package/dist/esm/u-newsletter-logout-button.entry.js.map +1 -0
- package/dist/esm/u-newsletter-preference-checkbox.entry.js +118 -0
- package/dist/esm/u-newsletter-preference-checkbox.entry.js.map +1 -0
- package/dist/esm/u-newsletter-resend-doi-button.entry.js +47 -0
- package/dist/esm/u-newsletter-resend-doi-button.entry.js.map +1 -0
- package/dist/esm/u-newsletter-root.entry.js +70 -0
- package/dist/esm/u-newsletter-root.entry.js.map +1 -0
- package/dist/esm/u-newsletter-toggle-subscription-button.entry.js +71 -0
- package/dist/esm/u-newsletter-toggle-subscription-button.entry.js.map +1 -0
- package/dist/esm/u-pagination-button.entry.js +61 -0
- package/dist/esm/u-pagination-button.entry.js.map +1 -0
- package/dist/esm/u-pagination-page.entry.js +42 -0
- package/dist/esm/u-pagination-page.entry.js.map +1 -0
- package/dist/esm/u-passkey.entry.js +45 -0
- package/dist/esm/u-passkey.entry.js.map +1 -0
- package/dist/esm/u-password-field.entry.js +104 -0
- package/dist/esm/u-password-field.entry.js.map +1 -0
- package/dist/esm/u-profile.u-submit-button.entry.js.map +1 -0
- package/dist/esm/u-profile_2.entry.js +326 -0
- package/dist/esm/u-registration-button.entry.js +46 -0
- package/dist/esm/u-registration-button.entry.js.map +1 -0
- package/dist/esm/u-reset-password-button.entry.js +54 -0
- package/dist/esm/u-reset-password-button.entry.js.map +1 -0
- package/dist/esm/u-send-magic-code-button.entry.js +66 -0
- package/dist/esm/u-send-magic-code-button.entry.js.map +1 -0
- package/dist/esm/u-signin-root.entry.js +41 -0
- package/dist/esm/u-signin-root.entry.js.map +1 -0
- package/dist/esm/u-signin-step.entry.js +64 -0
- package/dist/esm/u-signin-step.entry.js.map +1 -0
- package/dist/esm/u-signin-strategy.entry.js +28 -0
- package/dist/esm/u-signin-strategy.entry.js.map +1 -0
- package/dist/esm/u-social-login-button.entry.js +98 -0
- package/dist/esm/u-social-login-button.entry.js.map +1 -0
- package/dist/esm/u-spinner.entry.js +16 -0
- package/dist/esm/u-spinner.entry.js.map +1 -0
- package/dist/esm/u-ticketable-list.entry.js +6095 -0
- package/dist/esm/u-ticketable-list.entry.js.map +1 -0
- package/dist/esm/unidy-store-CAcMVdD8.js +37 -0
- package/dist/esm/unidy-store-CAcMVdD8.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/sdk/index.esm.js +2 -0
- package/dist/sdk/index.esm.js.map +1 -0
- package/dist/sdk/loader.esm.js.map +1 -0
- package/dist/sdk/locales/de.json +133 -0
- package/dist/sdk/locales/en.json +133 -0
- package/dist/sdk/locales/fr.json +133 -0
- package/dist/sdk/locales/it.json +133 -0
- package/dist/sdk/locales/nl_be.json +133 -0
- package/dist/sdk/locales/ro.json +133 -0
- package/dist/sdk/p-1bad3fd0.entry.js +2 -0
- package/dist/sdk/p-1bad3fd0.entry.js.map +1 -0
- package/dist/sdk/p-1d6982cd.entry.js +2 -0
- package/dist/sdk/p-1d6982cd.entry.js.map +1 -0
- package/dist/sdk/p-23d8e922.entry.js +2 -0
- package/dist/sdk/p-23d8e922.entry.js.map +1 -0
- package/dist/sdk/p-2855d3bb.entry.js +2 -0
- package/dist/sdk/p-2855d3bb.entry.js.map +1 -0
- package/dist/sdk/p-288f37c3.entry.js +2 -0
- package/dist/sdk/p-288f37c3.entry.js.map +1 -0
- package/dist/sdk/p-32842e98.entry.js +2 -0
- package/dist/sdk/p-32842e98.entry.js.map +1 -0
- package/dist/sdk/p-34af7470.entry.js +2 -0
- package/dist/sdk/p-34af7470.entry.js.map +1 -0
- package/dist/sdk/p-39126514.entry.js +2 -0
- package/dist/sdk/p-39126514.entry.js.map +1 -0
- package/dist/sdk/p-438f62e5.entry.js +2 -0
- package/dist/sdk/p-438f62e5.entry.js.map +1 -0
- package/dist/sdk/p-46013b2f.entry.js +2 -0
- package/dist/sdk/p-46013b2f.entry.js.map +1 -0
- package/dist/sdk/p-46cdb255.entry.js +2 -0
- package/dist/sdk/p-46cdb255.entry.js.map +1 -0
- package/dist/sdk/p-4d9bde6e.entry.js +2 -0
- package/dist/sdk/p-4d9bde6e.entry.js.map +1 -0
- package/dist/sdk/p-5c40c6ea.entry.js +2 -0
- package/dist/sdk/p-5c40c6ea.entry.js.map +1 -0
- package/dist/sdk/p-5c8b31bd.entry.js +2 -0
- package/dist/sdk/p-5c8b31bd.entry.js.map +1 -0
- package/dist/sdk/p-69172b22.entry.js +2 -0
- package/dist/sdk/p-69172b22.entry.js.map +1 -0
- package/dist/sdk/p-7381aca7.entry.js +2 -0
- package/dist/sdk/p-7381aca7.entry.js.map +1 -0
- package/dist/sdk/p-BGq0leDV.js +2 -0
- package/dist/sdk/p-BGq0leDV.js.map +1 -0
- package/dist/sdk/p-BR6L248H.js +2 -0
- package/dist/sdk/p-BR6L248H.js.map +1 -0
- package/dist/sdk/p-BhrvnKAS.js +2 -0
- package/dist/sdk/p-BhrvnKAS.js.map +1 -0
- package/dist/sdk/p-BqFCd65h.js +2 -0
- package/dist/sdk/p-BqFCd65h.js.map +1 -0
- package/dist/sdk/p-CMw6v6sC.js +2 -0
- package/dist/sdk/p-CMw6v6sC.js.map +1 -0
- package/dist/sdk/p-COQ27Nb6.js +14 -0
- package/dist/sdk/p-COQ27Nb6.js.map +1 -0
- package/dist/sdk/p-CSLU6kes.js +2 -0
- package/dist/sdk/p-CSLU6kes.js.map +1 -0
- package/dist/sdk/p-Cai8JwlG.js +2 -0
- package/dist/sdk/p-Cai8JwlG.js.map +1 -0
- package/dist/sdk/p-CpJghKnM.js +2 -0
- package/dist/sdk/p-CpJghKnM.js.map +1 -0
- package/dist/sdk/p-DAn4FkxC.js +2 -0
- package/dist/sdk/p-DAn4FkxC.js.map +1 -0
- package/dist/sdk/p-DUHc_Cx7.js +2 -0
- package/dist/sdk/p-DUHc_Cx7.js.map +1 -0
- package/dist/sdk/p-FFRhPCmc.js +2 -0
- package/dist/sdk/p-FFRhPCmc.js.map +1 -0
- package/dist/sdk/p-Jrp0G45B.js +2 -0
- package/dist/sdk/p-Jrp0G45B.js.map +1 -0
- package/dist/sdk/p-MA26cw6g.js +2 -0
- package/dist/sdk/p-MA26cw6g.js.map +1 -0
- package/dist/sdk/p-P0eZf5rH.js +2 -0
- package/dist/sdk/p-P0eZf5rH.js.map +1 -0
- package/dist/sdk/p-PSIHL0wP.js +2 -0
- package/dist/sdk/p-PSIHL0wP.js.map +1 -0
- package/dist/sdk/p-a341c7f6.entry.js +2 -0
- package/dist/sdk/p-a341c7f6.entry.js.map +1 -0
- package/dist/sdk/p-a38cd448.entry.js +2 -0
- package/dist/sdk/p-a38cd448.entry.js.map +1 -0
- package/dist/sdk/p-a45ef398.entry.js +2 -0
- package/dist/sdk/p-a45ef398.entry.js.map +1 -0
- package/dist/sdk/p-b5a6ad01.entry.js +2 -0
- package/dist/sdk/p-b5a6ad01.entry.js.map +1 -0
- package/dist/sdk/p-b93bf91d.entry.js +2 -0
- package/dist/sdk/p-b93bf91d.entry.js.map +1 -0
- package/dist/sdk/p-baf5dcb7.entry.js +2 -0
- package/dist/sdk/p-baf5dcb7.entry.js.map +1 -0
- package/dist/sdk/p-c07a43e2.entry.js +2 -0
- package/dist/sdk/p-c07a43e2.entry.js.map +1 -0
- package/dist/sdk/p-c98ad60d.entry.js +2 -0
- package/dist/sdk/p-c98ad60d.entry.js.map +1 -0
- package/dist/sdk/p-d0c0fb6b.entry.js +2 -0
- package/dist/sdk/p-d0c0fb6b.entry.js.map +1 -0
- package/dist/sdk/p-d47aaf26.entry.js +2 -0
- package/dist/sdk/p-d47aaf26.entry.js.map +1 -0
- package/dist/sdk/p-e5ef30ef.entry.js +2 -0
- package/dist/sdk/p-e5ef30ef.entry.js.map +1 -0
- package/dist/sdk/p-eb348798.entry.js +2 -0
- package/dist/sdk/p-eb348798.entry.js.map +1 -0
- package/dist/sdk/p-f82f500d.entry.js +2 -0
- package/dist/sdk/p-f82f500d.entry.js.map +1 -0
- package/dist/sdk/p-f88ed6e8.entry.js +2 -0
- package/dist/sdk/p-f88ed6e8.entry.js.map +1 -0
- package/dist/sdk/p-f9affafe.entry.js +2 -0
- package/dist/sdk/p-f9affafe.entry.js.map +1 -0
- package/dist/sdk/p-jyF1XwDG.js +2 -0
- package/dist/sdk/p-jyF1XwDG.js.map +1 -0
- package/dist/sdk/sdk.css +39 -0
- package/dist/sdk/sdk.esm.js +2 -0
- package/dist/sdk/sdk.esm.js.map +1 -0
- package/dist/sdk/u-conditional-render.entry.esm.js.map +1 -0
- package/dist/sdk/u-config.entry.esm.js.map +1 -0
- package/dist/sdk/u-email-field.entry.esm.js.map +1 -0
- package/dist/sdk/u-error-message.entry.esm.js.map +1 -0
- package/dist/sdk/u-field.u-raw-field.entry.esm.js.map +1 -0
- package/dist/sdk/u-flash-message.entry.esm.js.map +1 -0
- package/dist/sdk/u-full-profile.entry.esm.js.map +1 -0
- package/dist/sdk/u-logout-button.u-signed-in.entry.esm.js.map +1 -0
- package/dist/sdk/u-magic-code-field.entry.esm.js.map +1 -0
- package/dist/sdk/u-missing-field.entry.esm.js.map +1 -0
- package/dist/sdk/u-missing-fields-submit-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-newsletter-checkbox.entry.esm.js.map +1 -0
- package/dist/sdk/u-newsletter-logout-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-newsletter-preference-checkbox.entry.esm.js.map +1 -0
- package/dist/sdk/u-newsletter-resend-doi-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-newsletter-root.entry.esm.js.map +1 -0
- package/dist/sdk/u-newsletter-toggle-subscription-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-pagination-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-pagination-page.entry.esm.js.map +1 -0
- package/dist/sdk/u-passkey.entry.esm.js.map +1 -0
- package/dist/sdk/u-password-field.entry.esm.js.map +1 -0
- package/dist/sdk/u-profile.u-submit-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-registration-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-reset-password-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-send-magic-code-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-signin-root.entry.esm.js.map +1 -0
- package/dist/sdk/u-signin-step.entry.esm.js.map +1 -0
- package/dist/sdk/u-signin-strategy.entry.esm.js.map +1 -0
- package/dist/sdk/u-social-login-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-spinner.entry.esm.js.map +1 -0
- package/dist/sdk/u-ticketable-list.entry.esm.js.map +1 -0
- package/dist/types/api/client.d.ts +32 -0
- package/dist/types/api/index.d.ts +22 -0
- package/dist/types/api/shared.d.ts +20 -0
- package/dist/types/auth/api/auth.d.ts +302 -0
- package/dist/types/auth/auth-helpers.d.ts +376 -0
- package/dist/types/auth/auth.d.ts +62 -0
- package/dist/types/auth/components/helpers.d.ts +1 -0
- package/dist/types/auth/components/logout-button/logout-button.d.ts +11 -0
- package/dist/types/auth/components/magic-code-field/magic-code-field.d.ts +10 -0
- package/dist/types/auth/components/missing-field/missing-field.d.ts +4 -0
- package/dist/types/auth/components/missing-fields-submit-button/missing-fields-submit-button.d.ts +5 -0
- package/dist/types/auth/components/passkey/passkey.d.ts +9 -0
- package/dist/types/auth/components/password-field/password-field.d.ts +15 -0
- package/dist/types/auth/components/registration/registration-button.d.ts +11 -0
- package/dist/types/auth/components/reset-pass-button/reset-pass-button.d.ts +7 -0
- package/dist/types/auth/components/send-magic-code-button/send-magic-code-button.d.ts +11 -0
- package/dist/types/auth/components/signed-in/signed-in.d.ts +5 -0
- package/dist/types/auth/components/signin-root/signin-root.d.ts +14 -0
- package/dist/types/auth/components/signin-step/signin-step.d.ts +8 -0
- package/dist/types/auth/components/signin-strategy/signin-strategy.d.ts +5 -0
- package/dist/types/auth/components/social-logins/logos/apple.d.ts +4 -0
- package/dist/types/auth/components/social-logins/logos/discord.d.ts +4 -0
- package/dist/types/auth/components/social-logins/logos/facebook.d.ts +4 -0
- package/dist/types/auth/components/social-logins/logos/google.d.ts +4 -0
- package/dist/types/auth/components/social-logins/logos/linkedin.d.ts +4 -0
- package/dist/types/auth/components/social-logins/social-login-button.d.ts +24 -0
- package/dist/types/auth/components/submit-button/auth-submit-button.d.ts +3 -0
- package/dist/types/auth/error-definitions.d.ts +23 -0
- package/dist/types/auth/index.d.ts +15 -0
- package/dist/types/auth/passkey-auth.d.ts +2 -0
- package/dist/types/auth/store/auth-store.d.ts +58 -0
- package/dist/types/components.d.ts +1270 -0
- package/dist/types/globalScript.d.ts +1 -0
- package/dist/types/i18n.d.ts +3 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/logger.d.ts +55 -0
- package/dist/types/newsletter/api/newsletters.d.ts +198 -0
- package/dist/types/newsletter/components/helpers.d.ts +1 -0
- package/dist/types/newsletter/components/logout-button/logout-button.d.ts +8 -0
- package/dist/types/newsletter/components/newsletter-checkbox/newsletter-checkbox.d.ts +15 -0
- package/dist/types/newsletter/components/newsletter-root/newsletter-root.d.ts +11 -0
- package/dist/types/newsletter/components/preference-checkbox/preference-checkbox.d.ts +28 -0
- package/dist/types/newsletter/components/resend-doi-button/resend-doi-button.d.ts +8 -0
- package/dist/types/newsletter/components/submit-button/newsletter-submit-button.d.ts +3 -0
- package/dist/types/newsletter/components/toggle-subscription-button/toggle-subscription-button.d.ts +12 -0
- package/dist/types/newsletter/index.d.ts +10 -0
- package/dist/types/newsletter/newsletter-helpers.d.ts +15 -0
- package/dist/types/newsletter/store/newsletter-store.d.ts +25 -0
- package/dist/types/profile/api/profile.d.ts +238 -0
- package/dist/types/profile/components/field/field.d.ts +39 -0
- package/dist/types/profile/components/full-profile/full-profile.d.ts +6 -0
- package/dist/types/profile/components/profile/profile.d.ts +27 -0
- package/dist/types/profile/components/raw-field/raw-field.d.ts +45 -0
- package/dist/types/profile/components/raw-input-fields/Input.d.ts +17 -0
- package/dist/types/profile/components/raw-input-fields/MultiSelect.d.ts +28 -0
- package/dist/types/profile/components/raw-input-fields/RadioGroup.d.ts +30 -0
- package/dist/types/profile/components/raw-input-fields/Select.d.ts +24 -0
- package/dist/types/profile/components/raw-input-fields/Textarea.d.ts +17 -0
- package/dist/types/profile/components/submit-button/profile-submit-button.d.ts +2 -0
- package/dist/types/profile/index.d.ts +12 -0
- package/dist/types/profile/profile-helpers.d.ts +7 -0
- package/dist/types/profile/store/profile-store.d.ts +39 -0
- package/dist/types/shared/component-utils.d.ts +16 -0
- package/dist/types/shared/components/conditional-render/conditional-render.d.ts +11 -0
- package/dist/types/shared/components/config/config.d.ts +32 -0
- package/dist/types/shared/components/email-field/email-field.d.ts +13 -0
- package/dist/types/shared/components/error-message/error-message.d.ts +15 -0
- package/dist/types/shared/components/flash-message/close-icon.d.ts +1 -0
- package/dist/types/shared/components/flash-message/flash-message.d.ts +6 -0
- package/dist/types/shared/components/spinner/spinner.d.ts +3 -0
- package/dist/types/shared/components/submit-button/context.d.ts +9 -0
- package/dist/types/shared/components/submit-button/submit-button.d.ts +20 -0
- package/dist/types/shared/store/flash-store.d.ts +29 -0
- package/dist/types/shared/store/unidy-store.d.ts +12 -0
- package/dist/types/stencil-public-runtime.d.ts +1756 -0
- package/dist/types/ticketable/api/get-with-schema.d.ts +3 -0
- package/dist/types/ticketable/api/schemas.d.ts +18 -0
- package/dist/types/ticketable/api/subscriptions.d.ts +84 -0
- package/dist/types/ticketable/api/tickets.d.ts +86 -0
- package/dist/types/ticketable/components/pagination/pagination-button.d.ts +14 -0
- package/dist/types/ticketable/components/pagination/pagination-page.d.ts +12 -0
- package/dist/types/ticketable/components/ticketable-list/skeleton-helpers.d.ts +13 -0
- package/dist/types/ticketable/components/ticketable-list/ticketable-list.d.ts +41 -0
- package/dist/types/ticketable/index.d.ts +12 -0
- package/dist/types/ticketable/store/pagination-store.d.ts +10 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +23 -18
|
@@ -0,0 +1,3072 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BzhKFIXk.js');
|
|
4
|
+
var unidyStore = require('./unidy-store-zhdhlK0a.js');
|
|
5
|
+
|
|
6
|
+
const isString = obj => typeof obj === 'string';
|
|
7
|
+
const defer = () => {
|
|
8
|
+
let res;
|
|
9
|
+
let rej;
|
|
10
|
+
const promise = new Promise((resolve, reject) => {
|
|
11
|
+
res = resolve;
|
|
12
|
+
rej = reject;
|
|
13
|
+
});
|
|
14
|
+
promise.resolve = res;
|
|
15
|
+
promise.reject = rej;
|
|
16
|
+
return promise;
|
|
17
|
+
};
|
|
18
|
+
const makeString = object => {
|
|
19
|
+
if (object == null) return '';
|
|
20
|
+
return '' + object;
|
|
21
|
+
};
|
|
22
|
+
const copy = (a, s, t) => {
|
|
23
|
+
a.forEach(m => {
|
|
24
|
+
if (s[m]) t[m] = s[m];
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const lastOfPathSeparatorRegExp = /###/g;
|
|
28
|
+
const cleanKey = key => key && key.indexOf('###') > -1 ? key.replace(lastOfPathSeparatorRegExp, '.') : key;
|
|
29
|
+
const canNotTraverseDeeper = object => !object || isString(object);
|
|
30
|
+
const getLastOfPath = (object, path, Empty) => {
|
|
31
|
+
const stack = !isString(path) ? path : path.split('.');
|
|
32
|
+
let stackIndex = 0;
|
|
33
|
+
while (stackIndex < stack.length - 1) {
|
|
34
|
+
if (canNotTraverseDeeper(object)) return {};
|
|
35
|
+
const key = cleanKey(stack[stackIndex]);
|
|
36
|
+
if (!object[key] && Empty) object[key] = new Empty();
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
38
|
+
object = object[key];
|
|
39
|
+
} else {
|
|
40
|
+
object = {};
|
|
41
|
+
}
|
|
42
|
+
++stackIndex;
|
|
43
|
+
}
|
|
44
|
+
if (canNotTraverseDeeper(object)) return {};
|
|
45
|
+
return {
|
|
46
|
+
obj: object,
|
|
47
|
+
k: cleanKey(stack[stackIndex])
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const setPath = (object, path, newValue) => {
|
|
51
|
+
const {
|
|
52
|
+
obj,
|
|
53
|
+
k
|
|
54
|
+
} = getLastOfPath(object, path, Object);
|
|
55
|
+
if (obj !== undefined || path.length === 1) {
|
|
56
|
+
obj[k] = newValue;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let e = path[path.length - 1];
|
|
60
|
+
let p = path.slice(0, path.length - 1);
|
|
61
|
+
let last = getLastOfPath(object, p, Object);
|
|
62
|
+
while (last.obj === undefined && p.length) {
|
|
63
|
+
e = `${p[p.length - 1]}.${e}`;
|
|
64
|
+
p = p.slice(0, p.length - 1);
|
|
65
|
+
last = getLastOfPath(object, p, Object);
|
|
66
|
+
if (last?.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') {
|
|
67
|
+
last.obj = undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
last.obj[`${last.k}.${e}`] = newValue;
|
|
71
|
+
};
|
|
72
|
+
const pushPath = (object, path, newValue, concat) => {
|
|
73
|
+
const {
|
|
74
|
+
obj,
|
|
75
|
+
k
|
|
76
|
+
} = getLastOfPath(object, path, Object);
|
|
77
|
+
obj[k] = obj[k] || [];
|
|
78
|
+
obj[k].push(newValue);
|
|
79
|
+
};
|
|
80
|
+
const getPath = (object, path) => {
|
|
81
|
+
const {
|
|
82
|
+
obj,
|
|
83
|
+
k
|
|
84
|
+
} = getLastOfPath(object, path);
|
|
85
|
+
if (!obj) return undefined;
|
|
86
|
+
if (!Object.prototype.hasOwnProperty.call(obj, k)) return undefined;
|
|
87
|
+
return obj[k];
|
|
88
|
+
};
|
|
89
|
+
const getPathWithDefaults = (data, defaultData, key) => {
|
|
90
|
+
const value = getPath(data, key);
|
|
91
|
+
if (value !== undefined) {
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
return getPath(defaultData, key);
|
|
95
|
+
};
|
|
96
|
+
const deepExtend = (target, source, overwrite) => {
|
|
97
|
+
for (const prop in source) {
|
|
98
|
+
if (prop !== '__proto__' && prop !== 'constructor') {
|
|
99
|
+
if (prop in target) {
|
|
100
|
+
if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) {
|
|
101
|
+
if (overwrite) target[prop] = source[prop];
|
|
102
|
+
} else {
|
|
103
|
+
deepExtend(target[prop], source[prop], overwrite);
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
target[prop] = source[prop];
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return target;
|
|
111
|
+
};
|
|
112
|
+
const regexEscape = str => str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
|
113
|
+
var _entityMap = {
|
|
114
|
+
'&': '&',
|
|
115
|
+
'<': '<',
|
|
116
|
+
'>': '>',
|
|
117
|
+
'"': '"',
|
|
118
|
+
"'": ''',
|
|
119
|
+
'/': '/'
|
|
120
|
+
};
|
|
121
|
+
const escape = data => {
|
|
122
|
+
if (isString(data)) {
|
|
123
|
+
return data.replace(/[&<>"'\/]/g, s => _entityMap[s]);
|
|
124
|
+
}
|
|
125
|
+
return data;
|
|
126
|
+
};
|
|
127
|
+
class RegExpCache {
|
|
128
|
+
constructor(capacity) {
|
|
129
|
+
this.capacity = capacity;
|
|
130
|
+
this.regExpMap = new Map();
|
|
131
|
+
this.regExpQueue = [];
|
|
132
|
+
}
|
|
133
|
+
getRegExp(pattern) {
|
|
134
|
+
const regExpFromCache = this.regExpMap.get(pattern);
|
|
135
|
+
if (regExpFromCache !== undefined) {
|
|
136
|
+
return regExpFromCache;
|
|
137
|
+
}
|
|
138
|
+
const regExpNew = new RegExp(pattern);
|
|
139
|
+
if (this.regExpQueue.length === this.capacity) {
|
|
140
|
+
this.regExpMap.delete(this.regExpQueue.shift());
|
|
141
|
+
}
|
|
142
|
+
this.regExpMap.set(pattern, regExpNew);
|
|
143
|
+
this.regExpQueue.push(pattern);
|
|
144
|
+
return regExpNew;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const chars = [' ', ',', '?', '!', ';'];
|
|
148
|
+
const looksLikeObjectPathRegExpCache = new RegExpCache(20);
|
|
149
|
+
const looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
|
|
150
|
+
nsSeparator = nsSeparator || '';
|
|
151
|
+
keySeparator = keySeparator || '';
|
|
152
|
+
const possibleChars = chars.filter(c => nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0);
|
|
153
|
+
if (possibleChars.length === 0) return true;
|
|
154
|
+
const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map(c => c === '?' ? '\\?' : c).join('|')})`);
|
|
155
|
+
let matched = !r.test(key);
|
|
156
|
+
if (!matched) {
|
|
157
|
+
const ki = key.indexOf(keySeparator);
|
|
158
|
+
if (ki > 0 && !r.test(key.substring(0, ki))) {
|
|
159
|
+
matched = true;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return matched;
|
|
163
|
+
};
|
|
164
|
+
const deepFind = (obj, path, keySeparator = '.') => {
|
|
165
|
+
if (!obj) return undefined;
|
|
166
|
+
if (obj[path]) {
|
|
167
|
+
if (!Object.prototype.hasOwnProperty.call(obj, path)) return undefined;
|
|
168
|
+
return obj[path];
|
|
169
|
+
}
|
|
170
|
+
const tokens = path.split(keySeparator);
|
|
171
|
+
let current = obj;
|
|
172
|
+
for (let i = 0; i < tokens.length;) {
|
|
173
|
+
if (!current || typeof current !== 'object') {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
let next;
|
|
177
|
+
let nextPath = '';
|
|
178
|
+
for (let j = i; j < tokens.length; ++j) {
|
|
179
|
+
if (j !== i) {
|
|
180
|
+
nextPath += keySeparator;
|
|
181
|
+
}
|
|
182
|
+
nextPath += tokens[j];
|
|
183
|
+
next = current[nextPath];
|
|
184
|
+
if (next !== undefined) {
|
|
185
|
+
if (['string', 'number', 'boolean'].indexOf(typeof next) > -1 && j < tokens.length - 1) {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
i += j - i + 1;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
current = next;
|
|
193
|
+
}
|
|
194
|
+
return current;
|
|
195
|
+
};
|
|
196
|
+
const getCleanedCode = code => code?.replace('_', '-');
|
|
197
|
+
|
|
198
|
+
const consoleLogger = {
|
|
199
|
+
type: 'logger',
|
|
200
|
+
log(args) {
|
|
201
|
+
this.output('log', args);
|
|
202
|
+
},
|
|
203
|
+
warn(args) {
|
|
204
|
+
this.output('warn', args);
|
|
205
|
+
},
|
|
206
|
+
error(args) {
|
|
207
|
+
this.output('error', args);
|
|
208
|
+
},
|
|
209
|
+
output(type, args) {
|
|
210
|
+
console?.[type]?.apply?.(console, args);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
class Logger {
|
|
214
|
+
constructor(concreteLogger, options = {}) {
|
|
215
|
+
this.init(concreteLogger, options);
|
|
216
|
+
}
|
|
217
|
+
init(concreteLogger, options = {}) {
|
|
218
|
+
this.prefix = options.prefix || 'i18next:';
|
|
219
|
+
this.logger = concreteLogger || consoleLogger;
|
|
220
|
+
this.options = options;
|
|
221
|
+
this.debug = options.debug;
|
|
222
|
+
}
|
|
223
|
+
log(...args) {
|
|
224
|
+
return this.forward(args, 'log', '', true);
|
|
225
|
+
}
|
|
226
|
+
warn(...args) {
|
|
227
|
+
return this.forward(args, 'warn', '', true);
|
|
228
|
+
}
|
|
229
|
+
error(...args) {
|
|
230
|
+
return this.forward(args, 'error', '');
|
|
231
|
+
}
|
|
232
|
+
deprecate(...args) {
|
|
233
|
+
return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
|
|
234
|
+
}
|
|
235
|
+
forward(args, lvl, prefix, debugOnly) {
|
|
236
|
+
if (debugOnly && !this.debug) return null;
|
|
237
|
+
if (isString(args[0])) args[0] = `${prefix}${this.prefix} ${args[0]}`;
|
|
238
|
+
return this.logger[lvl](args);
|
|
239
|
+
}
|
|
240
|
+
create(moduleName) {
|
|
241
|
+
return new Logger(this.logger, {
|
|
242
|
+
...{
|
|
243
|
+
prefix: `${this.prefix}:${moduleName}:`
|
|
244
|
+
},
|
|
245
|
+
...this.options
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
clone(options) {
|
|
249
|
+
options = options || this.options;
|
|
250
|
+
options.prefix = options.prefix || this.prefix;
|
|
251
|
+
return new Logger(this.logger, options);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
var baseLogger = new Logger();
|
|
255
|
+
|
|
256
|
+
class EventEmitter {
|
|
257
|
+
constructor() {
|
|
258
|
+
this.observers = {};
|
|
259
|
+
}
|
|
260
|
+
on(events, listener) {
|
|
261
|
+
events.split(' ').forEach(event => {
|
|
262
|
+
if (!this.observers[event]) this.observers[event] = new Map();
|
|
263
|
+
const numListeners = this.observers[event].get(listener) || 0;
|
|
264
|
+
this.observers[event].set(listener, numListeners + 1);
|
|
265
|
+
});
|
|
266
|
+
return this;
|
|
267
|
+
}
|
|
268
|
+
off(event, listener) {
|
|
269
|
+
if (!this.observers[event]) return;
|
|
270
|
+
if (!listener) {
|
|
271
|
+
delete this.observers[event];
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
this.observers[event].delete(listener);
|
|
275
|
+
}
|
|
276
|
+
emit(event, ...args) {
|
|
277
|
+
if (this.observers[event]) {
|
|
278
|
+
const cloned = Array.from(this.observers[event].entries());
|
|
279
|
+
cloned.forEach(([observer, numTimesAdded]) => {
|
|
280
|
+
for (let i = 0; i < numTimesAdded; i++) {
|
|
281
|
+
observer(...args);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
if (this.observers['*']) {
|
|
286
|
+
const cloned = Array.from(this.observers['*'].entries());
|
|
287
|
+
cloned.forEach(([observer, numTimesAdded]) => {
|
|
288
|
+
for (let i = 0; i < numTimesAdded; i++) {
|
|
289
|
+
observer.apply(observer, [event, ...args]);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
class ResourceStore extends EventEmitter {
|
|
297
|
+
constructor(data, options = {
|
|
298
|
+
ns: ['translation'],
|
|
299
|
+
defaultNS: 'translation'
|
|
300
|
+
}) {
|
|
301
|
+
super();
|
|
302
|
+
this.data = data || {};
|
|
303
|
+
this.options = options;
|
|
304
|
+
if (this.options.keySeparator === undefined) {
|
|
305
|
+
this.options.keySeparator = '.';
|
|
306
|
+
}
|
|
307
|
+
if (this.options.ignoreJSONStructure === undefined) {
|
|
308
|
+
this.options.ignoreJSONStructure = true;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
addNamespaces(ns) {
|
|
312
|
+
if (this.options.ns.indexOf(ns) < 0) {
|
|
313
|
+
this.options.ns.push(ns);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
removeNamespaces(ns) {
|
|
317
|
+
const index = this.options.ns.indexOf(ns);
|
|
318
|
+
if (index > -1) {
|
|
319
|
+
this.options.ns.splice(index, 1);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
getResource(lng, ns, key, options = {}) {
|
|
323
|
+
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
324
|
+
const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
325
|
+
let path;
|
|
326
|
+
if (lng.indexOf('.') > -1) {
|
|
327
|
+
path = lng.split('.');
|
|
328
|
+
} else {
|
|
329
|
+
path = [lng, ns];
|
|
330
|
+
if (key) {
|
|
331
|
+
if (Array.isArray(key)) {
|
|
332
|
+
path.push(...key);
|
|
333
|
+
} else if (isString(key) && keySeparator) {
|
|
334
|
+
path.push(...key.split(keySeparator));
|
|
335
|
+
} else {
|
|
336
|
+
path.push(key);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
const result = getPath(this.data, path);
|
|
341
|
+
if (!result && !ns && !key && lng.indexOf('.') > -1) {
|
|
342
|
+
lng = path[0];
|
|
343
|
+
ns = path[1];
|
|
344
|
+
key = path.slice(2).join('.');
|
|
345
|
+
}
|
|
346
|
+
if (result || !ignoreJSONStructure || !isString(key)) return result;
|
|
347
|
+
return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
|
|
348
|
+
}
|
|
349
|
+
addResource(lng, ns, key, value, options = {
|
|
350
|
+
silent: false
|
|
351
|
+
}) {
|
|
352
|
+
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
353
|
+
let path = [lng, ns];
|
|
354
|
+
if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
|
355
|
+
if (lng.indexOf('.') > -1) {
|
|
356
|
+
path = lng.split('.');
|
|
357
|
+
value = ns;
|
|
358
|
+
ns = path[1];
|
|
359
|
+
}
|
|
360
|
+
this.addNamespaces(ns);
|
|
361
|
+
setPath(this.data, path, value);
|
|
362
|
+
if (!options.silent) this.emit('added', lng, ns, key, value);
|
|
363
|
+
}
|
|
364
|
+
addResources(lng, ns, resources, options = {
|
|
365
|
+
silent: false
|
|
366
|
+
}) {
|
|
367
|
+
for (const m in resources) {
|
|
368
|
+
if (isString(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], {
|
|
369
|
+
silent: true
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
if (!options.silent) this.emit('added', lng, ns, resources);
|
|
373
|
+
}
|
|
374
|
+
addResourceBundle(lng, ns, resources, deep, overwrite, options = {
|
|
375
|
+
silent: false,
|
|
376
|
+
skipCopy: false
|
|
377
|
+
}) {
|
|
378
|
+
let path = [lng, ns];
|
|
379
|
+
if (lng.indexOf('.') > -1) {
|
|
380
|
+
path = lng.split('.');
|
|
381
|
+
deep = resources;
|
|
382
|
+
resources = ns;
|
|
383
|
+
ns = path[1];
|
|
384
|
+
}
|
|
385
|
+
this.addNamespaces(ns);
|
|
386
|
+
let pack = getPath(this.data, path) || {};
|
|
387
|
+
if (!options.skipCopy) resources = JSON.parse(JSON.stringify(resources));
|
|
388
|
+
if (deep) {
|
|
389
|
+
deepExtend(pack, resources, overwrite);
|
|
390
|
+
} else {
|
|
391
|
+
pack = {
|
|
392
|
+
...pack,
|
|
393
|
+
...resources
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
setPath(this.data, path, pack);
|
|
397
|
+
if (!options.silent) this.emit('added', lng, ns, resources);
|
|
398
|
+
}
|
|
399
|
+
removeResourceBundle(lng, ns) {
|
|
400
|
+
if (this.hasResourceBundle(lng, ns)) {
|
|
401
|
+
delete this.data[lng][ns];
|
|
402
|
+
}
|
|
403
|
+
this.removeNamespaces(ns);
|
|
404
|
+
this.emit('removed', lng, ns);
|
|
405
|
+
}
|
|
406
|
+
hasResourceBundle(lng, ns) {
|
|
407
|
+
return this.getResource(lng, ns) !== undefined;
|
|
408
|
+
}
|
|
409
|
+
getResourceBundle(lng, ns) {
|
|
410
|
+
if (!ns) ns = this.options.defaultNS;
|
|
411
|
+
return this.getResource(lng, ns);
|
|
412
|
+
}
|
|
413
|
+
getDataByLanguage(lng) {
|
|
414
|
+
return this.data[lng];
|
|
415
|
+
}
|
|
416
|
+
hasLanguageSomeTranslations(lng) {
|
|
417
|
+
const data = this.getDataByLanguage(lng);
|
|
418
|
+
const n = data && Object.keys(data) || [];
|
|
419
|
+
return !!n.find(v => data[v] && Object.keys(data[v]).length > 0);
|
|
420
|
+
}
|
|
421
|
+
toJSON() {
|
|
422
|
+
return this.data;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
var postProcessor = {
|
|
427
|
+
processors: {},
|
|
428
|
+
addPostProcessor(module) {
|
|
429
|
+
this.processors[module.name] = module;
|
|
430
|
+
},
|
|
431
|
+
handle(processors, value, key, options, translator) {
|
|
432
|
+
processors.forEach(processor => {
|
|
433
|
+
value = this.processors[processor]?.process(value, key, options, translator) ?? value;
|
|
434
|
+
});
|
|
435
|
+
return value;
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
const PATH_KEY = Symbol('i18next/PATH_KEY');
|
|
440
|
+
function createProxy() {
|
|
441
|
+
const state = [];
|
|
442
|
+
const handler = Object.create(null);
|
|
443
|
+
let proxy;
|
|
444
|
+
handler.get = (target, key) => {
|
|
445
|
+
proxy?.revoke?.();
|
|
446
|
+
if (key === PATH_KEY) return state;
|
|
447
|
+
state.push(key);
|
|
448
|
+
proxy = Proxy.revocable(target, handler);
|
|
449
|
+
return proxy.proxy;
|
|
450
|
+
};
|
|
451
|
+
return Proxy.revocable(Object.create(null), handler).proxy;
|
|
452
|
+
}
|
|
453
|
+
function keysFromSelector(selector, opts) {
|
|
454
|
+
const {
|
|
455
|
+
[PATH_KEY]: path
|
|
456
|
+
} = selector(createProxy());
|
|
457
|
+
return path.join(opts?.keySeparator ?? '.');
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
const checkedLoadedFor = {};
|
|
461
|
+
const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
|
|
462
|
+
class Translator extends EventEmitter {
|
|
463
|
+
constructor(services, options = {}) {
|
|
464
|
+
super();
|
|
465
|
+
copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, this);
|
|
466
|
+
this.options = options;
|
|
467
|
+
if (this.options.keySeparator === undefined) {
|
|
468
|
+
this.options.keySeparator = '.';
|
|
469
|
+
}
|
|
470
|
+
this.logger = baseLogger.create('translator');
|
|
471
|
+
}
|
|
472
|
+
changeLanguage(lng) {
|
|
473
|
+
if (lng) this.language = lng;
|
|
474
|
+
}
|
|
475
|
+
exists(key, o = {
|
|
476
|
+
interpolation: {}
|
|
477
|
+
}) {
|
|
478
|
+
const opt = {
|
|
479
|
+
...o
|
|
480
|
+
};
|
|
481
|
+
if (key == null) return false;
|
|
482
|
+
const resolved = this.resolve(key, opt);
|
|
483
|
+
if (resolved?.res === undefined) return false;
|
|
484
|
+
const isObject = shouldHandleAsObject(resolved.res);
|
|
485
|
+
if (opt.returnObjects === false && isObject) {
|
|
486
|
+
return false;
|
|
487
|
+
}
|
|
488
|
+
return true;
|
|
489
|
+
}
|
|
490
|
+
extractFromKey(key, opt) {
|
|
491
|
+
let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;
|
|
492
|
+
if (nsSeparator === undefined) nsSeparator = ':';
|
|
493
|
+
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
|
|
494
|
+
let namespaces = opt.ns || this.options.defaultNS || [];
|
|
495
|
+
const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
|
|
496
|
+
const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
|
|
497
|
+
if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
|
|
498
|
+
const m = key.match(this.interpolator.nestingRegexp);
|
|
499
|
+
if (m && m.length > 0) {
|
|
500
|
+
return {
|
|
501
|
+
key,
|
|
502
|
+
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
const parts = key.split(nsSeparator);
|
|
506
|
+
if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
|
|
507
|
+
key = parts.join(keySeparator);
|
|
508
|
+
}
|
|
509
|
+
return {
|
|
510
|
+
key,
|
|
511
|
+
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
translate(keys, o, lastKey) {
|
|
515
|
+
let opt = typeof o === 'object' ? {
|
|
516
|
+
...o
|
|
517
|
+
} : o;
|
|
518
|
+
if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
|
|
519
|
+
opt = this.options.overloadTranslationOptionHandler(arguments);
|
|
520
|
+
}
|
|
521
|
+
if (typeof opt === 'object') opt = {
|
|
522
|
+
...opt
|
|
523
|
+
};
|
|
524
|
+
if (!opt) opt = {};
|
|
525
|
+
if (keys == null) return '';
|
|
526
|
+
if (typeof keys === 'function') keys = keysFromSelector(keys, {
|
|
527
|
+
...this.options,
|
|
528
|
+
...opt
|
|
529
|
+
});
|
|
530
|
+
if (!Array.isArray(keys)) keys = [String(keys)];
|
|
531
|
+
const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
|
|
532
|
+
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
|
|
533
|
+
const {
|
|
534
|
+
key,
|
|
535
|
+
namespaces
|
|
536
|
+
} = this.extractFromKey(keys[keys.length - 1], opt);
|
|
537
|
+
const namespace = namespaces[namespaces.length - 1];
|
|
538
|
+
let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;
|
|
539
|
+
if (nsSeparator === undefined) nsSeparator = ':';
|
|
540
|
+
const lng = opt.lng || this.language;
|
|
541
|
+
const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
542
|
+
if (lng?.toLowerCase() === 'cimode') {
|
|
543
|
+
if (appendNamespaceToCIMode) {
|
|
544
|
+
if (returnDetails) {
|
|
545
|
+
return {
|
|
546
|
+
res: `${namespace}${nsSeparator}${key}`,
|
|
547
|
+
usedKey: key,
|
|
548
|
+
exactUsedKey: key,
|
|
549
|
+
usedLng: lng,
|
|
550
|
+
usedNS: namespace,
|
|
551
|
+
usedParams: this.getUsedParamsDetails(opt)
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
return `${namespace}${nsSeparator}${key}`;
|
|
555
|
+
}
|
|
556
|
+
if (returnDetails) {
|
|
557
|
+
return {
|
|
558
|
+
res: key,
|
|
559
|
+
usedKey: key,
|
|
560
|
+
exactUsedKey: key,
|
|
561
|
+
usedLng: lng,
|
|
562
|
+
usedNS: namespace,
|
|
563
|
+
usedParams: this.getUsedParamsDetails(opt)
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
return key;
|
|
567
|
+
}
|
|
568
|
+
const resolved = this.resolve(keys, opt);
|
|
569
|
+
let res = resolved?.res;
|
|
570
|
+
const resUsedKey = resolved?.usedKey || key;
|
|
571
|
+
const resExactUsedKey = resolved?.exactUsedKey || key;
|
|
572
|
+
const noObject = ['[object Number]', '[object Function]', '[object RegExp]'];
|
|
573
|
+
const joinArrays = opt.joinArrays !== undefined ? opt.joinArrays : this.options.joinArrays;
|
|
574
|
+
const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
|
|
575
|
+
const needsPluralHandling = opt.count !== undefined && !isString(opt.count);
|
|
576
|
+
const hasDefaultValue = Translator.hasDefaultValue(opt);
|
|
577
|
+
const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : '';
|
|
578
|
+
const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, {
|
|
579
|
+
ordinal: false
|
|
580
|
+
}) : '';
|
|
581
|
+
const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
|
|
582
|
+
const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue;
|
|
583
|
+
let resForObjHndl = res;
|
|
584
|
+
if (handleAsObjectInI18nFormat && !res && hasDefaultValue) {
|
|
585
|
+
resForObjHndl = defaultValue;
|
|
586
|
+
}
|
|
587
|
+
const handleAsObject = shouldHandleAsObject(resForObjHndl);
|
|
588
|
+
const resType = Object.prototype.toString.apply(resForObjHndl);
|
|
589
|
+
if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {
|
|
590
|
+
if (!opt.returnObjects && !this.options.returnObjects) {
|
|
591
|
+
if (!this.options.returnedObjectHandler) {
|
|
592
|
+
this.logger.warn('accessing an object - but returnObjects options is not enabled!');
|
|
593
|
+
}
|
|
594
|
+
const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, {
|
|
595
|
+
...opt,
|
|
596
|
+
ns: namespaces
|
|
597
|
+
}) : `key '${key} (${this.language})' returned an object instead of string.`;
|
|
598
|
+
if (returnDetails) {
|
|
599
|
+
resolved.res = r;
|
|
600
|
+
resolved.usedParams = this.getUsedParamsDetails(opt);
|
|
601
|
+
return resolved;
|
|
602
|
+
}
|
|
603
|
+
return r;
|
|
604
|
+
}
|
|
605
|
+
if (keySeparator) {
|
|
606
|
+
const resTypeIsArray = Array.isArray(resForObjHndl);
|
|
607
|
+
const copy = resTypeIsArray ? [] : {};
|
|
608
|
+
const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
|
|
609
|
+
for (const m in resForObjHndl) {
|
|
610
|
+
if (Object.prototype.hasOwnProperty.call(resForObjHndl, m)) {
|
|
611
|
+
const deepKey = `${newKeyToUse}${keySeparator}${m}`;
|
|
612
|
+
if (hasDefaultValue && !res) {
|
|
613
|
+
copy[m] = this.translate(deepKey, {
|
|
614
|
+
...opt,
|
|
615
|
+
defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m] : undefined,
|
|
616
|
+
...{
|
|
617
|
+
joinArrays: false,
|
|
618
|
+
ns: namespaces
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
} else {
|
|
622
|
+
copy[m] = this.translate(deepKey, {
|
|
623
|
+
...opt,
|
|
624
|
+
...{
|
|
625
|
+
joinArrays: false,
|
|
626
|
+
ns: namespaces
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
if (copy[m] === deepKey) copy[m] = resForObjHndl[m];
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
res = copy;
|
|
634
|
+
}
|
|
635
|
+
} else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) {
|
|
636
|
+
res = res.join(joinArrays);
|
|
637
|
+
if (res) res = this.extendTranslation(res, keys, opt, lastKey);
|
|
638
|
+
} else {
|
|
639
|
+
let usedDefault = false;
|
|
640
|
+
let usedKey = false;
|
|
641
|
+
if (!this.isValidLookup(res) && hasDefaultValue) {
|
|
642
|
+
usedDefault = true;
|
|
643
|
+
res = defaultValue;
|
|
644
|
+
}
|
|
645
|
+
if (!this.isValidLookup(res)) {
|
|
646
|
+
usedKey = true;
|
|
647
|
+
res = key;
|
|
648
|
+
}
|
|
649
|
+
const missingKeyNoValueFallbackToKey = opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
|
|
650
|
+
const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;
|
|
651
|
+
const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
|
|
652
|
+
if (usedKey || usedDefault || updateMissing) {
|
|
653
|
+
this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);
|
|
654
|
+
if (keySeparator) {
|
|
655
|
+
const fk = this.resolve(key, {
|
|
656
|
+
...opt,
|
|
657
|
+
keySeparator: false
|
|
658
|
+
});
|
|
659
|
+
if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');
|
|
660
|
+
}
|
|
661
|
+
let lngs = [];
|
|
662
|
+
const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language);
|
|
663
|
+
if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {
|
|
664
|
+
for (let i = 0; i < fallbackLngs.length; i++) {
|
|
665
|
+
lngs.push(fallbackLngs[i]);
|
|
666
|
+
}
|
|
667
|
+
} else if (this.options.saveMissingTo === 'all') {
|
|
668
|
+
lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language);
|
|
669
|
+
} else {
|
|
670
|
+
lngs.push(opt.lng || this.language);
|
|
671
|
+
}
|
|
672
|
+
const send = (l, k, specificDefaultValue) => {
|
|
673
|
+
const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
|
|
674
|
+
if (this.options.missingKeyHandler) {
|
|
675
|
+
this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, opt);
|
|
676
|
+
} else if (this.backendConnector?.saveMissing) {
|
|
677
|
+
this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, opt);
|
|
678
|
+
}
|
|
679
|
+
this.emit('missingKey', l, namespace, k, res);
|
|
680
|
+
};
|
|
681
|
+
if (this.options.saveMissing) {
|
|
682
|
+
if (this.options.saveMissingPlurals && needsPluralHandling) {
|
|
683
|
+
lngs.forEach(language => {
|
|
684
|
+
const suffixes = this.pluralResolver.getSuffixes(language, opt);
|
|
685
|
+
if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) {
|
|
686
|
+
suffixes.push(`${this.options.pluralSeparator}zero`);
|
|
687
|
+
}
|
|
688
|
+
suffixes.forEach(suffix => {
|
|
689
|
+
send([language], key + suffix, opt[`defaultValue${suffix}`] || defaultValue);
|
|
690
|
+
});
|
|
691
|
+
});
|
|
692
|
+
} else {
|
|
693
|
+
send(lngs, key, defaultValue);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
res = this.extendTranslation(res, keys, opt, resolved, lastKey);
|
|
698
|
+
if (usedKey && res === key && this.options.appendNamespaceToMissingKey) {
|
|
699
|
+
res = `${namespace}${nsSeparator}${key}`;
|
|
700
|
+
}
|
|
701
|
+
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
|
|
702
|
+
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : undefined, opt);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if (returnDetails) {
|
|
706
|
+
resolved.res = res;
|
|
707
|
+
resolved.usedParams = this.getUsedParamsDetails(opt);
|
|
708
|
+
return resolved;
|
|
709
|
+
}
|
|
710
|
+
return res;
|
|
711
|
+
}
|
|
712
|
+
extendTranslation(res, key, opt, resolved, lastKey) {
|
|
713
|
+
if (this.i18nFormat?.parse) {
|
|
714
|
+
res = this.i18nFormat.parse(res, {
|
|
715
|
+
...this.options.interpolation.defaultVariables,
|
|
716
|
+
...opt
|
|
717
|
+
}, opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, {
|
|
718
|
+
resolved
|
|
719
|
+
});
|
|
720
|
+
} else if (!opt.skipInterpolation) {
|
|
721
|
+
if (opt.interpolation) this.interpolator.init({
|
|
722
|
+
...opt,
|
|
723
|
+
...{
|
|
724
|
+
interpolation: {
|
|
725
|
+
...this.options.interpolation,
|
|
726
|
+
...opt.interpolation
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
const skipOnVariables = isString(res) && (opt?.interpolation?.skipOnVariables !== undefined ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
731
|
+
let nestBef;
|
|
732
|
+
if (skipOnVariables) {
|
|
733
|
+
const nb = res.match(this.interpolator.nestingRegexp);
|
|
734
|
+
nestBef = nb && nb.length;
|
|
735
|
+
}
|
|
736
|
+
let data = opt.replace && !isString(opt.replace) ? opt.replace : opt;
|
|
737
|
+
if (this.options.interpolation.defaultVariables) data = {
|
|
738
|
+
...this.options.interpolation.defaultVariables,
|
|
739
|
+
...data
|
|
740
|
+
};
|
|
741
|
+
res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt);
|
|
742
|
+
if (skipOnVariables) {
|
|
743
|
+
const na = res.match(this.interpolator.nestingRegexp);
|
|
744
|
+
const nestAft = na && na.length;
|
|
745
|
+
if (nestBef < nestAft) opt.nest = false;
|
|
746
|
+
}
|
|
747
|
+
if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng;
|
|
748
|
+
if (opt.nest !== false) res = this.interpolator.nest(res, (...args) => {
|
|
749
|
+
if (lastKey?.[0] === args[0] && !opt.context) {
|
|
750
|
+
this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
|
|
751
|
+
return null;
|
|
752
|
+
}
|
|
753
|
+
return this.translate(...args, key);
|
|
754
|
+
}, opt);
|
|
755
|
+
if (opt.interpolation) this.interpolator.reset();
|
|
756
|
+
}
|
|
757
|
+
const postProcess = opt.postProcess || this.options.postProcess;
|
|
758
|
+
const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;
|
|
759
|
+
if (res != null && postProcessorNames?.length && opt.applyPostProcessor !== false) {
|
|
760
|
+
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
|
|
761
|
+
i18nResolved: {
|
|
762
|
+
...resolved,
|
|
763
|
+
usedParams: this.getUsedParamsDetails(opt)
|
|
764
|
+
},
|
|
765
|
+
...opt
|
|
766
|
+
} : opt, this);
|
|
767
|
+
}
|
|
768
|
+
return res;
|
|
769
|
+
}
|
|
770
|
+
resolve(keys, opt = {}) {
|
|
771
|
+
let found;
|
|
772
|
+
let usedKey;
|
|
773
|
+
let exactUsedKey;
|
|
774
|
+
let usedLng;
|
|
775
|
+
let usedNS;
|
|
776
|
+
if (isString(keys)) keys = [keys];
|
|
777
|
+
keys.forEach(k => {
|
|
778
|
+
if (this.isValidLookup(found)) return;
|
|
779
|
+
const extracted = this.extractFromKey(k, opt);
|
|
780
|
+
const key = extracted.key;
|
|
781
|
+
usedKey = key;
|
|
782
|
+
let namespaces = extracted.namespaces;
|
|
783
|
+
if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
|
|
784
|
+
const needsPluralHandling = opt.count !== undefined && !isString(opt.count);
|
|
785
|
+
const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
|
|
786
|
+
const needsContextHandling = opt.context !== undefined && (isString(opt.context) || typeof opt.context === 'number') && opt.context !== '';
|
|
787
|
+
const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng);
|
|
788
|
+
namespaces.forEach(ns => {
|
|
789
|
+
if (this.isValidLookup(found)) return;
|
|
790
|
+
usedNS = ns;
|
|
791
|
+
if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
|
|
792
|
+
checkedLoadedFor[`${codes[0]}-${ns}`] = true;
|
|
793
|
+
this.logger.warn(`key "${usedKey}" for languages "${codes.join(', ')}" won't get resolved as namespace "${usedNS}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
|
794
|
+
}
|
|
795
|
+
codes.forEach(code => {
|
|
796
|
+
if (this.isValidLookup(found)) return;
|
|
797
|
+
usedLng = code;
|
|
798
|
+
const finalKeys = [key];
|
|
799
|
+
if (this.i18nFormat?.addLookupKeys) {
|
|
800
|
+
this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt);
|
|
801
|
+
} else {
|
|
802
|
+
let pluralSuffix;
|
|
803
|
+
if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt);
|
|
804
|
+
const zeroSuffix = `${this.options.pluralSeparator}zero`;
|
|
805
|
+
const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
806
|
+
if (needsPluralHandling) {
|
|
807
|
+
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
|
|
808
|
+
finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
|
|
809
|
+
}
|
|
810
|
+
finalKeys.push(key + pluralSuffix);
|
|
811
|
+
if (needsZeroSuffixLookup) {
|
|
812
|
+
finalKeys.push(key + zeroSuffix);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
if (needsContextHandling) {
|
|
816
|
+
const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`;
|
|
817
|
+
finalKeys.push(contextKey);
|
|
818
|
+
if (needsPluralHandling) {
|
|
819
|
+
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
|
|
820
|
+
finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
|
|
821
|
+
}
|
|
822
|
+
finalKeys.push(contextKey + pluralSuffix);
|
|
823
|
+
if (needsZeroSuffixLookup) {
|
|
824
|
+
finalKeys.push(contextKey + zeroSuffix);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
let possibleKey;
|
|
830
|
+
while (possibleKey = finalKeys.pop()) {
|
|
831
|
+
if (!this.isValidLookup(found)) {
|
|
832
|
+
exactUsedKey = possibleKey;
|
|
833
|
+
found = this.getResource(code, ns, possibleKey, opt);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
});
|
|
838
|
+
});
|
|
839
|
+
return {
|
|
840
|
+
res: found,
|
|
841
|
+
usedKey,
|
|
842
|
+
exactUsedKey,
|
|
843
|
+
usedLng,
|
|
844
|
+
usedNS
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
isValidLookup(res) {
|
|
848
|
+
return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');
|
|
849
|
+
}
|
|
850
|
+
getResource(code, ns, key, options = {}) {
|
|
851
|
+
if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
|
|
852
|
+
return this.resourceStore.getResource(code, ns, key, options);
|
|
853
|
+
}
|
|
854
|
+
getUsedParamsDetails(options = {}) {
|
|
855
|
+
const optionsKeys = ['defaultValue', 'ordinal', 'context', 'replace', 'lng', 'lngs', 'fallbackLng', 'ns', 'keySeparator', 'nsSeparator', 'returnObjects', 'returnDetails', 'joinArrays', 'postProcess', 'interpolation'];
|
|
856
|
+
const useOptionsReplaceForData = options.replace && !isString(options.replace);
|
|
857
|
+
let data = useOptionsReplaceForData ? options.replace : options;
|
|
858
|
+
if (useOptionsReplaceForData && typeof options.count !== 'undefined') {
|
|
859
|
+
data.count = options.count;
|
|
860
|
+
}
|
|
861
|
+
if (this.options.interpolation.defaultVariables) {
|
|
862
|
+
data = {
|
|
863
|
+
...this.options.interpolation.defaultVariables,
|
|
864
|
+
...data
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
if (!useOptionsReplaceForData) {
|
|
868
|
+
data = {
|
|
869
|
+
...data
|
|
870
|
+
};
|
|
871
|
+
for (const key of optionsKeys) {
|
|
872
|
+
delete data[key];
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
return data;
|
|
876
|
+
}
|
|
877
|
+
static hasDefaultValue(options) {
|
|
878
|
+
const prefix = 'defaultValue';
|
|
879
|
+
for (const option in options) {
|
|
880
|
+
if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {
|
|
881
|
+
return true;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
return false;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
class LanguageUtil {
|
|
889
|
+
constructor(options) {
|
|
890
|
+
this.options = options;
|
|
891
|
+
this.supportedLngs = this.options.supportedLngs || false;
|
|
892
|
+
this.logger = baseLogger.create('languageUtils');
|
|
893
|
+
}
|
|
894
|
+
getScriptPartFromCode(code) {
|
|
895
|
+
code = getCleanedCode(code);
|
|
896
|
+
if (!code || code.indexOf('-') < 0) return null;
|
|
897
|
+
const p = code.split('-');
|
|
898
|
+
if (p.length === 2) return null;
|
|
899
|
+
p.pop();
|
|
900
|
+
if (p[p.length - 1].toLowerCase() === 'x') return null;
|
|
901
|
+
return this.formatLanguageCode(p.join('-'));
|
|
902
|
+
}
|
|
903
|
+
getLanguagePartFromCode(code) {
|
|
904
|
+
code = getCleanedCode(code);
|
|
905
|
+
if (!code || code.indexOf('-') < 0) return code;
|
|
906
|
+
const p = code.split('-');
|
|
907
|
+
return this.formatLanguageCode(p[0]);
|
|
908
|
+
}
|
|
909
|
+
formatLanguageCode(code) {
|
|
910
|
+
if (isString(code) && code.indexOf('-') > -1) {
|
|
911
|
+
let formattedCode;
|
|
912
|
+
try {
|
|
913
|
+
formattedCode = Intl.getCanonicalLocales(code)[0];
|
|
914
|
+
} catch (e) {}
|
|
915
|
+
if (formattedCode && this.options.lowerCaseLng) {
|
|
916
|
+
formattedCode = formattedCode.toLowerCase();
|
|
917
|
+
}
|
|
918
|
+
if (formattedCode) return formattedCode;
|
|
919
|
+
if (this.options.lowerCaseLng) {
|
|
920
|
+
return code.toLowerCase();
|
|
921
|
+
}
|
|
922
|
+
return code;
|
|
923
|
+
}
|
|
924
|
+
return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
|
|
925
|
+
}
|
|
926
|
+
isSupportedCode(code) {
|
|
927
|
+
if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {
|
|
928
|
+
code = this.getLanguagePartFromCode(code);
|
|
929
|
+
}
|
|
930
|
+
return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
|
|
931
|
+
}
|
|
932
|
+
getBestMatchFromCodes(codes) {
|
|
933
|
+
if (!codes) return null;
|
|
934
|
+
let found;
|
|
935
|
+
codes.forEach(code => {
|
|
936
|
+
if (found) return;
|
|
937
|
+
const cleanedLng = this.formatLanguageCode(code);
|
|
938
|
+
if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng;
|
|
939
|
+
});
|
|
940
|
+
if (!found && this.options.supportedLngs) {
|
|
941
|
+
codes.forEach(code => {
|
|
942
|
+
if (found) return;
|
|
943
|
+
const lngScOnly = this.getScriptPartFromCode(code);
|
|
944
|
+
if (this.isSupportedCode(lngScOnly)) return found = lngScOnly;
|
|
945
|
+
const lngOnly = this.getLanguagePartFromCode(code);
|
|
946
|
+
if (this.isSupportedCode(lngOnly)) return found = lngOnly;
|
|
947
|
+
found = this.options.supportedLngs.find(supportedLng => {
|
|
948
|
+
if (supportedLng === lngOnly) return supportedLng;
|
|
949
|
+
if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;
|
|
950
|
+
if (supportedLng.indexOf('-') > 0 && lngOnly.indexOf('-') < 0 && supportedLng.substring(0, supportedLng.indexOf('-')) === lngOnly) return supportedLng;
|
|
951
|
+
if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng;
|
|
952
|
+
});
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
|
|
956
|
+
return found;
|
|
957
|
+
}
|
|
958
|
+
getFallbackCodes(fallbacks, code) {
|
|
959
|
+
if (!fallbacks) return [];
|
|
960
|
+
if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
|
|
961
|
+
if (isString(fallbacks)) fallbacks = [fallbacks];
|
|
962
|
+
if (Array.isArray(fallbacks)) return fallbacks;
|
|
963
|
+
if (!code) return fallbacks.default || [];
|
|
964
|
+
let found = fallbacks[code];
|
|
965
|
+
if (!found) found = fallbacks[this.getScriptPartFromCode(code)];
|
|
966
|
+
if (!found) found = fallbacks[this.formatLanguageCode(code)];
|
|
967
|
+
if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];
|
|
968
|
+
if (!found) found = fallbacks.default;
|
|
969
|
+
return found || [];
|
|
970
|
+
}
|
|
971
|
+
toResolveHierarchy(code, fallbackCode) {
|
|
972
|
+
const fallbackCodes = this.getFallbackCodes((fallbackCode === false ? [] : fallbackCode) || this.options.fallbackLng || [], code);
|
|
973
|
+
const codes = [];
|
|
974
|
+
const addCode = c => {
|
|
975
|
+
if (!c) return;
|
|
976
|
+
if (this.isSupportedCode(c)) {
|
|
977
|
+
codes.push(c);
|
|
978
|
+
} else {
|
|
979
|
+
this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`);
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
if (isString(code) && (code.indexOf('-') > -1 || code.indexOf('_') > -1)) {
|
|
983
|
+
if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));
|
|
984
|
+
if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));
|
|
985
|
+
if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));
|
|
986
|
+
} else if (isString(code)) {
|
|
987
|
+
addCode(this.formatLanguageCode(code));
|
|
988
|
+
}
|
|
989
|
+
fallbackCodes.forEach(fc => {
|
|
990
|
+
if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc));
|
|
991
|
+
});
|
|
992
|
+
return codes;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
const suffixesOrder = {
|
|
997
|
+
zero: 0,
|
|
998
|
+
one: 1,
|
|
999
|
+
two: 2,
|
|
1000
|
+
few: 3,
|
|
1001
|
+
many: 4,
|
|
1002
|
+
other: 5
|
|
1003
|
+
};
|
|
1004
|
+
const dummyRule = {
|
|
1005
|
+
select: count => count === 1 ? 'one' : 'other',
|
|
1006
|
+
resolvedOptions: () => ({
|
|
1007
|
+
pluralCategories: ['one', 'other']
|
|
1008
|
+
})
|
|
1009
|
+
};
|
|
1010
|
+
class PluralResolver {
|
|
1011
|
+
constructor(languageUtils, options = {}) {
|
|
1012
|
+
this.languageUtils = languageUtils;
|
|
1013
|
+
this.options = options;
|
|
1014
|
+
this.logger = baseLogger.create('pluralResolver');
|
|
1015
|
+
this.pluralRulesCache = {};
|
|
1016
|
+
}
|
|
1017
|
+
clearCache() {
|
|
1018
|
+
this.pluralRulesCache = {};
|
|
1019
|
+
}
|
|
1020
|
+
getRule(code, options = {}) {
|
|
1021
|
+
const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);
|
|
1022
|
+
const type = options.ordinal ? 'ordinal' : 'cardinal';
|
|
1023
|
+
const cacheKey = JSON.stringify({
|
|
1024
|
+
cleanedCode,
|
|
1025
|
+
type
|
|
1026
|
+
});
|
|
1027
|
+
if (cacheKey in this.pluralRulesCache) {
|
|
1028
|
+
return this.pluralRulesCache[cacheKey];
|
|
1029
|
+
}
|
|
1030
|
+
let rule;
|
|
1031
|
+
try {
|
|
1032
|
+
rule = new Intl.PluralRules(cleanedCode, {
|
|
1033
|
+
type
|
|
1034
|
+
});
|
|
1035
|
+
} catch (err) {
|
|
1036
|
+
if (!Intl) {
|
|
1037
|
+
this.logger.error('No Intl support, please use an Intl polyfill!');
|
|
1038
|
+
return dummyRule;
|
|
1039
|
+
}
|
|
1040
|
+
if (!code.match(/-|_/)) return dummyRule;
|
|
1041
|
+
const lngPart = this.languageUtils.getLanguagePartFromCode(code);
|
|
1042
|
+
rule = this.getRule(lngPart, options);
|
|
1043
|
+
}
|
|
1044
|
+
this.pluralRulesCache[cacheKey] = rule;
|
|
1045
|
+
return rule;
|
|
1046
|
+
}
|
|
1047
|
+
needsPlural(code, options = {}) {
|
|
1048
|
+
let rule = this.getRule(code, options);
|
|
1049
|
+
if (!rule) rule = this.getRule('dev', options);
|
|
1050
|
+
return rule?.resolvedOptions().pluralCategories.length > 1;
|
|
1051
|
+
}
|
|
1052
|
+
getPluralFormsOfKey(code, key, options = {}) {
|
|
1053
|
+
return this.getSuffixes(code, options).map(suffix => `${key}${suffix}`);
|
|
1054
|
+
}
|
|
1055
|
+
getSuffixes(code, options = {}) {
|
|
1056
|
+
let rule = this.getRule(code, options);
|
|
1057
|
+
if (!rule) rule = this.getRule('dev', options);
|
|
1058
|
+
if (!rule) return [];
|
|
1059
|
+
return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
|
|
1060
|
+
}
|
|
1061
|
+
getSuffix(code, count, options = {}) {
|
|
1062
|
+
const rule = this.getRule(code, options);
|
|
1063
|
+
if (rule) {
|
|
1064
|
+
return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
|
|
1065
|
+
}
|
|
1066
|
+
this.logger.warn(`no plural rule found for: ${code}`);
|
|
1067
|
+
return this.getSuffix('dev', count, options);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
const deepFindWithDefaults = (data, defaultData, key, keySeparator = '.', ignoreJSONStructure = true) => {
|
|
1072
|
+
let path = getPathWithDefaults(data, defaultData, key);
|
|
1073
|
+
if (!path && ignoreJSONStructure && isString(key)) {
|
|
1074
|
+
path = deepFind(data, key, keySeparator);
|
|
1075
|
+
if (path === undefined) path = deepFind(defaultData, key, keySeparator);
|
|
1076
|
+
}
|
|
1077
|
+
return path;
|
|
1078
|
+
};
|
|
1079
|
+
const regexSafe = val => val.replace(/\$/g, '$$$$');
|
|
1080
|
+
class Interpolator {
|
|
1081
|
+
constructor(options = {}) {
|
|
1082
|
+
this.logger = baseLogger.create('interpolator');
|
|
1083
|
+
this.options = options;
|
|
1084
|
+
this.format = options?.interpolation?.format || (value => value);
|
|
1085
|
+
this.init(options);
|
|
1086
|
+
}
|
|
1087
|
+
init(options = {}) {
|
|
1088
|
+
if (!options.interpolation) options.interpolation = {
|
|
1089
|
+
escapeValue: true
|
|
1090
|
+
};
|
|
1091
|
+
const {
|
|
1092
|
+
escape: escape$1,
|
|
1093
|
+
escapeValue,
|
|
1094
|
+
useRawValueToEscape,
|
|
1095
|
+
prefix,
|
|
1096
|
+
prefixEscaped,
|
|
1097
|
+
suffix,
|
|
1098
|
+
suffixEscaped,
|
|
1099
|
+
formatSeparator,
|
|
1100
|
+
unescapeSuffix,
|
|
1101
|
+
unescapePrefix,
|
|
1102
|
+
nestingPrefix,
|
|
1103
|
+
nestingPrefixEscaped,
|
|
1104
|
+
nestingSuffix,
|
|
1105
|
+
nestingSuffixEscaped,
|
|
1106
|
+
nestingOptionsSeparator,
|
|
1107
|
+
maxReplaces,
|
|
1108
|
+
alwaysFormat
|
|
1109
|
+
} = options.interpolation;
|
|
1110
|
+
this.escape = escape$1 !== undefined ? escape$1 : escape;
|
|
1111
|
+
this.escapeValue = escapeValue !== undefined ? escapeValue : true;
|
|
1112
|
+
this.useRawValueToEscape = useRawValueToEscape !== undefined ? useRawValueToEscape : false;
|
|
1113
|
+
this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || '{{';
|
|
1114
|
+
this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || '}}';
|
|
1115
|
+
this.formatSeparator = formatSeparator || ',';
|
|
1116
|
+
this.unescapePrefix = unescapeSuffix ? '' : unescapePrefix || '-';
|
|
1117
|
+
this.unescapeSuffix = this.unescapePrefix ? '' : unescapeSuffix || '';
|
|
1118
|
+
this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape('$t(');
|
|
1119
|
+
this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(')');
|
|
1120
|
+
this.nestingOptionsSeparator = nestingOptionsSeparator || ',';
|
|
1121
|
+
this.maxReplaces = maxReplaces || 1000;
|
|
1122
|
+
this.alwaysFormat = alwaysFormat !== undefined ? alwaysFormat : false;
|
|
1123
|
+
this.resetRegExp();
|
|
1124
|
+
}
|
|
1125
|
+
reset() {
|
|
1126
|
+
if (this.options) this.init(this.options);
|
|
1127
|
+
}
|
|
1128
|
+
resetRegExp() {
|
|
1129
|
+
const getOrResetRegExp = (existingRegExp, pattern) => {
|
|
1130
|
+
if (existingRegExp?.source === pattern) {
|
|
1131
|
+
existingRegExp.lastIndex = 0;
|
|
1132
|
+
return existingRegExp;
|
|
1133
|
+
}
|
|
1134
|
+
return new RegExp(pattern, 'g');
|
|
1135
|
+
};
|
|
1136
|
+
this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
|
|
1137
|
+
this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
|
|
1138
|
+
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
|
|
1139
|
+
}
|
|
1140
|
+
interpolate(str, data, lng, options) {
|
|
1141
|
+
let match;
|
|
1142
|
+
let value;
|
|
1143
|
+
let replaces;
|
|
1144
|
+
const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
|
|
1145
|
+
const handleFormat = key => {
|
|
1146
|
+
if (key.indexOf(this.formatSeparator) < 0) {
|
|
1147
|
+
const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1148
|
+
return this.alwaysFormat ? this.format(path, undefined, lng, {
|
|
1149
|
+
...options,
|
|
1150
|
+
...data,
|
|
1151
|
+
interpolationkey: key
|
|
1152
|
+
}) : path;
|
|
1153
|
+
}
|
|
1154
|
+
const p = key.split(this.formatSeparator);
|
|
1155
|
+
const k = p.shift().trim();
|
|
1156
|
+
const f = p.join(this.formatSeparator).trim();
|
|
1157
|
+
return this.format(deepFindWithDefaults(data, defaultData, k, this.options.keySeparator, this.options.ignoreJSONStructure), f, lng, {
|
|
1158
|
+
...options,
|
|
1159
|
+
...data,
|
|
1160
|
+
interpolationkey: k
|
|
1161
|
+
});
|
|
1162
|
+
};
|
|
1163
|
+
this.resetRegExp();
|
|
1164
|
+
const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
|
|
1165
|
+
const skipOnVariables = options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
1166
|
+
const todos = [{
|
|
1167
|
+
regex: this.regexpUnescape,
|
|
1168
|
+
safeValue: val => regexSafe(val)
|
|
1169
|
+
}, {
|
|
1170
|
+
regex: this.regexp,
|
|
1171
|
+
safeValue: val => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val)
|
|
1172
|
+
}];
|
|
1173
|
+
todos.forEach(todo => {
|
|
1174
|
+
replaces = 0;
|
|
1175
|
+
while (match = todo.regex.exec(str)) {
|
|
1176
|
+
const matchedVar = match[1].trim();
|
|
1177
|
+
value = handleFormat(matchedVar);
|
|
1178
|
+
if (value === undefined) {
|
|
1179
|
+
if (typeof missingInterpolationHandler === 'function') {
|
|
1180
|
+
const temp = missingInterpolationHandler(str, match, options);
|
|
1181
|
+
value = isString(temp) ? temp : '';
|
|
1182
|
+
} else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
|
|
1183
|
+
value = '';
|
|
1184
|
+
} else if (skipOnVariables) {
|
|
1185
|
+
value = match[0];
|
|
1186
|
+
continue;
|
|
1187
|
+
} else {
|
|
1188
|
+
this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);
|
|
1189
|
+
value = '';
|
|
1190
|
+
}
|
|
1191
|
+
} else if (!isString(value) && !this.useRawValueToEscape) {
|
|
1192
|
+
value = makeString(value);
|
|
1193
|
+
}
|
|
1194
|
+
const safeValue = todo.safeValue(value);
|
|
1195
|
+
str = str.replace(match[0], safeValue);
|
|
1196
|
+
if (skipOnVariables) {
|
|
1197
|
+
todo.regex.lastIndex += value.length;
|
|
1198
|
+
todo.regex.lastIndex -= match[0].length;
|
|
1199
|
+
} else {
|
|
1200
|
+
todo.regex.lastIndex = 0;
|
|
1201
|
+
}
|
|
1202
|
+
replaces++;
|
|
1203
|
+
if (replaces >= this.maxReplaces) {
|
|
1204
|
+
break;
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
});
|
|
1208
|
+
return str;
|
|
1209
|
+
}
|
|
1210
|
+
nest(str, fc, options = {}) {
|
|
1211
|
+
let match;
|
|
1212
|
+
let value;
|
|
1213
|
+
let clonedOptions;
|
|
1214
|
+
const handleHasOptions = (key, inheritedOptions) => {
|
|
1215
|
+
const sep = this.nestingOptionsSeparator;
|
|
1216
|
+
if (key.indexOf(sep) < 0) return key;
|
|
1217
|
+
const c = key.split(new RegExp(`${sep}[ ]*{`));
|
|
1218
|
+
let optionsString = `{${c[1]}`;
|
|
1219
|
+
key = c[0];
|
|
1220
|
+
optionsString = this.interpolate(optionsString, clonedOptions);
|
|
1221
|
+
const matchedSingleQuotes = optionsString.match(/'/g);
|
|
1222
|
+
const matchedDoubleQuotes = optionsString.match(/"/g);
|
|
1223
|
+
if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
|
|
1224
|
+
optionsString = optionsString.replace(/'/g, '"');
|
|
1225
|
+
}
|
|
1226
|
+
try {
|
|
1227
|
+
clonedOptions = JSON.parse(optionsString);
|
|
1228
|
+
if (inheritedOptions) clonedOptions = {
|
|
1229
|
+
...inheritedOptions,
|
|
1230
|
+
...clonedOptions
|
|
1231
|
+
};
|
|
1232
|
+
} catch (e) {
|
|
1233
|
+
this.logger.warn(`failed parsing options string in nesting for key ${key}`, e);
|
|
1234
|
+
return `${key}${sep}${optionsString}`;
|
|
1235
|
+
}
|
|
1236
|
+
if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue;
|
|
1237
|
+
return key;
|
|
1238
|
+
};
|
|
1239
|
+
while (match = this.nestingRegexp.exec(str)) {
|
|
1240
|
+
let formatters = [];
|
|
1241
|
+
clonedOptions = {
|
|
1242
|
+
...options
|
|
1243
|
+
};
|
|
1244
|
+
clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;
|
|
1245
|
+
clonedOptions.applyPostProcessor = false;
|
|
1246
|
+
delete clonedOptions.defaultValue;
|
|
1247
|
+
const keyEndIndex = /{.*}/.test(match[1]) ? match[1].lastIndexOf('}') + 1 : match[1].indexOf(this.formatSeparator);
|
|
1248
|
+
if (keyEndIndex !== -1) {
|
|
1249
|
+
formatters = match[1].slice(keyEndIndex).split(this.formatSeparator).map(elem => elem.trim()).filter(Boolean);
|
|
1250
|
+
match[1] = match[1].slice(0, keyEndIndex);
|
|
1251
|
+
}
|
|
1252
|
+
value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
|
|
1253
|
+
if (value && match[0] === str && !isString(value)) return value;
|
|
1254
|
+
if (!isString(value)) value = makeString(value);
|
|
1255
|
+
if (!value) {
|
|
1256
|
+
this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);
|
|
1257
|
+
value = '';
|
|
1258
|
+
}
|
|
1259
|
+
if (formatters.length) {
|
|
1260
|
+
value = formatters.reduce((v, f) => this.format(v, f, options.lng, {
|
|
1261
|
+
...options,
|
|
1262
|
+
interpolationkey: match[1].trim()
|
|
1263
|
+
}), value.trim());
|
|
1264
|
+
}
|
|
1265
|
+
str = str.replace(match[0], value);
|
|
1266
|
+
this.regexp.lastIndex = 0;
|
|
1267
|
+
}
|
|
1268
|
+
return str;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
const parseFormatStr = formatStr => {
|
|
1273
|
+
let formatName = formatStr.toLowerCase().trim();
|
|
1274
|
+
const formatOptions = {};
|
|
1275
|
+
if (formatStr.indexOf('(') > -1) {
|
|
1276
|
+
const p = formatStr.split('(');
|
|
1277
|
+
formatName = p[0].toLowerCase().trim();
|
|
1278
|
+
const optStr = p[1].substring(0, p[1].length - 1);
|
|
1279
|
+
if (formatName === 'currency' && optStr.indexOf(':') < 0) {
|
|
1280
|
+
if (!formatOptions.currency) formatOptions.currency = optStr.trim();
|
|
1281
|
+
} else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {
|
|
1282
|
+
if (!formatOptions.range) formatOptions.range = optStr.trim();
|
|
1283
|
+
} else {
|
|
1284
|
+
const opts = optStr.split(';');
|
|
1285
|
+
opts.forEach(opt => {
|
|
1286
|
+
if (opt) {
|
|
1287
|
+
const [key, ...rest] = opt.split(':');
|
|
1288
|
+
const val = rest.join(':').trim().replace(/^'+|'+$/g, '');
|
|
1289
|
+
const trimmedKey = key.trim();
|
|
1290
|
+
if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val;
|
|
1291
|
+
if (val === 'false') formatOptions[trimmedKey] = false;
|
|
1292
|
+
if (val === 'true') formatOptions[trimmedKey] = true;
|
|
1293
|
+
if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10);
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
return {
|
|
1299
|
+
formatName,
|
|
1300
|
+
formatOptions
|
|
1301
|
+
};
|
|
1302
|
+
};
|
|
1303
|
+
const createCachedFormatter = fn => {
|
|
1304
|
+
const cache = {};
|
|
1305
|
+
return (v, l, o) => {
|
|
1306
|
+
let optForCache = o;
|
|
1307
|
+
if (o && o.interpolationkey && o.formatParams && o.formatParams[o.interpolationkey] && o[o.interpolationkey]) {
|
|
1308
|
+
optForCache = {
|
|
1309
|
+
...optForCache,
|
|
1310
|
+
[o.interpolationkey]: undefined
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
const key = l + JSON.stringify(optForCache);
|
|
1314
|
+
let frm = cache[key];
|
|
1315
|
+
if (!frm) {
|
|
1316
|
+
frm = fn(getCleanedCode(l), o);
|
|
1317
|
+
cache[key] = frm;
|
|
1318
|
+
}
|
|
1319
|
+
return frm(v);
|
|
1320
|
+
};
|
|
1321
|
+
};
|
|
1322
|
+
const createNonCachedFormatter = fn => (v, l, o) => fn(getCleanedCode(l), o)(v);
|
|
1323
|
+
class Formatter {
|
|
1324
|
+
constructor(options = {}) {
|
|
1325
|
+
this.logger = baseLogger.create('formatter');
|
|
1326
|
+
this.options = options;
|
|
1327
|
+
this.init(options);
|
|
1328
|
+
}
|
|
1329
|
+
init(services, options = {
|
|
1330
|
+
interpolation: {}
|
|
1331
|
+
}) {
|
|
1332
|
+
this.formatSeparator = options.interpolation.formatSeparator || ',';
|
|
1333
|
+
const cf = options.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter;
|
|
1334
|
+
this.formats = {
|
|
1335
|
+
number: cf((lng, opt) => {
|
|
1336
|
+
const formatter = new Intl.NumberFormat(lng, {
|
|
1337
|
+
...opt
|
|
1338
|
+
});
|
|
1339
|
+
return val => formatter.format(val);
|
|
1340
|
+
}),
|
|
1341
|
+
currency: cf((lng, opt) => {
|
|
1342
|
+
const formatter = new Intl.NumberFormat(lng, {
|
|
1343
|
+
...opt,
|
|
1344
|
+
style: 'currency'
|
|
1345
|
+
});
|
|
1346
|
+
return val => formatter.format(val);
|
|
1347
|
+
}),
|
|
1348
|
+
datetime: cf((lng, opt) => {
|
|
1349
|
+
const formatter = new Intl.DateTimeFormat(lng, {
|
|
1350
|
+
...opt
|
|
1351
|
+
});
|
|
1352
|
+
return val => formatter.format(val);
|
|
1353
|
+
}),
|
|
1354
|
+
relativetime: cf((lng, opt) => {
|
|
1355
|
+
const formatter = new Intl.RelativeTimeFormat(lng, {
|
|
1356
|
+
...opt
|
|
1357
|
+
});
|
|
1358
|
+
return val => formatter.format(val, opt.range || 'day');
|
|
1359
|
+
}),
|
|
1360
|
+
list: cf((lng, opt) => {
|
|
1361
|
+
const formatter = new Intl.ListFormat(lng, {
|
|
1362
|
+
...opt
|
|
1363
|
+
});
|
|
1364
|
+
return val => formatter.format(val);
|
|
1365
|
+
})
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
add(name, fc) {
|
|
1369
|
+
this.formats[name.toLowerCase().trim()] = fc;
|
|
1370
|
+
}
|
|
1371
|
+
addCached(name, fc) {
|
|
1372
|
+
this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
|
|
1373
|
+
}
|
|
1374
|
+
format(value, format, lng, options = {}) {
|
|
1375
|
+
const formats = format.split(this.formatSeparator);
|
|
1376
|
+
if (formats.length > 1 && formats[0].indexOf('(') > 1 && formats[0].indexOf(')') < 0 && formats.find(f => f.indexOf(')') > -1)) {
|
|
1377
|
+
const lastIndex = formats.findIndex(f => f.indexOf(')') > -1);
|
|
1378
|
+
formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
|
|
1379
|
+
}
|
|
1380
|
+
const result = formats.reduce((mem, f) => {
|
|
1381
|
+
const {
|
|
1382
|
+
formatName,
|
|
1383
|
+
formatOptions
|
|
1384
|
+
} = parseFormatStr(f);
|
|
1385
|
+
if (this.formats[formatName]) {
|
|
1386
|
+
let formatted = mem;
|
|
1387
|
+
try {
|
|
1388
|
+
const valOptions = options?.formatParams?.[options.interpolationkey] || {};
|
|
1389
|
+
const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
|
|
1390
|
+
formatted = this.formats[formatName](mem, l, {
|
|
1391
|
+
...formatOptions,
|
|
1392
|
+
...options,
|
|
1393
|
+
...valOptions
|
|
1394
|
+
});
|
|
1395
|
+
} catch (error) {
|
|
1396
|
+
this.logger.warn(error);
|
|
1397
|
+
}
|
|
1398
|
+
return formatted;
|
|
1399
|
+
} else {
|
|
1400
|
+
this.logger.warn(`there was no format function for ${formatName}`);
|
|
1401
|
+
}
|
|
1402
|
+
return mem;
|
|
1403
|
+
}, value);
|
|
1404
|
+
return result;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
const removePending = (q, name) => {
|
|
1409
|
+
if (q.pending[name] !== undefined) {
|
|
1410
|
+
delete q.pending[name];
|
|
1411
|
+
q.pendingCount--;
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
class Connector extends EventEmitter {
|
|
1415
|
+
constructor(backend, store, services, options = {}) {
|
|
1416
|
+
super();
|
|
1417
|
+
this.backend = backend;
|
|
1418
|
+
this.store = store;
|
|
1419
|
+
this.services = services;
|
|
1420
|
+
this.languageUtils = services.languageUtils;
|
|
1421
|
+
this.options = options;
|
|
1422
|
+
this.logger = baseLogger.create('backendConnector');
|
|
1423
|
+
this.waitingReads = [];
|
|
1424
|
+
this.maxParallelReads = options.maxParallelReads || 10;
|
|
1425
|
+
this.readingCalls = 0;
|
|
1426
|
+
this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;
|
|
1427
|
+
this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
|
|
1428
|
+
this.state = {};
|
|
1429
|
+
this.queue = [];
|
|
1430
|
+
this.backend?.init?.(services, options.backend, options);
|
|
1431
|
+
}
|
|
1432
|
+
queueLoad(languages, namespaces, options, callback) {
|
|
1433
|
+
const toLoad = {};
|
|
1434
|
+
const pending = {};
|
|
1435
|
+
const toLoadLanguages = {};
|
|
1436
|
+
const toLoadNamespaces = {};
|
|
1437
|
+
languages.forEach(lng => {
|
|
1438
|
+
let hasAllNamespaces = true;
|
|
1439
|
+
namespaces.forEach(ns => {
|
|
1440
|
+
const name = `${lng}|${ns}`;
|
|
1441
|
+
if (!options.reload && this.store.hasResourceBundle(lng, ns)) {
|
|
1442
|
+
this.state[name] = 2;
|
|
1443
|
+
} else if (this.state[name] < 0) ; else if (this.state[name] === 1) {
|
|
1444
|
+
if (pending[name] === undefined) pending[name] = true;
|
|
1445
|
+
} else {
|
|
1446
|
+
this.state[name] = 1;
|
|
1447
|
+
hasAllNamespaces = false;
|
|
1448
|
+
if (pending[name] === undefined) pending[name] = true;
|
|
1449
|
+
if (toLoad[name] === undefined) toLoad[name] = true;
|
|
1450
|
+
if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1453
|
+
if (!hasAllNamespaces) toLoadLanguages[lng] = true;
|
|
1454
|
+
});
|
|
1455
|
+
if (Object.keys(toLoad).length || Object.keys(pending).length) {
|
|
1456
|
+
this.queue.push({
|
|
1457
|
+
pending,
|
|
1458
|
+
pendingCount: Object.keys(pending).length,
|
|
1459
|
+
loaded: {},
|
|
1460
|
+
errors: [],
|
|
1461
|
+
callback
|
|
1462
|
+
});
|
|
1463
|
+
}
|
|
1464
|
+
return {
|
|
1465
|
+
toLoad: Object.keys(toLoad),
|
|
1466
|
+
pending: Object.keys(pending),
|
|
1467
|
+
toLoadLanguages: Object.keys(toLoadLanguages),
|
|
1468
|
+
toLoadNamespaces: Object.keys(toLoadNamespaces)
|
|
1469
|
+
};
|
|
1470
|
+
}
|
|
1471
|
+
loaded(name, err, data) {
|
|
1472
|
+
const s = name.split('|');
|
|
1473
|
+
const lng = s[0];
|
|
1474
|
+
const ns = s[1];
|
|
1475
|
+
if (err) this.emit('failedLoading', lng, ns, err);
|
|
1476
|
+
if (!err && data) {
|
|
1477
|
+
this.store.addResourceBundle(lng, ns, data, undefined, undefined, {
|
|
1478
|
+
skipCopy: true
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
this.state[name] = err ? -1 : 2;
|
|
1482
|
+
if (err && data) this.state[name] = 0;
|
|
1483
|
+
const loaded = {};
|
|
1484
|
+
this.queue.forEach(q => {
|
|
1485
|
+
pushPath(q.loaded, [lng], ns);
|
|
1486
|
+
removePending(q, name);
|
|
1487
|
+
if (err) q.errors.push(err);
|
|
1488
|
+
if (q.pendingCount === 0 && !q.done) {
|
|
1489
|
+
Object.keys(q.loaded).forEach(l => {
|
|
1490
|
+
if (!loaded[l]) loaded[l] = {};
|
|
1491
|
+
const loadedKeys = q.loaded[l];
|
|
1492
|
+
if (loadedKeys.length) {
|
|
1493
|
+
loadedKeys.forEach(n => {
|
|
1494
|
+
if (loaded[l][n] === undefined) loaded[l][n] = true;
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
});
|
|
1498
|
+
q.done = true;
|
|
1499
|
+
if (q.errors.length) {
|
|
1500
|
+
q.callback(q.errors);
|
|
1501
|
+
} else {
|
|
1502
|
+
q.callback();
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
this.emit('loaded', loaded);
|
|
1507
|
+
this.queue = this.queue.filter(q => !q.done);
|
|
1508
|
+
}
|
|
1509
|
+
read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) {
|
|
1510
|
+
if (!lng.length) return callback(null, {});
|
|
1511
|
+
if (this.readingCalls >= this.maxParallelReads) {
|
|
1512
|
+
this.waitingReads.push({
|
|
1513
|
+
lng,
|
|
1514
|
+
ns,
|
|
1515
|
+
fcName,
|
|
1516
|
+
tried,
|
|
1517
|
+
wait,
|
|
1518
|
+
callback
|
|
1519
|
+
});
|
|
1520
|
+
return;
|
|
1521
|
+
}
|
|
1522
|
+
this.readingCalls++;
|
|
1523
|
+
const resolver = (err, data) => {
|
|
1524
|
+
this.readingCalls--;
|
|
1525
|
+
if (this.waitingReads.length > 0) {
|
|
1526
|
+
const next = this.waitingReads.shift();
|
|
1527
|
+
this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
|
|
1528
|
+
}
|
|
1529
|
+
if (err && data && tried < this.maxRetries) {
|
|
1530
|
+
setTimeout(() => {
|
|
1531
|
+
this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);
|
|
1532
|
+
}, wait);
|
|
1533
|
+
return;
|
|
1534
|
+
}
|
|
1535
|
+
callback(err, data);
|
|
1536
|
+
};
|
|
1537
|
+
const fc = this.backend[fcName].bind(this.backend);
|
|
1538
|
+
if (fc.length === 2) {
|
|
1539
|
+
try {
|
|
1540
|
+
const r = fc(lng, ns);
|
|
1541
|
+
if (r && typeof r.then === 'function') {
|
|
1542
|
+
r.then(data => resolver(null, data)).catch(resolver);
|
|
1543
|
+
} else {
|
|
1544
|
+
resolver(null, r);
|
|
1545
|
+
}
|
|
1546
|
+
} catch (err) {
|
|
1547
|
+
resolver(err);
|
|
1548
|
+
}
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
return fc(lng, ns, resolver);
|
|
1552
|
+
}
|
|
1553
|
+
prepareLoading(languages, namespaces, options = {}, callback) {
|
|
1554
|
+
if (!this.backend) {
|
|
1555
|
+
this.logger.warn('No backend was added via i18next.use. Will not load resources.');
|
|
1556
|
+
return callback && callback();
|
|
1557
|
+
}
|
|
1558
|
+
if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages);
|
|
1559
|
+
if (isString(namespaces)) namespaces = [namespaces];
|
|
1560
|
+
const toLoad = this.queueLoad(languages, namespaces, options, callback);
|
|
1561
|
+
if (!toLoad.toLoad.length) {
|
|
1562
|
+
if (!toLoad.pending.length) callback();
|
|
1563
|
+
return null;
|
|
1564
|
+
}
|
|
1565
|
+
toLoad.toLoad.forEach(name => {
|
|
1566
|
+
this.loadOne(name);
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1569
|
+
load(languages, namespaces, callback) {
|
|
1570
|
+
this.prepareLoading(languages, namespaces, {}, callback);
|
|
1571
|
+
}
|
|
1572
|
+
reload(languages, namespaces, callback) {
|
|
1573
|
+
this.prepareLoading(languages, namespaces, {
|
|
1574
|
+
reload: true
|
|
1575
|
+
}, callback);
|
|
1576
|
+
}
|
|
1577
|
+
loadOne(name, prefix = '') {
|
|
1578
|
+
const s = name.split('|');
|
|
1579
|
+
const lng = s[0];
|
|
1580
|
+
const ns = s[1];
|
|
1581
|
+
this.read(lng, ns, 'read', undefined, undefined, (err, data) => {
|
|
1582
|
+
if (err) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err);
|
|
1583
|
+
if (!err && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data);
|
|
1584
|
+
this.loaded(name, err, data);
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
saveMissing(languages, namespace, key, fallbackValue, isUpdate, options = {}, clb = () => {}) {
|
|
1588
|
+
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
|
|
1589
|
+
this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
|
1590
|
+
return;
|
|
1591
|
+
}
|
|
1592
|
+
if (key === undefined || key === null || key === '') return;
|
|
1593
|
+
if (this.backend?.create) {
|
|
1594
|
+
const opts = {
|
|
1595
|
+
...options,
|
|
1596
|
+
isUpdate
|
|
1597
|
+
};
|
|
1598
|
+
const fc = this.backend.create.bind(this.backend);
|
|
1599
|
+
if (fc.length < 6) {
|
|
1600
|
+
try {
|
|
1601
|
+
let r;
|
|
1602
|
+
if (fc.length === 5) {
|
|
1603
|
+
r = fc(languages, namespace, key, fallbackValue, opts);
|
|
1604
|
+
} else {
|
|
1605
|
+
r = fc(languages, namespace, key, fallbackValue);
|
|
1606
|
+
}
|
|
1607
|
+
if (r && typeof r.then === 'function') {
|
|
1608
|
+
r.then(data => clb(null, data)).catch(clb);
|
|
1609
|
+
} else {
|
|
1610
|
+
clb(null, r);
|
|
1611
|
+
}
|
|
1612
|
+
} catch (err) {
|
|
1613
|
+
clb(err);
|
|
1614
|
+
}
|
|
1615
|
+
} else {
|
|
1616
|
+
fc(languages, namespace, key, fallbackValue, clb, opts);
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
if (!languages || !languages[0]) return;
|
|
1620
|
+
this.store.addResource(languages[0], namespace, key, fallbackValue);
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
const get = () => ({
|
|
1625
|
+
debug: false,
|
|
1626
|
+
initAsync: true,
|
|
1627
|
+
ns: ['translation'],
|
|
1628
|
+
defaultNS: ['translation'],
|
|
1629
|
+
fallbackLng: ['dev'],
|
|
1630
|
+
fallbackNS: false,
|
|
1631
|
+
supportedLngs: false,
|
|
1632
|
+
nonExplicitSupportedLngs: false,
|
|
1633
|
+
load: 'all',
|
|
1634
|
+
preload: false,
|
|
1635
|
+
simplifyPluralSuffix: true,
|
|
1636
|
+
keySeparator: '.',
|
|
1637
|
+
nsSeparator: ':',
|
|
1638
|
+
pluralSeparator: '_',
|
|
1639
|
+
contextSeparator: '_',
|
|
1640
|
+
partialBundledLanguages: false,
|
|
1641
|
+
saveMissing: false,
|
|
1642
|
+
updateMissing: false,
|
|
1643
|
+
saveMissingTo: 'fallback',
|
|
1644
|
+
saveMissingPlurals: true,
|
|
1645
|
+
missingKeyHandler: false,
|
|
1646
|
+
missingInterpolationHandler: false,
|
|
1647
|
+
postProcess: false,
|
|
1648
|
+
postProcessPassResolved: false,
|
|
1649
|
+
returnNull: false,
|
|
1650
|
+
returnEmptyString: true,
|
|
1651
|
+
returnObjects: false,
|
|
1652
|
+
joinArrays: false,
|
|
1653
|
+
returnedObjectHandler: false,
|
|
1654
|
+
parseMissingKeyHandler: false,
|
|
1655
|
+
appendNamespaceToMissingKey: false,
|
|
1656
|
+
appendNamespaceToCIMode: false,
|
|
1657
|
+
overloadTranslationOptionHandler: args => {
|
|
1658
|
+
let ret = {};
|
|
1659
|
+
if (typeof args[1] === 'object') ret = args[1];
|
|
1660
|
+
if (isString(args[1])) ret.defaultValue = args[1];
|
|
1661
|
+
if (isString(args[2])) ret.tDescription = args[2];
|
|
1662
|
+
if (typeof args[2] === 'object' || typeof args[3] === 'object') {
|
|
1663
|
+
const options = args[3] || args[2];
|
|
1664
|
+
Object.keys(options).forEach(key => {
|
|
1665
|
+
ret[key] = options[key];
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
return ret;
|
|
1669
|
+
},
|
|
1670
|
+
interpolation: {
|
|
1671
|
+
escapeValue: true,
|
|
1672
|
+
format: value => value,
|
|
1673
|
+
prefix: '{{',
|
|
1674
|
+
suffix: '}}',
|
|
1675
|
+
formatSeparator: ',',
|
|
1676
|
+
unescapePrefix: '-',
|
|
1677
|
+
nestingPrefix: '$t(',
|
|
1678
|
+
nestingSuffix: ')',
|
|
1679
|
+
nestingOptionsSeparator: ',',
|
|
1680
|
+
maxReplaces: 1000,
|
|
1681
|
+
skipOnVariables: true
|
|
1682
|
+
},
|
|
1683
|
+
cacheInBuiltFormats: true
|
|
1684
|
+
});
|
|
1685
|
+
const transformOptions = options => {
|
|
1686
|
+
if (isString(options.ns)) options.ns = [options.ns];
|
|
1687
|
+
if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
|
|
1688
|
+
if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
|
|
1689
|
+
if (options.supportedLngs?.indexOf?.('cimode') < 0) {
|
|
1690
|
+
options.supportedLngs = options.supportedLngs.concat(['cimode']);
|
|
1691
|
+
}
|
|
1692
|
+
if (typeof options.initImmediate === 'boolean') options.initAsync = options.initImmediate;
|
|
1693
|
+
return options;
|
|
1694
|
+
};
|
|
1695
|
+
|
|
1696
|
+
const noop = () => {};
|
|
1697
|
+
const bindMemberFunctions = inst => {
|
|
1698
|
+
const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
|
|
1699
|
+
mems.forEach(mem => {
|
|
1700
|
+
if (typeof inst[mem] === 'function') {
|
|
1701
|
+
inst[mem] = inst[mem].bind(inst);
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1704
|
+
};
|
|
1705
|
+
class I18n extends EventEmitter {
|
|
1706
|
+
constructor(options = {}, callback) {
|
|
1707
|
+
super();
|
|
1708
|
+
this.options = transformOptions(options);
|
|
1709
|
+
this.services = {};
|
|
1710
|
+
this.logger = baseLogger;
|
|
1711
|
+
this.modules = {
|
|
1712
|
+
external: []
|
|
1713
|
+
};
|
|
1714
|
+
bindMemberFunctions(this);
|
|
1715
|
+
if (callback && !this.isInitialized && !options.isClone) {
|
|
1716
|
+
if (!this.options.initAsync) {
|
|
1717
|
+
this.init(options, callback);
|
|
1718
|
+
return this;
|
|
1719
|
+
}
|
|
1720
|
+
setTimeout(() => {
|
|
1721
|
+
this.init(options, callback);
|
|
1722
|
+
}, 0);
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
init(options = {}, callback) {
|
|
1726
|
+
this.isInitializing = true;
|
|
1727
|
+
if (typeof options === 'function') {
|
|
1728
|
+
callback = options;
|
|
1729
|
+
options = {};
|
|
1730
|
+
}
|
|
1731
|
+
if (options.defaultNS == null && options.ns) {
|
|
1732
|
+
if (isString(options.ns)) {
|
|
1733
|
+
options.defaultNS = options.ns;
|
|
1734
|
+
} else if (options.ns.indexOf('translation') < 0) {
|
|
1735
|
+
options.defaultNS = options.ns[0];
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
const defOpts = get();
|
|
1739
|
+
this.options = {
|
|
1740
|
+
...defOpts,
|
|
1741
|
+
...this.options,
|
|
1742
|
+
...transformOptions(options)
|
|
1743
|
+
};
|
|
1744
|
+
this.options.interpolation = {
|
|
1745
|
+
...defOpts.interpolation,
|
|
1746
|
+
...this.options.interpolation
|
|
1747
|
+
};
|
|
1748
|
+
if (options.keySeparator !== undefined) {
|
|
1749
|
+
this.options.userDefinedKeySeparator = options.keySeparator;
|
|
1750
|
+
}
|
|
1751
|
+
if (options.nsSeparator !== undefined) {
|
|
1752
|
+
this.options.userDefinedNsSeparator = options.nsSeparator;
|
|
1753
|
+
}
|
|
1754
|
+
if (typeof this.options.overloadTranslationOptionHandler !== 'function') {
|
|
1755
|
+
this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
|
|
1756
|
+
}
|
|
1757
|
+
const createClassOnDemand = ClassOrObject => {
|
|
1758
|
+
if (!ClassOrObject) return null;
|
|
1759
|
+
if (typeof ClassOrObject === 'function') return new ClassOrObject();
|
|
1760
|
+
return ClassOrObject;
|
|
1761
|
+
};
|
|
1762
|
+
if (!this.options.isClone) {
|
|
1763
|
+
if (this.modules.logger) {
|
|
1764
|
+
baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
|
|
1765
|
+
} else {
|
|
1766
|
+
baseLogger.init(null, this.options);
|
|
1767
|
+
}
|
|
1768
|
+
let formatter;
|
|
1769
|
+
if (this.modules.formatter) {
|
|
1770
|
+
formatter = this.modules.formatter;
|
|
1771
|
+
} else {
|
|
1772
|
+
formatter = Formatter;
|
|
1773
|
+
}
|
|
1774
|
+
const lu = new LanguageUtil(this.options);
|
|
1775
|
+
this.store = new ResourceStore(this.options.resources, this.options);
|
|
1776
|
+
const s = this.services;
|
|
1777
|
+
s.logger = baseLogger;
|
|
1778
|
+
s.resourceStore = this.store;
|
|
1779
|
+
s.languageUtils = lu;
|
|
1780
|
+
s.pluralResolver = new PluralResolver(lu, {
|
|
1781
|
+
prepend: this.options.pluralSeparator,
|
|
1782
|
+
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1783
|
+
});
|
|
1784
|
+
const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
|
|
1785
|
+
if (usingLegacyFormatFunction) {
|
|
1786
|
+
this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
|
|
1787
|
+
}
|
|
1788
|
+
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
|
|
1789
|
+
s.formatter = createClassOnDemand(formatter);
|
|
1790
|
+
if (s.formatter.init) s.formatter.init(s, this.options);
|
|
1791
|
+
this.options.interpolation.format = s.formatter.format.bind(s.formatter);
|
|
1792
|
+
}
|
|
1793
|
+
s.interpolator = new Interpolator(this.options);
|
|
1794
|
+
s.utils = {
|
|
1795
|
+
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1796
|
+
};
|
|
1797
|
+
s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);
|
|
1798
|
+
s.backendConnector.on('*', (event, ...args) => {
|
|
1799
|
+
this.emit(event, ...args);
|
|
1800
|
+
});
|
|
1801
|
+
if (this.modules.languageDetector) {
|
|
1802
|
+
s.languageDetector = createClassOnDemand(this.modules.languageDetector);
|
|
1803
|
+
if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);
|
|
1804
|
+
}
|
|
1805
|
+
if (this.modules.i18nFormat) {
|
|
1806
|
+
s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
|
|
1807
|
+
if (s.i18nFormat.init) s.i18nFormat.init(this);
|
|
1808
|
+
}
|
|
1809
|
+
this.translator = new Translator(this.services, this.options);
|
|
1810
|
+
this.translator.on('*', (event, ...args) => {
|
|
1811
|
+
this.emit(event, ...args);
|
|
1812
|
+
});
|
|
1813
|
+
this.modules.external.forEach(m => {
|
|
1814
|
+
if (m.init) m.init(this);
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
this.format = this.options.interpolation.format;
|
|
1818
|
+
if (!callback) callback = noop;
|
|
1819
|
+
if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1820
|
+
const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1821
|
+
if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];
|
|
1822
|
+
}
|
|
1823
|
+
if (!this.services.languageDetector && !this.options.lng) {
|
|
1824
|
+
this.logger.warn('init: no languageDetector is used and no lng is defined');
|
|
1825
|
+
}
|
|
1826
|
+
const storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
|
|
1827
|
+
storeApi.forEach(fcName => {
|
|
1828
|
+
this[fcName] = (...args) => this.store[fcName](...args);
|
|
1829
|
+
});
|
|
1830
|
+
const storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
|
|
1831
|
+
storeApiChained.forEach(fcName => {
|
|
1832
|
+
this[fcName] = (...args) => {
|
|
1833
|
+
this.store[fcName](...args);
|
|
1834
|
+
return this;
|
|
1835
|
+
};
|
|
1836
|
+
});
|
|
1837
|
+
const deferred = defer();
|
|
1838
|
+
const load = () => {
|
|
1839
|
+
const finish = (err, t) => {
|
|
1840
|
+
this.isInitializing = false;
|
|
1841
|
+
if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn('init: i18next is already initialized. You should call init just once!');
|
|
1842
|
+
this.isInitialized = true;
|
|
1843
|
+
if (!this.options.isClone) this.logger.log('initialized', this.options);
|
|
1844
|
+
this.emit('initialized', this.options);
|
|
1845
|
+
deferred.resolve(t);
|
|
1846
|
+
callback(err, t);
|
|
1847
|
+
};
|
|
1848
|
+
if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
|
|
1849
|
+
this.changeLanguage(this.options.lng, finish);
|
|
1850
|
+
};
|
|
1851
|
+
if (this.options.resources || !this.options.initAsync) {
|
|
1852
|
+
load();
|
|
1853
|
+
} else {
|
|
1854
|
+
setTimeout(load, 0);
|
|
1855
|
+
}
|
|
1856
|
+
return deferred;
|
|
1857
|
+
}
|
|
1858
|
+
loadResources(language, callback = noop) {
|
|
1859
|
+
let usedCallback = callback;
|
|
1860
|
+
const usedLng = isString(language) ? language : this.language;
|
|
1861
|
+
if (typeof language === 'function') usedCallback = language;
|
|
1862
|
+
if (!this.options.resources || this.options.partialBundledLanguages) {
|
|
1863
|
+
if (usedLng?.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
|
|
1864
|
+
const toLoad = [];
|
|
1865
|
+
const append = lng => {
|
|
1866
|
+
if (!lng) return;
|
|
1867
|
+
if (lng === 'cimode') return;
|
|
1868
|
+
const lngs = this.services.languageUtils.toResolveHierarchy(lng);
|
|
1869
|
+
lngs.forEach(l => {
|
|
1870
|
+
if (l === 'cimode') return;
|
|
1871
|
+
if (toLoad.indexOf(l) < 0) toLoad.push(l);
|
|
1872
|
+
});
|
|
1873
|
+
};
|
|
1874
|
+
if (!usedLng) {
|
|
1875
|
+
const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1876
|
+
fallbacks.forEach(l => append(l));
|
|
1877
|
+
} else {
|
|
1878
|
+
append(usedLng);
|
|
1879
|
+
}
|
|
1880
|
+
this.options.preload?.forEach?.(l => append(l));
|
|
1881
|
+
this.services.backendConnector.load(toLoad, this.options.ns, e => {
|
|
1882
|
+
if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
|
|
1883
|
+
usedCallback(e);
|
|
1884
|
+
});
|
|
1885
|
+
} else {
|
|
1886
|
+
usedCallback(null);
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
reloadResources(lngs, ns, callback) {
|
|
1890
|
+
const deferred = defer();
|
|
1891
|
+
if (typeof lngs === 'function') {
|
|
1892
|
+
callback = lngs;
|
|
1893
|
+
lngs = undefined;
|
|
1894
|
+
}
|
|
1895
|
+
if (typeof ns === 'function') {
|
|
1896
|
+
callback = ns;
|
|
1897
|
+
ns = undefined;
|
|
1898
|
+
}
|
|
1899
|
+
if (!lngs) lngs = this.languages;
|
|
1900
|
+
if (!ns) ns = this.options.ns;
|
|
1901
|
+
if (!callback) callback = noop;
|
|
1902
|
+
this.services.backendConnector.reload(lngs, ns, err => {
|
|
1903
|
+
deferred.resolve();
|
|
1904
|
+
callback(err);
|
|
1905
|
+
});
|
|
1906
|
+
return deferred;
|
|
1907
|
+
}
|
|
1908
|
+
use(module) {
|
|
1909
|
+
if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');
|
|
1910
|
+
if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');
|
|
1911
|
+
if (module.type === 'backend') {
|
|
1912
|
+
this.modules.backend = module;
|
|
1913
|
+
}
|
|
1914
|
+
if (module.type === 'logger' || module.log && module.warn && module.error) {
|
|
1915
|
+
this.modules.logger = module;
|
|
1916
|
+
}
|
|
1917
|
+
if (module.type === 'languageDetector') {
|
|
1918
|
+
this.modules.languageDetector = module;
|
|
1919
|
+
}
|
|
1920
|
+
if (module.type === 'i18nFormat') {
|
|
1921
|
+
this.modules.i18nFormat = module;
|
|
1922
|
+
}
|
|
1923
|
+
if (module.type === 'postProcessor') {
|
|
1924
|
+
postProcessor.addPostProcessor(module);
|
|
1925
|
+
}
|
|
1926
|
+
if (module.type === 'formatter') {
|
|
1927
|
+
this.modules.formatter = module;
|
|
1928
|
+
}
|
|
1929
|
+
if (module.type === '3rdParty') {
|
|
1930
|
+
this.modules.external.push(module);
|
|
1931
|
+
}
|
|
1932
|
+
return this;
|
|
1933
|
+
}
|
|
1934
|
+
setResolvedLanguage(l) {
|
|
1935
|
+
if (!l || !this.languages) return;
|
|
1936
|
+
if (['cimode', 'dev'].indexOf(l) > -1) return;
|
|
1937
|
+
for (let li = 0; li < this.languages.length; li++) {
|
|
1938
|
+
const lngInLngs = this.languages[li];
|
|
1939
|
+
if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;
|
|
1940
|
+
if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
|
|
1941
|
+
this.resolvedLanguage = lngInLngs;
|
|
1942
|
+
break;
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
if (!this.resolvedLanguage && this.languages.indexOf(l) < 0 && this.store.hasLanguageSomeTranslations(l)) {
|
|
1946
|
+
this.resolvedLanguage = l;
|
|
1947
|
+
this.languages.unshift(l);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
changeLanguage(lng, callback) {
|
|
1951
|
+
this.isLanguageChangingTo = lng;
|
|
1952
|
+
const deferred = defer();
|
|
1953
|
+
this.emit('languageChanging', lng);
|
|
1954
|
+
const setLngProps = l => {
|
|
1955
|
+
this.language = l;
|
|
1956
|
+
this.languages = this.services.languageUtils.toResolveHierarchy(l);
|
|
1957
|
+
this.resolvedLanguage = undefined;
|
|
1958
|
+
this.setResolvedLanguage(l);
|
|
1959
|
+
};
|
|
1960
|
+
const done = (err, l) => {
|
|
1961
|
+
if (l) {
|
|
1962
|
+
if (this.isLanguageChangingTo === lng) {
|
|
1963
|
+
setLngProps(l);
|
|
1964
|
+
this.translator.changeLanguage(l);
|
|
1965
|
+
this.isLanguageChangingTo = undefined;
|
|
1966
|
+
this.emit('languageChanged', l);
|
|
1967
|
+
this.logger.log('languageChanged', l);
|
|
1968
|
+
}
|
|
1969
|
+
} else {
|
|
1970
|
+
this.isLanguageChangingTo = undefined;
|
|
1971
|
+
}
|
|
1972
|
+
deferred.resolve((...args) => this.t(...args));
|
|
1973
|
+
if (callback) callback(err, (...args) => this.t(...args));
|
|
1974
|
+
};
|
|
1975
|
+
const setLng = lngs => {
|
|
1976
|
+
if (!lng && !lngs && this.services.languageDetector) lngs = [];
|
|
1977
|
+
const fl = isString(lngs) ? lngs : lngs && lngs[0];
|
|
1978
|
+
const l = this.store.hasLanguageSomeTranslations(fl) ? fl : this.services.languageUtils.getBestMatchFromCodes(isString(lngs) ? [lngs] : lngs);
|
|
1979
|
+
if (l) {
|
|
1980
|
+
if (!this.language) {
|
|
1981
|
+
setLngProps(l);
|
|
1982
|
+
}
|
|
1983
|
+
if (!this.translator.language) this.translator.changeLanguage(l);
|
|
1984
|
+
this.services.languageDetector?.cacheUserLanguage?.(l);
|
|
1985
|
+
}
|
|
1986
|
+
this.loadResources(l, err => {
|
|
1987
|
+
done(err, l);
|
|
1988
|
+
});
|
|
1989
|
+
};
|
|
1990
|
+
if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
|
|
1991
|
+
setLng(this.services.languageDetector.detect());
|
|
1992
|
+
} else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
|
|
1993
|
+
if (this.services.languageDetector.detect.length === 0) {
|
|
1994
|
+
this.services.languageDetector.detect().then(setLng);
|
|
1995
|
+
} else {
|
|
1996
|
+
this.services.languageDetector.detect(setLng);
|
|
1997
|
+
}
|
|
1998
|
+
} else {
|
|
1999
|
+
setLng(lng);
|
|
2000
|
+
}
|
|
2001
|
+
return deferred;
|
|
2002
|
+
}
|
|
2003
|
+
getFixedT(lng, ns, keyPrefix) {
|
|
2004
|
+
const fixedT = (key, opts, ...rest) => {
|
|
2005
|
+
let o;
|
|
2006
|
+
if (typeof opts !== 'object') {
|
|
2007
|
+
o = this.options.overloadTranslationOptionHandler([key, opts].concat(rest));
|
|
2008
|
+
} else {
|
|
2009
|
+
o = {
|
|
2010
|
+
...opts
|
|
2011
|
+
};
|
|
2012
|
+
}
|
|
2013
|
+
o.lng = o.lng || fixedT.lng;
|
|
2014
|
+
o.lngs = o.lngs || fixedT.lngs;
|
|
2015
|
+
o.ns = o.ns || fixedT.ns;
|
|
2016
|
+
if (o.keyPrefix !== '') o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;
|
|
2017
|
+
const keySeparator = this.options.keySeparator || '.';
|
|
2018
|
+
let resultKey;
|
|
2019
|
+
if (o.keyPrefix && Array.isArray(key)) {
|
|
2020
|
+
resultKey = key.map(k => {
|
|
2021
|
+
if (typeof k === 'function') k = keysFromSelector(k, {
|
|
2022
|
+
...this.options,
|
|
2023
|
+
...opts
|
|
2024
|
+
});
|
|
2025
|
+
return `${o.keyPrefix}${keySeparator}${k}`;
|
|
2026
|
+
});
|
|
2027
|
+
} else {
|
|
2028
|
+
if (typeof key === 'function') key = keysFromSelector(key, {
|
|
2029
|
+
...this.options,
|
|
2030
|
+
...opts
|
|
2031
|
+
});
|
|
2032
|
+
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
|
|
2033
|
+
}
|
|
2034
|
+
return this.t(resultKey, o);
|
|
2035
|
+
};
|
|
2036
|
+
if (isString(lng)) {
|
|
2037
|
+
fixedT.lng = lng;
|
|
2038
|
+
} else {
|
|
2039
|
+
fixedT.lngs = lng;
|
|
2040
|
+
}
|
|
2041
|
+
fixedT.ns = ns;
|
|
2042
|
+
fixedT.keyPrefix = keyPrefix;
|
|
2043
|
+
return fixedT;
|
|
2044
|
+
}
|
|
2045
|
+
t(...args) {
|
|
2046
|
+
return this.translator?.translate(...args);
|
|
2047
|
+
}
|
|
2048
|
+
exists(...args) {
|
|
2049
|
+
return this.translator?.exists(...args);
|
|
2050
|
+
}
|
|
2051
|
+
setDefaultNamespace(ns) {
|
|
2052
|
+
this.options.defaultNS = ns;
|
|
2053
|
+
}
|
|
2054
|
+
hasLoadedNamespace(ns, options = {}) {
|
|
2055
|
+
if (!this.isInitialized) {
|
|
2056
|
+
this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
|
|
2057
|
+
return false;
|
|
2058
|
+
}
|
|
2059
|
+
if (!this.languages || !this.languages.length) {
|
|
2060
|
+
this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);
|
|
2061
|
+
return false;
|
|
2062
|
+
}
|
|
2063
|
+
const lng = options.lng || this.resolvedLanguage || this.languages[0];
|
|
2064
|
+
const fallbackLng = this.options ? this.options.fallbackLng : false;
|
|
2065
|
+
const lastLng = this.languages[this.languages.length - 1];
|
|
2066
|
+
if (lng.toLowerCase() === 'cimode') return true;
|
|
2067
|
+
const loadNotPending = (l, n) => {
|
|
2068
|
+
const loadState = this.services.backendConnector.state[`${l}|${n}`];
|
|
2069
|
+
return loadState === -1 || loadState === 0 || loadState === 2;
|
|
2070
|
+
};
|
|
2071
|
+
if (options.precheck) {
|
|
2072
|
+
const preResult = options.precheck(this, loadNotPending);
|
|
2073
|
+
if (preResult !== undefined) return preResult;
|
|
2074
|
+
}
|
|
2075
|
+
if (this.hasResourceBundle(lng, ns)) return true;
|
|
2076
|
+
if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
|
|
2077
|
+
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
2078
|
+
return false;
|
|
2079
|
+
}
|
|
2080
|
+
loadNamespaces(ns, callback) {
|
|
2081
|
+
const deferred = defer();
|
|
2082
|
+
if (!this.options.ns) {
|
|
2083
|
+
if (callback) callback();
|
|
2084
|
+
return Promise.resolve();
|
|
2085
|
+
}
|
|
2086
|
+
if (isString(ns)) ns = [ns];
|
|
2087
|
+
ns.forEach(n => {
|
|
2088
|
+
if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
|
|
2089
|
+
});
|
|
2090
|
+
this.loadResources(err => {
|
|
2091
|
+
deferred.resolve();
|
|
2092
|
+
if (callback) callback(err);
|
|
2093
|
+
});
|
|
2094
|
+
return deferred;
|
|
2095
|
+
}
|
|
2096
|
+
loadLanguages(lngs, callback) {
|
|
2097
|
+
const deferred = defer();
|
|
2098
|
+
if (isString(lngs)) lngs = [lngs];
|
|
2099
|
+
const preloaded = this.options.preload || [];
|
|
2100
|
+
const newLngs = lngs.filter(lng => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
|
|
2101
|
+
if (!newLngs.length) {
|
|
2102
|
+
if (callback) callback();
|
|
2103
|
+
return Promise.resolve();
|
|
2104
|
+
}
|
|
2105
|
+
this.options.preload = preloaded.concat(newLngs);
|
|
2106
|
+
this.loadResources(err => {
|
|
2107
|
+
deferred.resolve();
|
|
2108
|
+
if (callback) callback(err);
|
|
2109
|
+
});
|
|
2110
|
+
return deferred;
|
|
2111
|
+
}
|
|
2112
|
+
dir(lng) {
|
|
2113
|
+
if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);
|
|
2114
|
+
if (!lng) return 'rtl';
|
|
2115
|
+
try {
|
|
2116
|
+
const l = new Intl.Locale(lng);
|
|
2117
|
+
if (l && l.getTextInfo) {
|
|
2118
|
+
const ti = l.getTextInfo();
|
|
2119
|
+
if (ti && ti.direction) return ti.direction;
|
|
2120
|
+
}
|
|
2121
|
+
} catch (e) {}
|
|
2122
|
+
const rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];
|
|
2123
|
+
const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
|
|
2124
|
+
if (lng.toLowerCase().indexOf('-latn') > 1) return 'ltr';
|
|
2125
|
+
return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
|
|
2126
|
+
}
|
|
2127
|
+
static createInstance(options = {}, callback) {
|
|
2128
|
+
const instance = new I18n(options, callback);
|
|
2129
|
+
instance.createInstance = I18n.createInstance;
|
|
2130
|
+
return instance;
|
|
2131
|
+
}
|
|
2132
|
+
cloneInstance(options = {}, callback = noop) {
|
|
2133
|
+
const forkResourceStore = options.forkResourceStore;
|
|
2134
|
+
if (forkResourceStore) delete options.forkResourceStore;
|
|
2135
|
+
const mergedOptions = {
|
|
2136
|
+
...this.options,
|
|
2137
|
+
...options,
|
|
2138
|
+
...{
|
|
2139
|
+
isClone: true
|
|
2140
|
+
}
|
|
2141
|
+
};
|
|
2142
|
+
const clone = new I18n(mergedOptions);
|
|
2143
|
+
if (options.debug !== undefined || options.prefix !== undefined) {
|
|
2144
|
+
clone.logger = clone.logger.clone(options);
|
|
2145
|
+
}
|
|
2146
|
+
const membersToCopy = ['store', 'services', 'language'];
|
|
2147
|
+
membersToCopy.forEach(m => {
|
|
2148
|
+
clone[m] = this[m];
|
|
2149
|
+
});
|
|
2150
|
+
clone.services = {
|
|
2151
|
+
...this.services
|
|
2152
|
+
};
|
|
2153
|
+
clone.services.utils = {
|
|
2154
|
+
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
|
2155
|
+
};
|
|
2156
|
+
if (forkResourceStore) {
|
|
2157
|
+
const clonedData = Object.keys(this.store.data).reduce((prev, l) => {
|
|
2158
|
+
prev[l] = {
|
|
2159
|
+
...this.store.data[l]
|
|
2160
|
+
};
|
|
2161
|
+
prev[l] = Object.keys(prev[l]).reduce((acc, n) => {
|
|
2162
|
+
acc[n] = {
|
|
2163
|
+
...prev[l][n]
|
|
2164
|
+
};
|
|
2165
|
+
return acc;
|
|
2166
|
+
}, prev[l]);
|
|
2167
|
+
return prev;
|
|
2168
|
+
}, {});
|
|
2169
|
+
clone.store = new ResourceStore(clonedData, mergedOptions);
|
|
2170
|
+
clone.services.resourceStore = clone.store;
|
|
2171
|
+
}
|
|
2172
|
+
if (options.interpolation) {
|
|
2173
|
+
const defOpts = get();
|
|
2174
|
+
const mergedInterpolation = {
|
|
2175
|
+
...defOpts.interpolation,
|
|
2176
|
+
...this.options.interpolation,
|
|
2177
|
+
...options.interpolation
|
|
2178
|
+
};
|
|
2179
|
+
const mergedForInterpolator = {
|
|
2180
|
+
...mergedOptions,
|
|
2181
|
+
interpolation: mergedInterpolation
|
|
2182
|
+
};
|
|
2183
|
+
clone.services.interpolator = new Interpolator(mergedForInterpolator);
|
|
2184
|
+
}
|
|
2185
|
+
clone.translator = new Translator(clone.services, mergedOptions);
|
|
2186
|
+
clone.translator.on('*', (event, ...args) => {
|
|
2187
|
+
clone.emit(event, ...args);
|
|
2188
|
+
});
|
|
2189
|
+
clone.init(mergedOptions, callback);
|
|
2190
|
+
clone.translator.options = mergedOptions;
|
|
2191
|
+
clone.translator.backendConnector.services.utils = {
|
|
2192
|
+
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
|
2193
|
+
};
|
|
2194
|
+
return clone;
|
|
2195
|
+
}
|
|
2196
|
+
toJSON() {
|
|
2197
|
+
return {
|
|
2198
|
+
options: this.options,
|
|
2199
|
+
store: this.store,
|
|
2200
|
+
language: this.language,
|
|
2201
|
+
languages: this.languages,
|
|
2202
|
+
resolvedLanguage: this.resolvedLanguage
|
|
2203
|
+
};
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
const instance = I18n.createInstance();
|
|
2207
|
+
|
|
2208
|
+
const auth$5 = {
|
|
2209
|
+
email: {
|
|
2210
|
+
placeholder: "Geben Sie Ihre E-Mail-Adresse ein"
|
|
2211
|
+
},
|
|
2212
|
+
magicCode: {
|
|
2213
|
+
already_sent_text: "Magischer Code wurde bereits an Ihre E-Mail-Adresse gesendet",
|
|
2214
|
+
button_text: "Magischen Code senden",
|
|
2215
|
+
resend: {
|
|
2216
|
+
button_text: "Magischen Code erneut senden"
|
|
2217
|
+
},
|
|
2218
|
+
sending_text: "Wird gesendet..."
|
|
2219
|
+
},
|
|
2220
|
+
passkey: {
|
|
2221
|
+
button_text: "Mit Passkey anmelden",
|
|
2222
|
+
loading_text: "Authentifizierung..."
|
|
2223
|
+
},
|
|
2224
|
+
password: {
|
|
2225
|
+
button_text: "Mit Password anmelden",
|
|
2226
|
+
confirmation: {
|
|
2227
|
+
placeholder: "Bestätigen Sie Ihr Passwort"
|
|
2228
|
+
},
|
|
2229
|
+
placeholder: "Geben Sie Ihr Passwort ein"
|
|
2230
|
+
},
|
|
2231
|
+
resetPassword: {
|
|
2232
|
+
button_text_resend: "Mail zum Zurücksetzen des Passworts erneut senden",
|
|
2233
|
+
button_text_reset: "Passwort zurücksetzen",
|
|
2234
|
+
button_text_set: "Passwort speichern",
|
|
2235
|
+
success_message: "E-Mail zum Zurücksetzen des Passworts gesendet. Bitte überprüfen Sie Ihren Posteingang"
|
|
2236
|
+
},
|
|
2237
|
+
"single-login": {
|
|
2238
|
+
button_text: "Anmelden"
|
|
2239
|
+
},
|
|
2240
|
+
socialLogin: {
|
|
2241
|
+
button_text: "Weiter mit {{provider}}"
|
|
2242
|
+
}
|
|
2243
|
+
};
|
|
2244
|
+
const buttons$5 = {
|
|
2245
|
+
close: "Schließen",
|
|
2246
|
+
"continue": "Weiter",
|
|
2247
|
+
logout: "Abmelden",
|
|
2248
|
+
registration: "Neues Konto registrieren",
|
|
2249
|
+
sign_in: "Anmelden",
|
|
2250
|
+
submit: "Absenden"
|
|
2251
|
+
};
|
|
2252
|
+
const errors$5 = {
|
|
2253
|
+
account_locked: "Konto gesperrt",
|
|
2254
|
+
account_not_found: "Konto nicht gefunden",
|
|
2255
|
+
authentication_failed: "Authentifizierung fehlgeschlagen",
|
|
2256
|
+
bad_request: "Ungültige Anfrage",
|
|
2257
|
+
connection_failed: "Verbindung zum Unidy Server nicht möglich",
|
|
2258
|
+
expired: "Abgelaufen",
|
|
2259
|
+
failed_to_load_profile: "Profildaten konnten nicht geladen werden. Bitte überprüfen Sie die Konfiguration",
|
|
2260
|
+
invalid_id_token: "Ungültiger ID-Token",
|
|
2261
|
+
invalid_passkey: "Ungültiger Passkey",
|
|
2262
|
+
invalid_password: "Ungültiges Passwort",
|
|
2263
|
+
invalid_refresh_token: "Ungültiger Aktualisierungs-Token",
|
|
2264
|
+
invalid_required_fields_payload: "Ungültige Nutzlast für erforderliche Felder",
|
|
2265
|
+
invalid_reset_token: "Ungültiger Reset-Token. Bitte fordern Sie eine neue E-Mail zum Zurücksetzen des Passworts an",
|
|
2266
|
+
invalid_response_format: "Ungültiges Antwortformat",
|
|
2267
|
+
internal_server_error: "Interner Serverfehler",
|
|
2268
|
+
magic_code_is_missing: "Magischer Code fehlt",
|
|
2269
|
+
magic_code_recently_created: "Magischer Code wurde kürzlich erstellt",
|
|
2270
|
+
missing_id_token: "Fehlender ID-Token",
|
|
2271
|
+
missing_refresh_token: "Kein refresh token gefunden",
|
|
2272
|
+
missing_required_fields: "Fehlende Pflichtfelder",
|
|
2273
|
+
no_sign_in_id: "Keine Anmelde-ID verfügbar",
|
|
2274
|
+
not_valid: "Nicht gültig",
|
|
2275
|
+
passkey_cancelled: "Passkey-Authentifizierung abgebrochen",
|
|
2276
|
+
passkey_error: "Ein unbekannter Passkey-Fehler ist aufgetreten",
|
|
2277
|
+
passkey_invalid_state: "Ungültiger Passkey-Status",
|
|
2278
|
+
passkey_not_supported: "Passkey nicht unterstützt",
|
|
2279
|
+
passkey_security_error: "Passkey-Sicherheitsfehler",
|
|
2280
|
+
password_not_set: "Passwort nicht festgelegt",
|
|
2281
|
+
password_required: "Passwort ist erforderlich",
|
|
2282
|
+
password_requirements: {
|
|
2283
|
+
"is too short (minimum is 6 characters)": "Passwort ist zu kurz (mindestens 6 Zeichen)",
|
|
2284
|
+
min_length: "Mindestlänge ist 6 Zeichen",
|
|
2285
|
+
mixed_case: "Muss sowohl Groß- als auch Kleinbuchstaben enthalten",
|
|
2286
|
+
number: "Muss eine Zahl enthalten",
|
|
2287
|
+
symbol: "Muss ein Symbol enthalten"
|
|
2288
|
+
},
|
|
2289
|
+
passwords_do_not_match: "Passwörter stimmen nicht überein",
|
|
2290
|
+
prefix: "FEHLER: ",
|
|
2291
|
+
refresh_failed: "Authorisierungstoken konnte nicht aktualisiert werden. Bitte melden Sie sich erneut an",
|
|
2292
|
+
refresh_token_revoked: "Aktualisierungs-Token widerrufen",
|
|
2293
|
+
required_field: "{{field}} ist erforderlich",
|
|
2294
|
+
reset_password_already_sent: "Zurücksetzen des Passworts bereits gesendet",
|
|
2295
|
+
reset_token_expired: "Reset-Token ist abgelaufen. Bitte fordern Sie eine neue E-Mail zum Zurücksetzen des Passworts an",
|
|
2296
|
+
reset_token_missing: "Reset-Token fehlt",
|
|
2297
|
+
schema_validation_error: "Schemavalidierungsfehler",
|
|
2298
|
+
sign_in_expired: "Anmeldung abgelaufen",
|
|
2299
|
+
sign_in_not_found: "Anmeldung nicht gefunden",
|
|
2300
|
+
sign_out_failed: "Abmelden fehlgeschlagen, Grund: {{reason}}",
|
|
2301
|
+
unknown: "Ein unbekannter Fehler ist aufgetreten",
|
|
2302
|
+
used: "Verwendet",
|
|
2303
|
+
verification_failed: "Verifizierung fehlgeschlagen"
|
|
2304
|
+
};
|
|
2305
|
+
const loading$5 = "Wird geladen...";
|
|
2306
|
+
const newsletter$5 = {
|
|
2307
|
+
buttons: {
|
|
2308
|
+
logout: "x",
|
|
2309
|
+
resend_doi: "Bestätigung erneut senden",
|
|
2310
|
+
subscribe: "Abonnieren",
|
|
2311
|
+
unsubscribe: "Abbestellen"
|
|
2312
|
+
},
|
|
2313
|
+
errors: {
|
|
2314
|
+
already_subscribed: "Bereits abonniert",
|
|
2315
|
+
email_required: "Bitte geben Sie Ihre E-Mail-Adresse ein",
|
|
2316
|
+
invalid_email: "Ungültige E-Mail-Adresse",
|
|
2317
|
+
login_email_not_found: "Abonnement mit dieser E-Mail-Adresse existiert nicht",
|
|
2318
|
+
newsletter_not_found: "Newsletter nicht gefunden",
|
|
2319
|
+
preferences_not_found: "Präferenz nicht gefunden",
|
|
2320
|
+
rate_limit_exceeded: "Anfragelimit überschritten. Bitte versuchen Sie es später erneut",
|
|
2321
|
+
unauthorized: "Ihre Sitzung ist abgelaufen. Bitte melden Sie sich erneut an",
|
|
2322
|
+
unconfirmed: "Ihre E-Mail-Adresse ist für diesen Newsletter nicht bestätigt",
|
|
2323
|
+
unsubscribe_failed: "Abmeldung fehlgeschlagen",
|
|
2324
|
+
invalid_preference_token: "Ungültiges Präferenz-Token. Geben Sie Ihre E-Mail-Adresse ein, um einen neuen Link zu erhalten."
|
|
2325
|
+
},
|
|
2326
|
+
success: {
|
|
2327
|
+
doi_sent: "Bestätigungs-E-Mail wurde an Ihre E-Mail-Adresse gesendet",
|
|
2328
|
+
login_email_sent: "Wir haben einen Link zur Verwaltung Ihres bestehenden Abonnements an Ihre E-Mail-Adresse gesendet",
|
|
2329
|
+
logout: "Sie wurden erfolgreich abgemeldet",
|
|
2330
|
+
preferences_updated: "Ihre Präferenzen wurden erfolgreich aktualisiert",
|
|
2331
|
+
subscribe: "Sie haben sich erfolgreich abonniert",
|
|
2332
|
+
unsubscribe: "Sie haben sich erfolgreich abbestellt"
|
|
2333
|
+
}
|
|
2334
|
+
};
|
|
2335
|
+
const profile$5 = {
|
|
2336
|
+
signInToView: "Bitte melden Sie sich an, um Ihr Profil anzuzeigen",
|
|
2337
|
+
updated: "Profil wurde aktualisiert"
|
|
2338
|
+
};
|
|
2339
|
+
var de = {
|
|
2340
|
+
auth: auth$5,
|
|
2341
|
+
buttons: buttons$5,
|
|
2342
|
+
errors: errors$5,
|
|
2343
|
+
loading: loading$5,
|
|
2344
|
+
newsletter: newsletter$5,
|
|
2345
|
+
profile: profile$5
|
|
2346
|
+
};
|
|
2347
|
+
|
|
2348
|
+
const auth$4 = {
|
|
2349
|
+
email: {
|
|
2350
|
+
placeholder: "Enter your email"
|
|
2351
|
+
},
|
|
2352
|
+
magicCode: {
|
|
2353
|
+
already_sent_text: "Magic code already sent to your email",
|
|
2354
|
+
button_text: "Send Magic Code",
|
|
2355
|
+
resend: {
|
|
2356
|
+
button_text: "Send Magic Code again"
|
|
2357
|
+
},
|
|
2358
|
+
sending_text: "Sending..."
|
|
2359
|
+
},
|
|
2360
|
+
passkey: {
|
|
2361
|
+
button_text: "Sign in with Passkey",
|
|
2362
|
+
loading_text: "Authenticating..."
|
|
2363
|
+
},
|
|
2364
|
+
password: {
|
|
2365
|
+
button_text: "Sign in with Password",
|
|
2366
|
+
confirmation: {
|
|
2367
|
+
placeholder: "Confirm your password"
|
|
2368
|
+
},
|
|
2369
|
+
placeholder: "Enter your password"
|
|
2370
|
+
},
|
|
2371
|
+
resetPassword: {
|
|
2372
|
+
button_text_resend: "Resend password reset email",
|
|
2373
|
+
button_text_reset: "Reset password",
|
|
2374
|
+
button_text_set: "Save password",
|
|
2375
|
+
success_message: "Password reset email sent. Please check your inbox"
|
|
2376
|
+
},
|
|
2377
|
+
"single-login": {
|
|
2378
|
+
button_text: "Sign in"
|
|
2379
|
+
},
|
|
2380
|
+
socialLogin: {
|
|
2381
|
+
button_text: "Continue with {{provider}}"
|
|
2382
|
+
}
|
|
2383
|
+
};
|
|
2384
|
+
const buttons$4 = {
|
|
2385
|
+
close: "Close",
|
|
2386
|
+
"continue": "Continue",
|
|
2387
|
+
logout: "Logout",
|
|
2388
|
+
registration: "Register new account",
|
|
2389
|
+
sign_in: "Sign In",
|
|
2390
|
+
submit: "Submit"
|
|
2391
|
+
};
|
|
2392
|
+
const errors$4 = {
|
|
2393
|
+
account_locked: "Account locked",
|
|
2394
|
+
account_not_found: "Account not found",
|
|
2395
|
+
authentication_failed: "Authentication failed",
|
|
2396
|
+
bad_request: "Bad request",
|
|
2397
|
+
connection_failed: "Unable to connect to the Unidy server",
|
|
2398
|
+
expired: "Expired",
|
|
2399
|
+
failed_to_load_profile: "Failed to load profile data. Please check configuration",
|
|
2400
|
+
invalid_id_token: "Invalid ID token",
|
|
2401
|
+
invalid_passkey: "Invalid passkey",
|
|
2402
|
+
invalid_password: "Invalid password",
|
|
2403
|
+
invalid_refresh_token: "Invalid refresh token",
|
|
2404
|
+
invalid_required_fields_payload: "Invalid required fields payload",
|
|
2405
|
+
invalid_reset_token: "Invalid reset token. Please request a new password reset email",
|
|
2406
|
+
invalid_response_format: "Invalid response format",
|
|
2407
|
+
internal_server_error: "Internal server error",
|
|
2408
|
+
magic_code_is_missing: "Magic code is missing",
|
|
2409
|
+
magic_code_recently_created: "Magic code recently created",
|
|
2410
|
+
missing_id_token: "Missing ID token",
|
|
2411
|
+
missing_refresh_token: "No refresh token present",
|
|
2412
|
+
missing_required_fields: "Missing required fields",
|
|
2413
|
+
no_sign_in_id: "No sign in ID available",
|
|
2414
|
+
not_valid: "Not valid",
|
|
2415
|
+
passkey_cancelled: "Passkey authentication cancelled",
|
|
2416
|
+
passkey_error: "An unknown passkey error occurred",
|
|
2417
|
+
passkey_invalid_state: "Passkey invalid state",
|
|
2418
|
+
passkey_not_supported: "Passkey not supported",
|
|
2419
|
+
passkey_security_error: "Passkey security error",
|
|
2420
|
+
password_not_set: "Password not set",
|
|
2421
|
+
password_required: "Password is required",
|
|
2422
|
+
password_requirements: {
|
|
2423
|
+
"is too short (minimum is 6 characters)": "Password is too short (minimum is 6 characters)",
|
|
2424
|
+
min_length: "Min length is 6 characters",
|
|
2425
|
+
mixed_case: "Must contain both uppercase and lowercase letters",
|
|
2426
|
+
number: "Must contain a number",
|
|
2427
|
+
symbol: "Must contain a symbol"
|
|
2428
|
+
},
|
|
2429
|
+
passwords_do_not_match: "Passwords do not match",
|
|
2430
|
+
prefix: "ERROR: ",
|
|
2431
|
+
refresh_failed: "Failed to refresh token. Please sign in again",
|
|
2432
|
+
refresh_token_revoked: "Refresh token revoked",
|
|
2433
|
+
required_field: "{{field}} is required",
|
|
2434
|
+
reset_password_already_sent: "Reset password already sent",
|
|
2435
|
+
reset_token_expired: "Reset token has expired. Please request a new password reset email",
|
|
2436
|
+
reset_token_missing: "Reset token is missing",
|
|
2437
|
+
schema_validation_error: "Schema validation error",
|
|
2438
|
+
sign_in_expired: "Sign in expired",
|
|
2439
|
+
sign_in_not_found: "Sign in not found",
|
|
2440
|
+
sign_out_failed: "Failed to sign out, reason: {{reason}}",
|
|
2441
|
+
unknown: "An unknown error occurred",
|
|
2442
|
+
used: "Used",
|
|
2443
|
+
verification_failed: "Verification failed"
|
|
2444
|
+
};
|
|
2445
|
+
const loading$4 = "Loading...";
|
|
2446
|
+
const newsletter$4 = {
|
|
2447
|
+
buttons: {
|
|
2448
|
+
logout: "x",
|
|
2449
|
+
resend_doi: "Resend confirmation",
|
|
2450
|
+
subscribe: "Subscribe",
|
|
2451
|
+
unsubscribe: "Unsubscribe"
|
|
2452
|
+
},
|
|
2453
|
+
errors: {
|
|
2454
|
+
already_subscribed: "Already subscribed",
|
|
2455
|
+
email_required: "Please enter your email address",
|
|
2456
|
+
invalid_email: "Invalid email address",
|
|
2457
|
+
login_email_not_found: "Subscription with this email does not exist",
|
|
2458
|
+
newsletter_not_found: "Newsletter not found",
|
|
2459
|
+
preferences_not_found: "Preference not found",
|
|
2460
|
+
rate_limit_exceeded: "Rate limit exceeded. Please try again later",
|
|
2461
|
+
unauthorized: "Your session has expired. Please login again",
|
|
2462
|
+
unconfirmed: "Your email is not confirmed for this newsletter",
|
|
2463
|
+
unsubscribe_failed: "Failed to unsubscribe",
|
|
2464
|
+
invalid_preference_token: "Invalid preference token. Enter your email address to receive a new link."
|
|
2465
|
+
},
|
|
2466
|
+
success: {
|
|
2467
|
+
doi_sent: "Confirmation email has been sent to your email address",
|
|
2468
|
+
login_email_sent: "We sent a link to manage your existing subscription to your email address",
|
|
2469
|
+
logout: "You have been logged out successfully",
|
|
2470
|
+
preferences_updated: "Your preferences have been updated successfully",
|
|
2471
|
+
subscribe: "You have successfully subscribed",
|
|
2472
|
+
unsubscribe: "You have successfully unsubscribed"
|
|
2473
|
+
}
|
|
2474
|
+
};
|
|
2475
|
+
const profile$4 = {
|
|
2476
|
+
signInToView: "Please sign in to view your profile",
|
|
2477
|
+
updated: "Profile is updated"
|
|
2478
|
+
};
|
|
2479
|
+
var en = {
|
|
2480
|
+
auth: auth$4,
|
|
2481
|
+
buttons: buttons$4,
|
|
2482
|
+
errors: errors$4,
|
|
2483
|
+
loading: loading$4,
|
|
2484
|
+
newsletter: newsletter$4,
|
|
2485
|
+
profile: profile$4
|
|
2486
|
+
};
|
|
2487
|
+
|
|
2488
|
+
const auth$3 = {
|
|
2489
|
+
email: {
|
|
2490
|
+
placeholder: "Entrez votre adresse e-mail"
|
|
2491
|
+
},
|
|
2492
|
+
magicCode: {
|
|
2493
|
+
already_sent_text: "Code magique déjà envoyé à votre adresse e-mail",
|
|
2494
|
+
button_text: "Envoyer le code magique",
|
|
2495
|
+
resend: {
|
|
2496
|
+
button_text: "Renvoyer le code magique"
|
|
2497
|
+
},
|
|
2498
|
+
sending_text: "Envoi en cours..."
|
|
2499
|
+
},
|
|
2500
|
+
passkey: {
|
|
2501
|
+
button_text: "Se connecter avec une clé d'accès",
|
|
2502
|
+
loading_text: "Authentification..."
|
|
2503
|
+
},
|
|
2504
|
+
password: {
|
|
2505
|
+
button_text: "Se connecter avec un mot de passe",
|
|
2506
|
+
confirmation: {
|
|
2507
|
+
placeholder: "Confirmez votre mot de passe"
|
|
2508
|
+
},
|
|
2509
|
+
placeholder: "Entrez votre mot de passe"
|
|
2510
|
+
},
|
|
2511
|
+
resetPassword: {
|
|
2512
|
+
button_text_resend: "Renvoyer l'e-mail de réinitialisation du mot de passe",
|
|
2513
|
+
button_text_reset: "Réinitialiser le mot de passe",
|
|
2514
|
+
button_text_set: "Enregistrer le mot de passe",
|
|
2515
|
+
success_message: "E-mail de réinitialisation du mot de passe envoyé. Veuillez vérifier votre boîte de réception"
|
|
2516
|
+
},
|
|
2517
|
+
"single-login": {
|
|
2518
|
+
button_text: "Se connecter"
|
|
2519
|
+
},
|
|
2520
|
+
socialLogin: {
|
|
2521
|
+
button_text: "Continuer avec {{provider}}"
|
|
2522
|
+
}
|
|
2523
|
+
};
|
|
2524
|
+
const buttons$3 = {
|
|
2525
|
+
close: "Fermer",
|
|
2526
|
+
"continue": "Continuer",
|
|
2527
|
+
logout: "Se déconnecter",
|
|
2528
|
+
registration: "Créer un nouveau compte",
|
|
2529
|
+
sign_in: "Se connecter",
|
|
2530
|
+
submit: "Soumettre"
|
|
2531
|
+
};
|
|
2532
|
+
const errors$3 = {
|
|
2533
|
+
account_locked: "Compte verrouillé",
|
|
2534
|
+
account_not_found: "Compte introuvable",
|
|
2535
|
+
authentication_failed: "Échec de l'authentification",
|
|
2536
|
+
bad_request: "Mauvaise requête",
|
|
2537
|
+
connection_failed: "Impossible de se connecter au serveur Unidy",
|
|
2538
|
+
expired: "Expiré",
|
|
2539
|
+
failed_to_load_profile: "Échec du chargement des données du profil. Veuillez vérifier la configuration",
|
|
2540
|
+
invalid_id_token: "Jeton d'identification invalide",
|
|
2541
|
+
invalid_passkey: "Clé d'accès invalide",
|
|
2542
|
+
invalid_password: "Mot de passe invalide",
|
|
2543
|
+
invalid_refresh_token: "Jeton de rafraîchissement invalide",
|
|
2544
|
+
invalid_required_fields_payload: "Charge utile des champs obligatoires invalide",
|
|
2545
|
+
invalid_reset_token: "Jeton de réinitialisation invalide. Veuillez demander un nouvel e-mail de réinitialisation du mot de passe",
|
|
2546
|
+
invalid_response_format: "Format de réponse invalide",
|
|
2547
|
+
internal_server_error: "Erreur interne du serveur",
|
|
2548
|
+
magic_code_is_missing: "Code magique manquant",
|
|
2549
|
+
magic_code_recently_created: "Code magique récemment créé",
|
|
2550
|
+
missing_id_token: "Jeton d'identification manquant",
|
|
2551
|
+
missing_refresh_token: "Aucun jeton de rafraîchissement présent",
|
|
2552
|
+
missing_required_fields: "Champs obligatoires manquants",
|
|
2553
|
+
no_sign_in_id: "Aucun identifiant de connexion disponible",
|
|
2554
|
+
not_valid: "Non valide",
|
|
2555
|
+
passkey_cancelled: "Authentification par clé d'accès annulée",
|
|
2556
|
+
passkey_error: "Une erreur inconnue de clé d'accès s'est produite",
|
|
2557
|
+
passkey_invalid_state: "État de clé d'accès invalide",
|
|
2558
|
+
passkey_not_supported: "Clé d'accès non prise en charge",
|
|
2559
|
+
passkey_security_error: "Erreur de sécurité de clé d'accès",
|
|
2560
|
+
password_not_set: "Mot de passe non défini",
|
|
2561
|
+
password_required: "Mot de passe requis",
|
|
2562
|
+
password_requirements: {
|
|
2563
|
+
"is too short (minimum is 6 characters)": "Le mot de passe est trop court (minimum 6 caractères)",
|
|
2564
|
+
min_length: "La longueur minimale est de 6 caractères",
|
|
2565
|
+
mixed_case: "Doit contenir des majuscules et des minuscules",
|
|
2566
|
+
number: "Doit contenir un chiffre",
|
|
2567
|
+
symbol: "Doit contenir un symbole"
|
|
2568
|
+
},
|
|
2569
|
+
passwords_do_not_match: "Les mots de passe ne correspondent pas",
|
|
2570
|
+
prefix: "ERREUR : ",
|
|
2571
|
+
refresh_failed: "Échec du rafraîchissement du jeton. Veuillez vous reconnecter",
|
|
2572
|
+
refresh_token_revoked: "Jeton de rafraîchissement révoqué",
|
|
2573
|
+
required_field: "{{field}} est requis",
|
|
2574
|
+
reset_password_already_sent: "Réinitialisation du mot de passe déjà envoyée",
|
|
2575
|
+
reset_token_expired: "Le jeton de réinitialisation a expiré. Veuillez demander un nouvel e-mail de réinitialisation du mot de passe",
|
|
2576
|
+
reset_token_missing: "Jeton de réinitialisation manquant",
|
|
2577
|
+
schema_validation_error: "Erreur de validation du schéma",
|
|
2578
|
+
sign_in_expired: "Connexion expirée",
|
|
2579
|
+
sign_in_not_found: "Connexion introuvable",
|
|
2580
|
+
sign_out_failed: "Échec de la déconnexion, raison : {{reason}}",
|
|
2581
|
+
unknown: "Une erreur inconnue s'est produite",
|
|
2582
|
+
used: "Utilisé",
|
|
2583
|
+
verification_failed: "Échec de la vérification"
|
|
2584
|
+
};
|
|
2585
|
+
const loading$3 = "Chargement...";
|
|
2586
|
+
const newsletter$3 = {
|
|
2587
|
+
buttons: {
|
|
2588
|
+
logout: "x",
|
|
2589
|
+
resend_doi: "Renvoyer la confirmation",
|
|
2590
|
+
subscribe: "S'abonner",
|
|
2591
|
+
unsubscribe: "Se désabonner"
|
|
2592
|
+
},
|
|
2593
|
+
errors: {
|
|
2594
|
+
already_subscribed: "Déjà abonné",
|
|
2595
|
+
email_required: "Veuillez entrer votre adresse e-mail",
|
|
2596
|
+
invalid_email: "Adresse e-mail invalide",
|
|
2597
|
+
login_email_not_found: "L'abonnement avec cet e-mail n'existe pas",
|
|
2598
|
+
newsletter_not_found: "Newsletter introuvable",
|
|
2599
|
+
preferences_not_found: "Préférence introuvable",
|
|
2600
|
+
rate_limit_exceeded: "Limite de débit dépassée. Veuillez réessayer plus tard",
|
|
2601
|
+
unauthorized: "Votre session a expiré. Veuillez vous reconnecter",
|
|
2602
|
+
unconfirmed: "Votre e-mail n'est pas confirmé pour cette newsletter",
|
|
2603
|
+
unsubscribe_failed: "Échec du désabonnement",
|
|
2604
|
+
invalid_preference_token: "Jeton de préférence invalide. Entrez votre adresse e-mail pour recevoir un nouveau lien."
|
|
2605
|
+
},
|
|
2606
|
+
success: {
|
|
2607
|
+
doi_sent: "E-mail de confirmation envoyé à votre adresse e-mail",
|
|
2608
|
+
login_email_sent: "Nous avons envoyé un lien pour gérer votre abonnement existant à votre adresse e-mail",
|
|
2609
|
+
logout: "Vous avez été déconnecté avec succès",
|
|
2610
|
+
preferences_updated: "Vos préférences ont été mises à jour avec succès",
|
|
2611
|
+
subscribe: "Vous vous êtes abonné avec succès",
|
|
2612
|
+
unsubscribe: "Vous vous êtes désabonné avec succès"
|
|
2613
|
+
}
|
|
2614
|
+
};
|
|
2615
|
+
const profile$3 = {
|
|
2616
|
+
signInToView: "Veuillez vous connecter pour voir votre profil",
|
|
2617
|
+
updated: "Le profil a été mis à jour"
|
|
2618
|
+
};
|
|
2619
|
+
var fr = {
|
|
2620
|
+
auth: auth$3,
|
|
2621
|
+
buttons: buttons$3,
|
|
2622
|
+
errors: errors$3,
|
|
2623
|
+
loading: loading$3,
|
|
2624
|
+
newsletter: newsletter$3,
|
|
2625
|
+
profile: profile$3
|
|
2626
|
+
};
|
|
2627
|
+
|
|
2628
|
+
const auth$2 = {
|
|
2629
|
+
email: {
|
|
2630
|
+
placeholder: "Inserisci la tua email"
|
|
2631
|
+
},
|
|
2632
|
+
magicCode: {
|
|
2633
|
+
already_sent_text: "Codice magico già inviato alla tua email",
|
|
2634
|
+
button_text: "Invia codice magico",
|
|
2635
|
+
resend: {
|
|
2636
|
+
button_text: "Invia di nuovo il codice magico"
|
|
2637
|
+
},
|
|
2638
|
+
sending_text: "Invio in corso..."
|
|
2639
|
+
},
|
|
2640
|
+
passkey: {
|
|
2641
|
+
button_text: "Accedi con Passkey",
|
|
2642
|
+
loading_text: "Autenticazione..."
|
|
2643
|
+
},
|
|
2644
|
+
password: {
|
|
2645
|
+
button_text: "Accedi con password",
|
|
2646
|
+
confirmation: {
|
|
2647
|
+
placeholder: "Conferma la tua password"
|
|
2648
|
+
},
|
|
2649
|
+
placeholder: "Inserisci la tua password"
|
|
2650
|
+
},
|
|
2651
|
+
resetPassword: {
|
|
2652
|
+
button_text_resend: "Reinvia email di reimpostazione password",
|
|
2653
|
+
button_text_reset: "Reimposta password",
|
|
2654
|
+
button_text_set: "Salva password",
|
|
2655
|
+
success_message: "Email di reimpostazione password inviata. Controlla la tua casella di posta"
|
|
2656
|
+
},
|
|
2657
|
+
"single-login": {
|
|
2658
|
+
button_text: "Accedi"
|
|
2659
|
+
},
|
|
2660
|
+
socialLogin: {
|
|
2661
|
+
button_text: "Continua con {{provider}}"
|
|
2662
|
+
}
|
|
2663
|
+
};
|
|
2664
|
+
const buttons$2 = {
|
|
2665
|
+
close: "Chiudi",
|
|
2666
|
+
"continue": "Continua",
|
|
2667
|
+
logout: "Esci",
|
|
2668
|
+
registration: "Registra nuovo account",
|
|
2669
|
+
sign_in: "Accedi",
|
|
2670
|
+
submit: "Invia"
|
|
2671
|
+
};
|
|
2672
|
+
const errors$2 = {
|
|
2673
|
+
account_locked: "Account bloccato",
|
|
2674
|
+
account_not_found: "Account non trovato",
|
|
2675
|
+
authentication_failed: "Autenticazione fallita",
|
|
2676
|
+
bad_request: "Richiesta non valida",
|
|
2677
|
+
connection_failed: "Impossibile connettersi al server Unidy",
|
|
2678
|
+
expired: "Scaduto",
|
|
2679
|
+
failed_to_load_profile: "Impossibile caricare i dati del profilo. Controlla la configurazione",
|
|
2680
|
+
invalid_id_token: "Token ID non valido",
|
|
2681
|
+
invalid_passkey: "Passkey non valida",
|
|
2682
|
+
invalid_password: "Password non valida",
|
|
2683
|
+
invalid_refresh_token: "Token di aggiornamento non valido",
|
|
2684
|
+
invalid_required_fields_payload: "Payload dei campi obbligatori non valido",
|
|
2685
|
+
invalid_reset_token: "Token di reimpostazione non valido. Richiedi una nuova email di reimpostazione password",
|
|
2686
|
+
invalid_response_format: "Formato di risposta non valido",
|
|
2687
|
+
internal_server_error: "Errore interno del server",
|
|
2688
|
+
magic_code_is_missing: "Codice magico mancante",
|
|
2689
|
+
magic_code_recently_created: "Codice magico creato di recente",
|
|
2690
|
+
missing_id_token: "Token ID mancante",
|
|
2691
|
+
missing_refresh_token: "Nessun token di aggiornamento presente",
|
|
2692
|
+
missing_required_fields: "Campi obbligatori mancanti",
|
|
2693
|
+
no_sign_in_id: "Nessun ID di accesso disponibile",
|
|
2694
|
+
not_valid: "Non valido",
|
|
2695
|
+
passkey_cancelled: "Autenticazione passkey annullata",
|
|
2696
|
+
passkey_error: "Si è verificato un errore sconosciuto della passkey",
|
|
2697
|
+
passkey_invalid_state: "Stato passkey non valido",
|
|
2698
|
+
passkey_not_supported: "Passkey non supportata",
|
|
2699
|
+
passkey_security_error: "Errore di sicurezza passkey",
|
|
2700
|
+
password_not_set: "Password non impostata",
|
|
2701
|
+
password_required: "Password richiesta",
|
|
2702
|
+
password_requirements: {
|
|
2703
|
+
"is too short (minimum is 6 characters)": "La password è troppo corta (minimo 6 caratteri)",
|
|
2704
|
+
min_length: "La lunghezza minima è di 6 caratteri",
|
|
2705
|
+
mixed_case: "Deve contenere lettere maiuscole e minuscole",
|
|
2706
|
+
number: "Deve contenere un numero",
|
|
2707
|
+
symbol: "Deve contenere un simbolo"
|
|
2708
|
+
},
|
|
2709
|
+
passwords_do_not_match: "Le password non corrispondono",
|
|
2710
|
+
prefix: "ERRORE: ",
|
|
2711
|
+
refresh_failed: "Impossibile aggiornare il token. Accedi di nuovo",
|
|
2712
|
+
refresh_token_revoked: "Token di aggiornamento revocato",
|
|
2713
|
+
required_field: "{{field}} è obbligatorio",
|
|
2714
|
+
reset_password_already_sent: "Reimpostazione password già inviata",
|
|
2715
|
+
reset_token_expired: "Il token di reimpostazione è scaduto. Richiedi una nuova email di reimpostazione password",
|
|
2716
|
+
reset_token_missing: "Token di reimpostazione mancante",
|
|
2717
|
+
schema_validation_error: "Errore di validazione dello schema",
|
|
2718
|
+
sign_in_expired: "Accesso scaduto",
|
|
2719
|
+
sign_in_not_found: "Accesso non trovato",
|
|
2720
|
+
sign_out_failed: "Uscita fallita, motivo: {{reason}}",
|
|
2721
|
+
unknown: "Si è verificato un errore sconosciuto",
|
|
2722
|
+
used: "Usato",
|
|
2723
|
+
verification_failed: "Verifica fallita"
|
|
2724
|
+
};
|
|
2725
|
+
const loading$2 = "Caricamento...";
|
|
2726
|
+
const newsletter$2 = {
|
|
2727
|
+
buttons: {
|
|
2728
|
+
logout: "x",
|
|
2729
|
+
resend_doi: "Reinvia conferma",
|
|
2730
|
+
subscribe: "Iscriviti",
|
|
2731
|
+
unsubscribe: "Annulla iscrizione"
|
|
2732
|
+
},
|
|
2733
|
+
errors: {
|
|
2734
|
+
already_subscribed: "Già iscritto",
|
|
2735
|
+
email_required: "Inserisci il tuo indirizzo email",
|
|
2736
|
+
invalid_email: "Indirizzo email non valido",
|
|
2737
|
+
login_email_not_found: "L'abbonamento con questa email non esiste",
|
|
2738
|
+
newsletter_not_found: "Newsletter non trovata",
|
|
2739
|
+
preferences_not_found: "Preferenza non trovata",
|
|
2740
|
+
rate_limit_exceeded: "Limite di richieste superato. Riprova più tardi",
|
|
2741
|
+
unauthorized: "La tua sessione è scaduta. Accedi di nuovo",
|
|
2742
|
+
unconfirmed: "La tua email non è confermata per questa newsletter",
|
|
2743
|
+
unsubscribe_failed: "Annullamento iscrizione fallito",
|
|
2744
|
+
invalid_preference_token: "Token di preferenza non valido. Inserisci il tuo indirizzo email per ricevere un nuovo link."
|
|
2745
|
+
},
|
|
2746
|
+
success: {
|
|
2747
|
+
doi_sent: "Email di conferma inviata al tuo indirizzo email",
|
|
2748
|
+
login_email_sent: "Abbiamo inviato un link per gestire il tuo abbonamento esistente al tuo indirizzo email",
|
|
2749
|
+
logout: "Sei uscito con successo",
|
|
2750
|
+
preferences_updated: "Le tue preferenze sono state aggiornate con successo",
|
|
2751
|
+
subscribe: "Ti sei iscritto con successo",
|
|
2752
|
+
unsubscribe: "Hai annullato l'iscrizione con successo"
|
|
2753
|
+
}
|
|
2754
|
+
};
|
|
2755
|
+
const profile$2 = {
|
|
2756
|
+
signInToView: "Accedi per visualizzare il tuo profilo",
|
|
2757
|
+
updated: "Il profilo è stato aggiornato"
|
|
2758
|
+
};
|
|
2759
|
+
var it = {
|
|
2760
|
+
auth: auth$2,
|
|
2761
|
+
buttons: buttons$2,
|
|
2762
|
+
errors: errors$2,
|
|
2763
|
+
loading: loading$2,
|
|
2764
|
+
newsletter: newsletter$2,
|
|
2765
|
+
profile: profile$2
|
|
2766
|
+
};
|
|
2767
|
+
|
|
2768
|
+
const auth$1 = {
|
|
2769
|
+
email: {
|
|
2770
|
+
placeholder: "Voer uw e-mailadres in"
|
|
2771
|
+
},
|
|
2772
|
+
magicCode: {
|
|
2773
|
+
already_sent_text: "Magische code al naar uw e-mail verzonden",
|
|
2774
|
+
button_text: "Magische code verzenden",
|
|
2775
|
+
resend: {
|
|
2776
|
+
button_text: "Magische code opnieuw verzenden"
|
|
2777
|
+
},
|
|
2778
|
+
sending_text: "Verzenden..."
|
|
2779
|
+
},
|
|
2780
|
+
passkey: {
|
|
2781
|
+
button_text: "Aanmelden met toegangssleutel",
|
|
2782
|
+
loading_text: "Authenticatie..."
|
|
2783
|
+
},
|
|
2784
|
+
password: {
|
|
2785
|
+
button_text: "Aanmelden met wachtwoord",
|
|
2786
|
+
confirmation: {
|
|
2787
|
+
placeholder: "Bevestig uw wachtwoord"
|
|
2788
|
+
},
|
|
2789
|
+
placeholder: "Voer uw wachtwoord in"
|
|
2790
|
+
},
|
|
2791
|
+
resetPassword: {
|
|
2792
|
+
button_text_resend: "E-mail voor wachtwoordherstel opnieuw verzenden",
|
|
2793
|
+
button_text_reset: "Wachtwoord opnieuw instellen",
|
|
2794
|
+
button_text_set: "Wachtwoord opslaan",
|
|
2795
|
+
success_message: "E-mail voor wachtwoordherstel verzonden. Controleer uw inbox"
|
|
2796
|
+
},
|
|
2797
|
+
"single-login": {
|
|
2798
|
+
button_text: "Aanmelden"
|
|
2799
|
+
},
|
|
2800
|
+
socialLogin: {
|
|
2801
|
+
button_text: "Doorgaan met {{provider}}"
|
|
2802
|
+
}
|
|
2803
|
+
};
|
|
2804
|
+
const buttons$1 = {
|
|
2805
|
+
close: "Sluiten",
|
|
2806
|
+
"continue": "Doorgaan",
|
|
2807
|
+
logout: "Afmelden",
|
|
2808
|
+
registration: "Nieuw account registreren",
|
|
2809
|
+
sign_in: "Aanmelden",
|
|
2810
|
+
submit: "Verzenden"
|
|
2811
|
+
};
|
|
2812
|
+
const errors$1 = {
|
|
2813
|
+
account_locked: "Account vergrendeld",
|
|
2814
|
+
account_not_found: "Account niet gevonden",
|
|
2815
|
+
authentication_failed: "Authenticatie mislukt",
|
|
2816
|
+
bad_request: "Ongeldige aanvraag",
|
|
2817
|
+
connection_failed: "Kan geen verbinding maken met de Unidy-server",
|
|
2818
|
+
expired: "Verlopen",
|
|
2819
|
+
failed_to_load_profile: "Kan profielgegevens niet laden. Controleer de configuratie",
|
|
2820
|
+
invalid_id_token: "Ongeldige ID-token",
|
|
2821
|
+
invalid_passkey: "Ongeldige toegangssleutel",
|
|
2822
|
+
invalid_password: "Ongeldig wachtwoord",
|
|
2823
|
+
invalid_refresh_token: "Ongeldig vernieuwingstoken",
|
|
2824
|
+
invalid_required_fields_payload: "Ongeldige payload voor verplichte velden",
|
|
2825
|
+
invalid_reset_token: "Ongeldige reset-token. Vraag een nieuwe e-mail voor wachtwoordherstel aan",
|
|
2826
|
+
invalid_response_format: "Ongeldig antwoordformaat",
|
|
2827
|
+
internal_server_error: "Interne serverfout",
|
|
2828
|
+
magic_code_is_missing: "Magische code ontbreekt",
|
|
2829
|
+
magic_code_recently_created: "Magische code recent aangemaakt",
|
|
2830
|
+
missing_id_token: "Ontbrekende ID-token",
|
|
2831
|
+
missing_refresh_token: "Geen vernieuwingstoken aanwezig",
|
|
2832
|
+
missing_required_fields: "Ontbrekende verplichte velden",
|
|
2833
|
+
no_sign_in_id: "Geen aanmeldings-ID beschikbaar",
|
|
2834
|
+
not_valid: "Niet geldig",
|
|
2835
|
+
passkey_cancelled: "Toegangssleutelauthenticatie geannuleerd",
|
|
2836
|
+
passkey_error: "Er is een onbekende toegangssleutelfout opgetreden",
|
|
2837
|
+
passkey_invalid_state: "Ongeldige toegangssleutelstatus",
|
|
2838
|
+
passkey_not_supported: "Toegangssleutel niet ondersteund",
|
|
2839
|
+
passkey_security_error: "Beveiligingsfout toegangssleutel",
|
|
2840
|
+
password_not_set: "Wachtwoord niet ingesteld",
|
|
2841
|
+
password_required: "Wachtwoord is verplicht",
|
|
2842
|
+
password_requirements: {
|
|
2843
|
+
"is too short (minimum is 6 characters)": "Wachtwoord is te kort (minimaal 6 tekens)",
|
|
2844
|
+
min_length: "Minimale lengte is 6 tekens",
|
|
2845
|
+
mixed_case: "Moet zowel hoofdletters als kleine letters bevatten",
|
|
2846
|
+
number: "Moet een cijfer bevatten",
|
|
2847
|
+
symbol: "Moet een symbool bevatten"
|
|
2848
|
+
},
|
|
2849
|
+
passwords_do_not_match: "Wachtwoorden komen niet overeen",
|
|
2850
|
+
prefix: "FOUT: ",
|
|
2851
|
+
refresh_failed: "Kan token niet vernieuwen. Meld u opnieuw aan",
|
|
2852
|
+
refresh_token_revoked: "Vernieuwingstoken ingetrokken",
|
|
2853
|
+
required_field: "{{field}} is verplicht",
|
|
2854
|
+
reset_password_already_sent: "Wachtwoordherstel al verzonden",
|
|
2855
|
+
reset_token_expired: "Reset-token is verlopen. Vraag een nieuwe e-mail voor wachtwoordherstel aan",
|
|
2856
|
+
reset_token_missing: "Reset-token ontbreekt",
|
|
2857
|
+
schema_validation_error: "Schema-validatiefout",
|
|
2858
|
+
sign_in_expired: "Aanmelding verlopen",
|
|
2859
|
+
sign_in_not_found: "Aanmelding niet gevonden",
|
|
2860
|
+
sign_out_failed: "Afmelden mislukt, reden: {{reason}}",
|
|
2861
|
+
unknown: "Er is een onbekende fout opgetreden",
|
|
2862
|
+
used: "Gebruikt",
|
|
2863
|
+
verification_failed: "Verificatie mislukt"
|
|
2864
|
+
};
|
|
2865
|
+
const loading$1 = "Laden...";
|
|
2866
|
+
const newsletter$1 = {
|
|
2867
|
+
buttons: {
|
|
2868
|
+
logout: "x",
|
|
2869
|
+
resend_doi: "Bevestiging opnieuw verzenden",
|
|
2870
|
+
subscribe: "Abonneren",
|
|
2871
|
+
unsubscribe: "Uitschrijven"
|
|
2872
|
+
},
|
|
2873
|
+
errors: {
|
|
2874
|
+
already_subscribed: "Al geabonneerd",
|
|
2875
|
+
email_required: "Voer uw e-mailadres in",
|
|
2876
|
+
invalid_email: "Ongeldig e-mailadres",
|
|
2877
|
+
login_email_not_found: "Abonnement met dit e-mailadres bestaat niet",
|
|
2878
|
+
newsletter_not_found: "Nieuwsbrief niet gevonden",
|
|
2879
|
+
preferences_not_found: "Voorkeur niet gevonden",
|
|
2880
|
+
rate_limit_exceeded: "Snelheidslimiet overschreden. Probeer het later opnieuw",
|
|
2881
|
+
unauthorized: "Uw sessie is verlopen. Meld u opnieuw aan",
|
|
2882
|
+
unconfirmed: "Uw e-mail is niet bevestigd voor deze nieuwsbrief",
|
|
2883
|
+
unsubscribe_failed: "Uitschrijven mislukt",
|
|
2884
|
+
invalid_preference_token: "Ongeldig voorkeurstoken. Voer uw e-mailadres in om een nieuwe link te ontvangen."
|
|
2885
|
+
},
|
|
2886
|
+
success: {
|
|
2887
|
+
doi_sent: "Bevestigings-e-mail is verzonden naar uw e-mailadres",
|
|
2888
|
+
login_email_sent: "We hebben een link om uw bestaande abonnement te beheren naar uw e-mailadres gestuurd",
|
|
2889
|
+
logout: "U bent succesvol afgemeld",
|
|
2890
|
+
preferences_updated: "Uw voorkeuren zijn succesvol bijgewerkt",
|
|
2891
|
+
subscribe: "U bent succesvol geabonneerd",
|
|
2892
|
+
unsubscribe: "U bent succesvol uitgeschreven"
|
|
2893
|
+
}
|
|
2894
|
+
};
|
|
2895
|
+
const profile$1 = {
|
|
2896
|
+
signInToView: "Meld u aan om uw profiel te bekijken",
|
|
2897
|
+
updated: "Profiel is bijgewerkt"
|
|
2898
|
+
};
|
|
2899
|
+
var nl_be = {
|
|
2900
|
+
auth: auth$1,
|
|
2901
|
+
buttons: buttons$1,
|
|
2902
|
+
errors: errors$1,
|
|
2903
|
+
loading: loading$1,
|
|
2904
|
+
newsletter: newsletter$1,
|
|
2905
|
+
profile: profile$1
|
|
2906
|
+
};
|
|
2907
|
+
|
|
2908
|
+
const auth = {
|
|
2909
|
+
email: {
|
|
2910
|
+
placeholder: "Introduceți adresa dvs. de e-mail"
|
|
2911
|
+
},
|
|
2912
|
+
magicCode: {
|
|
2913
|
+
already_sent_text: "Cod magic trimis deja la adresa dvs. de e-mail",
|
|
2914
|
+
button_text: "Trimite cod magic",
|
|
2915
|
+
resend: {
|
|
2916
|
+
button_text: "Trimite din nou codul magic"
|
|
2917
|
+
},
|
|
2918
|
+
sending_text: "Se trimite..."
|
|
2919
|
+
},
|
|
2920
|
+
passkey: {
|
|
2921
|
+
button_text: "Conectați-vă cu cheie de acces",
|
|
2922
|
+
loading_text: "Autentificare..."
|
|
2923
|
+
},
|
|
2924
|
+
password: {
|
|
2925
|
+
button_text: "Conectați-vă cu parolă",
|
|
2926
|
+
confirmation: {
|
|
2927
|
+
placeholder: "Confirmați parola"
|
|
2928
|
+
},
|
|
2929
|
+
placeholder: "Introduceți parola"
|
|
2930
|
+
},
|
|
2931
|
+
resetPassword: {
|
|
2932
|
+
button_text_resend: "Retrimite e-mail pentru resetarea parolei",
|
|
2933
|
+
button_text_reset: "Resetează parola",
|
|
2934
|
+
button_text_set: "Salvează parola",
|
|
2935
|
+
success_message: "E-mail pentru resetarea parolei trimis. Vă rugăm să verificați inbox-ul"
|
|
2936
|
+
},
|
|
2937
|
+
"single-login": {
|
|
2938
|
+
button_text: "Conectare"
|
|
2939
|
+
},
|
|
2940
|
+
socialLogin: {
|
|
2941
|
+
button_text: "Continuă cu {{provider}}"
|
|
2942
|
+
}
|
|
2943
|
+
};
|
|
2944
|
+
const buttons = {
|
|
2945
|
+
close: "Închide",
|
|
2946
|
+
"continue": "Continuă",
|
|
2947
|
+
logout: "Deconectare",
|
|
2948
|
+
registration: "Înregistrează cont nou",
|
|
2949
|
+
sign_in: "Conectare",
|
|
2950
|
+
submit: "Trimite"
|
|
2951
|
+
};
|
|
2952
|
+
const errors = {
|
|
2953
|
+
account_locked: "Cont blocat",
|
|
2954
|
+
account_not_found: "Cont negăsit",
|
|
2955
|
+
authentication_failed: "Autentificare eșuată",
|
|
2956
|
+
bad_request: "Cerere invalidă",
|
|
2957
|
+
connection_failed: "Nu se poate conecta la serverul Unidy",
|
|
2958
|
+
expired: "Expirat",
|
|
2959
|
+
failed_to_load_profile: "Încărcarea datelor profilului a eșuat. Vă rugăm să verificați configurația",
|
|
2960
|
+
invalid_id_token: "Token ID invalid",
|
|
2961
|
+
invalid_passkey: "Cheie de acces invalidă",
|
|
2962
|
+
invalid_password: "Parolă invalidă",
|
|
2963
|
+
invalid_refresh_token: "Token de reîmprospătare invalid",
|
|
2964
|
+
invalid_required_fields_payload: "Payload invalid pentru câmpurile obligatorii",
|
|
2965
|
+
invalid_reset_token: "Token de resetare invalid. Vă rugăm să solicitați un nou e-mail pentru resetarea parolei",
|
|
2966
|
+
invalid_response_format: "Format de răspuns invalid",
|
|
2967
|
+
internal_server_error: "Eroare internă a serverului",
|
|
2968
|
+
magic_code_is_missing: "Cod magic lipsă",
|
|
2969
|
+
magic_code_recently_created: "Cod magic creat recent",
|
|
2970
|
+
missing_id_token: "Token ID lipsă",
|
|
2971
|
+
missing_refresh_token: "Niciun token de reîmprospătare prezent",
|
|
2972
|
+
missing_required_fields: "Câmpuri obligatorii lipsă",
|
|
2973
|
+
no_sign_in_id: "Niciun ID de conectare disponibil",
|
|
2974
|
+
not_valid: "Invalid",
|
|
2975
|
+
passkey_cancelled: "Autentificare cu cheie de acces anulată",
|
|
2976
|
+
passkey_error: "A apărut o eroare necunoscută a cheii de acces",
|
|
2977
|
+
passkey_invalid_state: "Stare invalidă a cheii de acces",
|
|
2978
|
+
passkey_not_supported: "Cheie de acces nesuportată",
|
|
2979
|
+
passkey_security_error: "Eroare de securitate a cheii de acces",
|
|
2980
|
+
password_not_set: "Parola nu este setată",
|
|
2981
|
+
password_required: "Parola este obligatorie",
|
|
2982
|
+
password_requirements: {
|
|
2983
|
+
"is too short (minimum is 6 characters)": "Parola este prea scurtă (minimum 6 caractere)",
|
|
2984
|
+
min_length: "Lungimea minimă este de 6 caractere",
|
|
2985
|
+
mixed_case: "Trebuie să conțină atât litere mari, cât și litere mici",
|
|
2986
|
+
number: "Trebuie să conțină o cifră",
|
|
2987
|
+
symbol: "Trebuie să conțină un simbol"
|
|
2988
|
+
},
|
|
2989
|
+
passwords_do_not_match: "Parolele nu se potrivesc",
|
|
2990
|
+
prefix: "EROARE: ",
|
|
2991
|
+
refresh_failed: "Reîmprospătarea token-ului a eșuat. Vă rugăm să vă conectați din nou",
|
|
2992
|
+
refresh_token_revoked: "Token de reîmprospătare revocat",
|
|
2993
|
+
required_field: "{{field}} este obligatoriu",
|
|
2994
|
+
reset_password_already_sent: "Resetare parolă deja trimisă",
|
|
2995
|
+
reset_token_expired: "Token-ul de resetare a expirat. Vă rugăm să solicitați un nou e-mail pentru resetarea parolei",
|
|
2996
|
+
reset_token_missing: "Token de resetare lipsă",
|
|
2997
|
+
schema_validation_error: "Eroare de validare a schemei",
|
|
2998
|
+
sign_in_expired: "Conectare expirată",
|
|
2999
|
+
sign_in_not_found: "Conectare negăsită",
|
|
3000
|
+
sign_out_failed: "Deconectare eșuată, motiv: {{reason}}",
|
|
3001
|
+
unknown: "A apărut o eroare necunoscută",
|
|
3002
|
+
used: "Folosit",
|
|
3003
|
+
verification_failed: "Verificare eșuată"
|
|
3004
|
+
};
|
|
3005
|
+
const loading = "Se încarcă...";
|
|
3006
|
+
const newsletter = {
|
|
3007
|
+
buttons: {
|
|
3008
|
+
logout: "x",
|
|
3009
|
+
resend_doi: "Retrimite confirmarea",
|
|
3010
|
+
subscribe: "Abonare",
|
|
3011
|
+
unsubscribe: "Dezabonare"
|
|
3012
|
+
},
|
|
3013
|
+
errors: {
|
|
3014
|
+
already_subscribed: "Deja abonat",
|
|
3015
|
+
email_required: "Vă rugăm să introduceți adresa dvs. de e-mail",
|
|
3016
|
+
invalid_email: "Adresă de e-mail invalidă",
|
|
3017
|
+
login_email_not_found: "Abonamentul cu această adresă de e-mail nu există",
|
|
3018
|
+
newsletter_not_found: "Newsletter negăsit",
|
|
3019
|
+
preferences_not_found: "Preferință negăsită",
|
|
3020
|
+
rate_limit_exceeded: "Limita de rată depășită. Vă rugăm să încercați din nou mai târziu",
|
|
3021
|
+
unauthorized: "Sesiunea dvs. a expirat. Vă rugăm să vă conectați din nou",
|
|
3022
|
+
unconfirmed: "E-mailul dvs. nu este confirmat pentru acest newsletter",
|
|
3023
|
+
unsubscribe_failed: "Dezabonare eșuată",
|
|
3024
|
+
invalid_preference_token: "Token de preferință invalid. Introduceți adresa dvs. de e-mail pentru a primi un link nou."
|
|
3025
|
+
},
|
|
3026
|
+
success: {
|
|
3027
|
+
doi_sent: "E-mail de confirmare trimis la adresa dvs. de e-mail",
|
|
3028
|
+
login_email_sent: "Am trimis un link pentru a vă gestiona abonamentul existent la adresa dvs. de e-mail",
|
|
3029
|
+
logout: "V-ați deconectat cu succes",
|
|
3030
|
+
preferences_updated: "Preferințele dvs. au fost actualizate cu succes",
|
|
3031
|
+
subscribe: "V-ați abonat cu succes",
|
|
3032
|
+
unsubscribe: "V-ați dezabonat cu succes"
|
|
3033
|
+
}
|
|
3034
|
+
};
|
|
3035
|
+
const profile = {
|
|
3036
|
+
signInToView: "Vă rugăm să vă conectați pentru a vă vedea profilul",
|
|
3037
|
+
updated: "Profilul a fost actualizat"
|
|
3038
|
+
};
|
|
3039
|
+
var ro = {
|
|
3040
|
+
auth: auth,
|
|
3041
|
+
buttons: buttons,
|
|
3042
|
+
errors: errors,
|
|
3043
|
+
loading: loading,
|
|
3044
|
+
newsletter: newsletter,
|
|
3045
|
+
profile: profile
|
|
3046
|
+
};
|
|
3047
|
+
|
|
3048
|
+
instance.use(index.i18nLogger).init({
|
|
3049
|
+
lng: "en",
|
|
3050
|
+
fallbackLng: "en",
|
|
3051
|
+
debug: index.Build.isDev,
|
|
3052
|
+
interpolation: {
|
|
3053
|
+
escapeValue: false,
|
|
3054
|
+
},
|
|
3055
|
+
resources: {
|
|
3056
|
+
de: { translation: de },
|
|
3057
|
+
en: { translation: en },
|
|
3058
|
+
fr: { translation: fr },
|
|
3059
|
+
it: { translation: it },
|
|
3060
|
+
nl_be: { translation: nl_be },
|
|
3061
|
+
ro: { translation: ro },
|
|
3062
|
+
},
|
|
3063
|
+
});
|
|
3064
|
+
unidyStore.onChange("locale", (locale) => instance.changeLanguage(locale));
|
|
3065
|
+
// biome-ignore lint/suspicious/noExplicitAny: i18next options are dynamic
|
|
3066
|
+
const t = (key, opts = {}) => instance.t(key, opts, { lng: unidyStore.unidyState.locale });
|
|
3067
|
+
|
|
3068
|
+
exports.instance = instance;
|
|
3069
|
+
exports.t = t;
|
|
3070
|
+
//# sourceMappingURL=i18n-B2T1e9Mf.js.map
|
|
3071
|
+
|
|
3072
|
+
//# sourceMappingURL=i18n-B2T1e9Mf.js.map
|