@generaltranslation/react-core 12.0.0-samsara.0 → 12.0.0-samsara.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/CHANGELOG.md +347 -0
- package/dist/compat/CompatStore.cjs +2 -0
- package/dist/compat/CompatStore.cjs.map +1 -0
- package/dist/compat/CompatStore.d.ts +26 -0
- package/dist/compat/CompatStore.d.ts.map +1 -0
- package/dist/compat/CompatStore.mjs +2 -0
- package/dist/compat/CompatStore.mjs.map +1 -0
- package/dist/compat/DictionaryContext.cjs +2 -0
- package/dist/compat/DictionaryContext.cjs.map +1 -0
- package/dist/compat/DictionaryContext.mjs +2 -0
- package/dist/compat/DictionaryContext.mjs.map +1 -0
- package/dist/compat/DictionaryProvider.cjs +2 -0
- package/dist/compat/DictionaryProvider.cjs.map +1 -0
- package/dist/compat/DictionaryProvider.d.ts +29 -0
- package/dist/compat/DictionaryProvider.d.ts.map +1 -0
- package/dist/compat/DictionaryProvider.mjs +2 -0
- package/dist/compat/DictionaryProvider.mjs.map +1 -0
- package/dist/compat/dictionaries.cjs +2 -0
- package/dist/compat/dictionaries.cjs.map +1 -0
- package/dist/compat/dictionaries.mjs +2 -0
- package/dist/compat/dictionaries.mjs.map +1 -0
- package/dist/compat/missing-dictionary.cjs +2 -0
- package/dist/compat/missing-dictionary.cjs.map +1 -0
- package/dist/compat/missing-dictionary.mjs +2 -0
- package/dist/compat/missing-dictionary.mjs.map +1 -0
- package/dist/compat/types.d.ts +15 -0
- package/dist/compat/types.d.ts.map +1 -0
- package/dist/compat/useTrackedDictionaryObjResolver.cjs +2 -0
- package/dist/compat/useTrackedDictionaryObjResolver.cjs.map +1 -0
- package/dist/compat/useTrackedDictionaryObjResolver.mjs +2 -0
- package/dist/compat/useTrackedDictionaryObjResolver.mjs.map +1 -0
- package/dist/compat/useTrackedDictionaryResolver.cjs +2 -0
- package/dist/compat/useTrackedDictionaryResolver.cjs.map +1 -0
- package/dist/compat/useTrackedDictionaryResolver.mjs +2 -0
- package/dist/compat/useTrackedDictionaryResolver.mjs.map +1 -0
- package/dist/compat/useTranslations.cjs +2 -0
- package/dist/compat/useTranslations.cjs.map +1 -0
- package/dist/compat/useTranslations.d.ts +7 -0
- package/dist/compat/useTranslations.d.ts.map +1 -0
- package/dist/compat/useTranslations.mjs +2 -0
- package/dist/compat/useTranslations.mjs.map +1 -0
- package/dist/compat.cjs +1 -0
- package/dist/compat.d.mts +1 -0
- package/dist/compat.d.ts +4 -0
- package/dist/compat.mjs +1 -0
- package/dist/components/branches/Branch.cjs +1 -1
- package/dist/components/branches/Branch.cjs.map +1 -1
- package/dist/components/branches/Branch.d.ts +25 -11
- package/dist/components/branches/Branch.d.ts.map +1 -1
- package/dist/components/branches/Branch.mjs +1 -1
- package/dist/components/branches/Branch.mjs.map +1 -1
- package/dist/components/branches/Plural.cjs +1 -1
- package/dist/components/branches/Plural.cjs.map +1 -1
- package/dist/components/branches/Plural.d.ts +1 -5
- package/dist/components/branches/Plural.d.ts.map +1 -1
- package/dist/components/branches/Plural.mjs +1 -1
- package/dist/components/branches/Plural.mjs.map +1 -1
- package/dist/components/branches/Plural.shared.cjs +1 -1
- package/dist/components/branches/Plural.shared.cjs.map +1 -1
- package/dist/components/branches/Plural.shared.d.ts +5 -8
- package/dist/components/branches/Plural.shared.d.ts.map +1 -1
- package/dist/components/branches/Plural.shared.mjs +1 -1
- package/dist/components/branches/Plural.shared.mjs.map +1 -1
- package/dist/components/helpers/InternalLocaleSelector.cjs +1 -1
- package/dist/components/helpers/InternalLocaleSelector.cjs.map +1 -1
- package/dist/components/helpers/InternalLocaleSelector.d.ts +1 -6
- package/dist/components/helpers/InternalLocaleSelector.d.ts.map +1 -1
- package/dist/components/helpers/InternalLocaleSelector.mjs +1 -1
- package/dist/components/helpers/InternalLocaleSelector.mjs.map +1 -1
- package/dist/components/translation/T.cjs +1 -1
- package/dist/components/translation/T.cjs.map +1 -1
- package/dist/components/translation/T.mjs +1 -1
- package/dist/components/translation/T.mjs.map +1 -1
- package/dist/components/translation/T.rsc.cjs +1 -1
- package/dist/components/translation/T.rsc.cjs.map +1 -1
- package/dist/components/translation/T.rsc.mjs +1 -1
- package/dist/components/translation/T.rsc.mjs.map +1 -1
- package/dist/components/translation/Tx.rsc.cjs +1 -1
- package/dist/components/translation/Tx.rsc.cjs.map +1 -1
- package/dist/components/translation/Tx.rsc.mjs +1 -1
- package/dist/components/translation/Tx.rsc.mjs.map +1 -1
- package/dist/components/variables/Currency.cjs +1 -1
- package/dist/components/variables/Currency.cjs.map +1 -1
- package/dist/components/variables/Currency.d.ts +1 -5
- package/dist/components/variables/Currency.d.ts.map +1 -1
- package/dist/components/variables/Currency.mjs +1 -1
- package/dist/components/variables/Currency.mjs.map +1 -1
- package/dist/components/variables/Currency.shared.cjs +1 -1
- package/dist/components/variables/Currency.shared.cjs.map +1 -1
- package/dist/components/variables/Currency.shared.d.ts +2 -5
- package/dist/components/variables/Currency.shared.d.ts.map +1 -1
- package/dist/components/variables/Currency.shared.mjs +1 -1
- package/dist/components/variables/Currency.shared.mjs.map +1 -1
- package/dist/components/variables/DateTime.cjs +1 -1
- package/dist/components/variables/DateTime.cjs.map +1 -1
- package/dist/components/variables/DateTime.d.ts +1 -5
- package/dist/components/variables/DateTime.d.ts.map +1 -1
- package/dist/components/variables/DateTime.mjs +1 -1
- package/dist/components/variables/DateTime.mjs.map +1 -1
- package/dist/components/variables/DateTime.shared.cjs +1 -1
- package/dist/components/variables/DateTime.shared.cjs.map +1 -1
- package/dist/components/variables/DateTime.shared.d.ts +1 -4
- package/dist/components/variables/DateTime.shared.d.ts.map +1 -1
- package/dist/components/variables/DateTime.shared.mjs +1 -1
- package/dist/components/variables/DateTime.shared.mjs.map +1 -1
- package/dist/components/variables/Num.cjs +1 -1
- package/dist/components/variables/Num.cjs.map +1 -1
- package/dist/components/variables/Num.d.ts +1 -5
- package/dist/components/variables/Num.d.ts.map +1 -1
- package/dist/components/variables/Num.mjs +1 -1
- package/dist/components/variables/Num.mjs.map +1 -1
- package/dist/components/variables/Num.shared.cjs +1 -1
- package/dist/components/variables/Num.shared.cjs.map +1 -1
- package/dist/components/variables/Num.shared.d.ts +1 -4
- package/dist/components/variables/Num.shared.d.ts.map +1 -1
- package/dist/components/variables/Num.shared.mjs +1 -1
- package/dist/components/variables/Num.shared.mjs.map +1 -1
- package/dist/components/variables/RelativeTime.cjs +1 -1
- package/dist/components/variables/RelativeTime.cjs.map +1 -1
- package/dist/components/variables/RelativeTime.d.ts +1 -5
- package/dist/components/variables/RelativeTime.d.ts.map +1 -1
- package/dist/components/variables/RelativeTime.mjs +1 -1
- package/dist/components/variables/RelativeTime.mjs.map +1 -1
- package/dist/components/variables/RelativeTime.shared.cjs +1 -1
- package/dist/components/variables/RelativeTime.shared.cjs.map +1 -1
- package/dist/components/variables/RelativeTime.shared.d.ts +0 -4
- package/dist/components/variables/RelativeTime.shared.d.ts.map +1 -1
- package/dist/components/variables/RelativeTime.shared.mjs +1 -1
- package/dist/components/variables/RelativeTime.shared.mjs.map +1 -1
- package/dist/components/variables/Var.cjs.map +1 -1
- package/dist/components/variables/Var.d.ts +1 -3
- package/dist/components/variables/Var.d.ts.map +1 -1
- package/dist/components/variables/Var.mjs.map +1 -1
- package/dist/components-rsc.cjs +1 -1
- package/dist/components-rsc.d.ts +4 -15
- package/dist/components-rsc.mjs +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +1 -2
- package/dist/components.mjs +1 -1
- package/dist/condition-store/singleton-operations.cjs +1 -1
- package/dist/condition-store/singleton-operations.cjs.map +1 -1
- package/dist/condition-store/singleton-operations.d.ts +2 -2
- package/dist/condition-store/singleton-operations.d.ts.map +1 -1
- package/dist/condition-store/singleton-operations.mjs +1 -1
- package/dist/condition-store/singleton-operations.mjs.map +1 -1
- package/dist/context/InternalGTProvider.cjs +1 -1
- package/dist/context/InternalGTProvider.cjs.map +1 -1
- package/dist/context/InternalGTProvider.d.ts +7 -13
- package/dist/context/InternalGTProvider.d.ts.map +1 -1
- package/dist/context/InternalGTProvider.mjs +1 -1
- package/dist/context/InternalGTProvider.mjs.map +1 -1
- package/dist/context/context.cjs +1 -1
- package/dist/context/context.cjs.map +1 -1
- package/dist/context/context.mjs +1 -1
- package/dist/context/context.mjs.map +1 -1
- package/dist/functions/helpers/getTranslationsSnapshot.cjs +1 -1
- package/dist/functions/helpers/getTranslationsSnapshot.cjs.map +1 -1
- package/dist/functions/helpers/getTranslationsSnapshot.d.ts +3 -3
- package/dist/functions/helpers/getTranslationsSnapshot.d.ts.map +1 -1
- package/dist/functions/helpers/getTranslationsSnapshot.mjs +1 -1
- package/dist/functions/helpers/getTranslationsSnapshot.mjs.map +1 -1
- package/dist/functions/translation/t.cjs +1 -1
- package/dist/functions/translation/t.cjs.map +1 -1
- package/dist/functions/translation/t.d.ts +6 -1
- package/dist/functions/translation/t.d.ts.map +1 -1
- package/dist/functions/translation/t.mjs +1 -1
- package/dist/functions/translation/t.mjs.map +1 -1
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.cjs +1 -1
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.cjs.map +1 -1
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.mjs +1 -1
- package/dist/hooks/external-store/useSubscribeToTrackedLookups.mjs.map +1 -1
- package/dist/hooks/external-store/useTrackedTranslationResolver.cjs +1 -1
- package/dist/hooks/external-store/useTrackedTranslationResolver.cjs.map +1 -1
- package/dist/hooks/external-store/useTrackedTranslationResolver.mjs +1 -1
- package/dist/hooks/external-store/useTrackedTranslationResolver.mjs.map +1 -1
- package/dist/hooks/external-store.cjs +1 -1
- package/dist/hooks/external-store.cjs.map +1 -1
- package/dist/hooks/external-store.mjs +1 -1
- package/dist/hooks/external-store.mjs.map +1 -1
- package/dist/hooks/i18n-config.cjs.map +1 -1
- package/dist/hooks/i18n-config.d.ts +1 -1
- package/dist/hooks/i18n-config.mjs.map +1 -1
- package/dist/hooks/useGT.cjs +1 -1
- package/dist/hooks/useGT.cjs.map +1 -1
- package/dist/hooks/useGT.d.ts +2 -3
- package/dist/hooks/useGT.d.ts.map +1 -1
- package/dist/hooks/useGT.mjs +1 -1
- package/dist/hooks/useGT.mjs.map +1 -1
- package/dist/hooks/useInternalLocaleSelector.cjs.map +1 -1
- package/dist/hooks/useInternalLocaleSelector.d.ts +1 -1
- package/dist/hooks/useInternalLocaleSelector.d.ts.map +1 -1
- package/dist/hooks/useInternalLocaleSelector.mjs.map +1 -1
- package/dist/hooks/useInternalRegionSelector.cjs +1 -1
- package/dist/hooks/useInternalRegionSelector.cjs.map +1 -1
- package/dist/hooks/useInternalRegionSelector.d.ts +3 -5
- package/dist/hooks/useInternalRegionSelector.d.ts.map +1 -1
- package/dist/hooks/useInternalRegionSelector.mjs +1 -1
- package/dist/hooks/useInternalRegionSelector.mjs.map +1 -1
- package/dist/hooks/useMessages.cjs +1 -1
- package/dist/hooks/useMessages.cjs.map +1 -1
- package/dist/hooks/useMessages.d.ts +2 -3
- package/dist/hooks/useMessages.d.ts.map +1 -1
- package/dist/hooks/useMessages.mjs +1 -1
- package/dist/hooks/useMessages.mjs.map +1 -1
- package/dist/hooks/utils/getFormatLocales.cjs +1 -1
- package/dist/hooks/utils/getFormatLocales.cjs.map +1 -1
- package/dist/hooks/utils/getFormatLocales.d.ts +5 -3
- package/dist/hooks/utils/getFormatLocales.d.ts.map +1 -1
- package/dist/hooks/utils/getFormatLocales.mjs +1 -1
- package/dist/hooks/utils/getFormatLocales.mjs.map +1 -1
- package/dist/hooks/utils/getShouldTranslate.cjs +1 -1
- package/dist/hooks/utils/getShouldTranslate.cjs.map +1 -1
- package/dist/hooks/utils/getShouldTranslate.mjs +1 -1
- package/dist/hooks/utils/getShouldTranslate.mjs.map +1 -1
- package/dist/hooks/utils/missing-translation.cjs +1 -1
- package/dist/hooks/utils/missing-translation.cjs.map +1 -1
- package/dist/hooks/utils/missing-translation.d.ts +4 -6
- package/dist/hooks/utils/missing-translation.d.ts.map +1 -1
- package/dist/hooks/utils/missing-translation.mjs +1 -1
- package/dist/hooks/utils/missing-translation.mjs.map +1 -1
- package/dist/hooks/utils.cjs +1 -1
- package/dist/hooks/utils.cjs.map +1 -1
- package/dist/hooks/utils.d.ts +2 -3
- package/dist/hooks/utils.d.ts.map +1 -1
- package/dist/hooks/utils.mjs +1 -1
- package/dist/hooks/utils.mjs.map +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.d.ts +1 -2
- package/dist/hooks.mjs +1 -1
- package/dist/i18n-cache/ReactI18nCache.cjs.map +1 -1
- package/dist/i18n-cache/ReactI18nCache.d.ts +3 -4
- package/dist/i18n-cache/ReactI18nCache.d.ts.map +1 -1
- package/dist/i18n-cache/ReactI18nCache.mjs.map +1 -1
- package/dist/i18n-cache/singleton-operations.cjs.map +1 -1
- package/dist/i18n-cache/singleton-operations.d.ts.map +1 -1
- package/dist/i18n-cache/singleton-operations.mjs.map +1 -1
- package/dist/i18n-store/I18nStore.cjs +1 -1
- package/dist/i18n-store/I18nStore.cjs.map +1 -1
- package/dist/i18n-store/I18nStore.d.ts +8 -26
- package/dist/i18n-store/I18nStore.d.ts.map +1 -1
- package/dist/i18n-store/I18nStore.mjs +1 -1
- package/dist/i18n-store/I18nStore.mjs.map +1 -1
- package/dist/i18n-store/singleton-operations.cjs +1 -1
- package/dist/i18n-store/singleton-operations.cjs.map +1 -1
- package/dist/i18n-store/singleton-operations.d.ts.map +1 -1
- package/dist/i18n-store/singleton-operations.mjs +1 -1
- package/dist/i18n-store/singleton-operations.mjs.map +1 -1
- package/dist/i18n-store/storeTypes.d.ts +6 -12
- package/dist/i18n-store/storeTypes.d.ts.map +1 -1
- package/dist/i18n-store/useI18nStore.cjs +1 -1
- package/dist/i18n-store/useI18nStore.cjs.map +1 -1
- package/dist/i18n-store/useI18nStore.mjs +1 -1
- package/dist/i18n-store/useI18nStore.mjs.map +1 -1
- package/dist/i18n-store/utils/runtimeTranslationErrors.cjs +2 -0
- package/dist/i18n-store/utils/runtimeTranslationErrors.cjs.map +1 -0
- package/dist/i18n-store/utils/runtimeTranslationErrors.mjs +2 -0
- package/dist/i18n-store/utils/runtimeTranslationErrors.mjs.map +1 -0
- package/dist/i18n-store/utils/translations.cjs +1 -1
- package/dist/i18n-store/utils/translations.cjs.map +1 -1
- package/dist/i18n-store/utils/translations.mjs +1 -1
- package/dist/i18n-store/utils/translations.mjs.map +1 -1
- package/dist/pure.cjs +1 -1
- package/dist/pure.d.ts +4 -8
- package/dist/pure.mjs +1 -1
- package/dist/setup/i18nConfig.cjs +1 -1
- package/dist/setup/i18nConfig.cjs.map +1 -1
- package/dist/setup/i18nConfig.d.ts +1 -2
- package/dist/setup/i18nConfig.d.ts.map +1 -1
- package/dist/setup/i18nConfig.mjs +1 -1
- package/dist/setup/i18nConfig.mjs.map +1 -1
- package/dist/unstable/m.cjs +2 -0
- package/dist/unstable/m.cjs.map +1 -0
- package/dist/unstable/m.d.ts +17 -0
- package/dist/unstable/m.d.ts.map +1 -0
- package/dist/unstable/m.mjs +2 -0
- package/dist/unstable/m.mjs.map +1 -0
- package/dist/unstable/spaOnly.cjs +2 -0
- package/dist/unstable/spaOnly.cjs.map +1 -0
- package/dist/unstable/spaOnly.mjs +2 -0
- package/dist/unstable/spaOnly.mjs.map +1 -0
- package/dist/unstable/t.cjs +2 -0
- package/dist/unstable/t.cjs.map +1 -0
- package/dist/unstable/t.d.ts +16 -0
- package/dist/unstable/t.d.ts.map +1 -0
- package/dist/unstable/t.mjs +2 -0
- package/dist/unstable/t.mjs.map +1 -0
- package/dist/unstable/useGT.cjs +2 -0
- package/dist/unstable/useGT.cjs.map +1 -0
- package/dist/unstable/useGT.d.ts +17 -0
- package/dist/unstable/useGT.d.ts.map +1 -0
- package/dist/unstable/useGT.mjs +2 -0
- package/dist/unstable/useGT.mjs.map +1 -0
- package/dist/unstable/useMessages.cjs +2 -0
- package/dist/unstable/useMessages.cjs.map +1 -0
- package/dist/unstable/useMessages.d.ts +16 -0
- package/dist/unstable/useMessages.d.ts.map +1 -0
- package/dist/unstable/useMessages.mjs +2 -0
- package/dist/unstable/useMessages.mjs.map +1 -0
- package/dist/unstable.cjs +1 -0
- package/dist/unstable.d.mts +1 -0
- package/dist/unstable.d.ts +5 -0
- package/dist/unstable.mjs +1 -0
- package/dist/utils/internal/addGTIdentifier.cjs +1 -1
- package/dist/utils/internal/addGTIdentifier.cjs.map +1 -1
- package/dist/utils/internal/addGTIdentifier.mjs +1 -1
- package/dist/utils/internal/addGTIdentifier.mjs.map +1 -1
- package/dist/utils/internal/removeInjectedT.cjs +1 -1
- package/dist/utils/internal/removeInjectedT.cjs.map +1 -1
- package/dist/utils/internal/removeInjectedT.mjs +1 -1
- package/dist/utils/internal/removeInjectedT.mjs.map +1 -1
- package/dist/utils/internal/writeChildrenAsObjects.cjs +1 -1
- package/dist/utils/internal/writeChildrenAsObjects.cjs.map +1 -1
- package/dist/utils/internal/writeChildrenAsObjects.mjs +1 -1
- package/dist/utils/internal/writeChildrenAsObjects.mjs.map +1 -1
- package/dist/utils/plurals/getPluralBranch.cjs +1 -1
- package/dist/utils/plurals/getPluralBranch.cjs.map +1 -1
- package/dist/utils/plurals/getPluralBranch.d.ts +3 -6
- package/dist/utils/plurals/getPluralBranch.d.ts.map +1 -1
- package/dist/utils/plurals/getPluralBranch.mjs +1 -1
- package/dist/utils/plurals/getPluralBranch.mjs.map +1 -1
- package/dist/utils/rendering/createRenderPipeline.cjs.map +1 -1
- package/dist/utils/rendering/createRenderPipeline.d.ts.map +1 -1
- package/dist/utils/rendering/createRenderPipeline.mjs.map +1 -1
- package/dist/utils/rendering/createRenderVariable.cjs +1 -1
- package/dist/utils/rendering/createRenderVariable.cjs.map +1 -1
- package/dist/utils/rendering/createRenderVariable.mjs +1 -1
- package/dist/utils/rendering/createRenderVariable.mjs.map +1 -1
- package/dist/utils/rendering/renderDefaultChildren.shared.cjs +1 -1
- package/dist/utils/rendering/renderDefaultChildren.shared.cjs.map +1 -1
- package/dist/utils/rendering/renderDefaultChildren.shared.mjs +1 -1
- package/dist/utils/rendering/renderDefaultChildren.shared.mjs.map +1 -1
- package/dist/utils/rendering/renderPipeline.rsc.cjs +1 -1
- package/dist/utils/rendering/renderPipeline.rsc.cjs.map +1 -1
- package/dist/utils/rendering/renderPipeline.rsc.d.ts.map +1 -1
- package/dist/utils/rendering/renderPipeline.rsc.mjs +1 -1
- package/dist/utils/rendering/renderPipeline.rsc.mjs.map +1 -1
- package/dist/utils/rendering/renderPreparedT.shared.cjs +1 -1
- package/dist/utils/rendering/renderPreparedT.shared.cjs.map +1 -1
- package/dist/utils/rendering/renderPreparedT.shared.d.ts +1 -1
- package/dist/utils/rendering/renderPreparedT.shared.mjs +1 -1
- package/dist/utils/rendering/renderPreparedT.shared.mjs.map +1 -1
- package/dist/utils/rendering/renderTranslatedChildren.shared.cjs +1 -1
- package/dist/utils/rendering/renderTranslatedChildren.shared.cjs.map +1 -1
- package/dist/utils/rendering/renderTranslatedChildren.shared.d.ts.map +1 -1
- package/dist/utils/rendering/renderTranslatedChildren.shared.mjs +1 -1
- package/dist/utils/rendering/renderTranslatedChildren.shared.mjs.map +1 -1
- package/dist/utils/translation/prepareT.shared.cjs +1 -1
- package/dist/utils/translation/prepareT.shared.cjs.map +1 -1
- package/dist/utils/translation/prepareT.shared.d.ts +4 -6
- package/dist/utils/translation/prepareT.shared.d.ts.map +1 -1
- package/dist/utils/translation/prepareT.shared.mjs +1 -1
- package/dist/utils/translation/prepareT.shared.mjs.map +1 -1
- package/dist/utils/translation/resolveTagHash.cjs +1 -1
- package/dist/utils/translation/resolveTagHash.cjs.map +1 -1
- package/dist/utils/translation/resolveTagHash.mjs +1 -1
- package/dist/utils/translation/resolveTagHash.mjs.map +1 -1
- package/dist/utils/translation/usePrepareT.cjs +1 -1
- package/dist/utils/translation/usePrepareT.cjs.map +1 -1
- package/dist/utils/translation/usePrepareT.mjs +1 -1
- package/dist/utils/translation/usePrepareT.mjs.map +1 -1
- package/dist/utils/types.d.ts +8 -8
- package/dist/utils/types.d.ts.map +1 -1
- package/dist/utils/variables/_getVariableProps.cjs +1 -1
- package/dist/utils/variables/_getVariableProps.cjs.map +1 -1
- package/dist/utils/variables/_getVariableProps.mjs +1 -1
- package/dist/utils/variables/_getVariableProps.mjs.map +1 -1
- package/package.json +24 -4
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.cjs +0 -2
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.cjs.map +0 -1
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.mjs +0 -2
- package/dist/hooks/external-store/useTrackedDictionaryObjResolver.mjs.map +0 -1
- package/dist/hooks/external-store/useTrackedDictionaryResolver.cjs +0 -2
- package/dist/hooks/external-store/useTrackedDictionaryResolver.cjs.map +0 -1
- package/dist/hooks/external-store/useTrackedDictionaryResolver.mjs +0 -2
- package/dist/hooks/external-store/useTrackedDictionaryResolver.mjs.map +0 -1
- package/dist/hooks/external-store/useTrackedTranslationResolver.d.ts +0 -10
- package/dist/hooks/external-store/useTrackedTranslationResolver.d.ts.map +0 -1
- package/dist/hooks/useTranslations.cjs +0 -2
- package/dist/hooks/useTranslations.cjs.map +0 -1
- package/dist/hooks/useTranslations.d.ts +0 -10
- package/dist/hooks/useTranslations.d.ts.map +0 -1
- package/dist/hooks/useTranslations.mjs +0 -2
- package/dist/hooks/useTranslations.mjs.map +0 -1
- package/dist/i18n-store/utils/dictionaries.cjs +0 -2
- package/dist/i18n-store/utils/dictionaries.cjs.map +0 -1
- package/dist/i18n-store/utils/dictionaries.mjs +0 -2
- package/dist/i18n-store/utils/dictionaries.mjs.map +0 -1
- package/dist/setup/cookieNames.d.ts +0 -2
- package/dist/setup/cookieNames.mjs +0 -1
- package/dist/utils/rendering/renderPipeline.cjs +0 -2
- package/dist/utils/rendering/renderPipeline.cjs.map +0 -1
- package/dist/utils/rendering/renderPipeline.mjs +0 -2
- package/dist/utils/rendering/renderPipeline.mjs.map +0 -1
- package/dist/utils/variables/getVariableName.cjs +0 -2
- package/dist/utils/variables/getVariableName.cjs.map +0 -1
- package/dist/utils/variables/getVariableName.mjs +0 -2
- package/dist/utils/variables/getVariableName.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,311 @@
|
|
|
1
1
|
# @generaltranslation/react-core
|
|
2
2
|
|
|
3
|
+
## 12.0.0-samsara.10
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- cdee423: `<Num>`, `<Currency>`, `<DateTime>`, `<RelativeTime>`, `<Plural>` and translated `<T>` content format in the locale they render in, alone. The default locale is no longer tried behind it when `Intl` has no data for that locale, which then formats in the browser's or the host's locale.
|
|
8
|
+
|
|
9
|
+
The `locales` prop reaches `Intl` as it is given: the active locale and the default locale are no longer added after it. To keep a fallback, list it: `<Num locales={[locale, defaultLocale]}>`.
|
|
10
|
+
|
|
11
|
+
- 5cb51b4: **Breaking:** `<Plural>` and `<Branch>` now choose a branch the way `plural()` and `select()` do, in React, Vue and Svelte.
|
|
12
|
+
- **ICU plural selection.** `<Plural>` picks an exact branch first, then the locale's plural category for `n`, then its children. `zero`, `one` and `two` are plural categories, no longer the numbers 0, 1 and 2: in English `zero` never matches, and in Japanese neither does `one`. For an exact number write `_0`, `_1` and so on, the JSX spelling of ICU's `=0`: `<Plural n={count} _0="No items" one="1 item">Many items</Plural>`. Stored content and translations use the ICU key, `=0`.
|
|
13
|
+
- **No aliases.** The `singular`, `plural` and `dual` branches are removed: write `one`, the children and `two`. `PluralType` from `generaltranslation` no longer includes them.
|
|
14
|
+
- **The children are the fallback, and `other` is not a prop.** The children of a `<Plural>` or a `<Branch>` are what `other` is in `plural()` and `select()`: the content for a value with no branch of its own. In Vue that is the default slot. `<Plural other="...">` no longer works, and `<Branch other="...">`, which used to match only the value `"other"`, no longer does: write the content as the children. `gt`, the compiler and the Vue and Svelte extractors report an `other` prop, slot or snippet as an error. Stored content and translations hold the children under the ICU key `other`, with the other branches. `gt` and the compiler also warn about a `<Plural>` prop that looks like an exact number but is not one, such as `_01` or `_1e3`.
|
|
15
|
+
- **Stricter props.** `<Plural>` requires children, takes `n` as a `number` or a `bigint`, and no longer has a `locales` prop, so in Vue a `locales` attribute is a branch like any other. `<Branch>` requires children unless its branches cover every value of `branch`, as in `<Branch branch={isAdmin} true="Admin" false="Member" />`. `_locale` and `_enableI18n` are no longer in the prop types of `<Plural>` and `<Branch>`. `gt-react` exports the `BranchProps` type beside `PluralProps`.
|
|
16
|
+
- **The translation picks the branch.** In a translated locale, the branch is chosen among the translation's branches, and the source branch of the same name fills in its variables and elements; when the source has no branch of that name, its children do. A source `_0` branch no longer renders untranslated in a locale whose translation has no `=0` branch. A translation with no branch for the value renders the source: that element in React and Vue, the whole `<T>` in Svelte.
|
|
17
|
+
- **Errors.** In React, an `n` that is not a number or a bigint, and a value with no branch and no children, throw in development. In production they log an error; a non-numeric `n` renders the children, and a missing branch renders nothing. Children that are empty, such as `{null}`, are a fallback that renders nothing. A `bigint` too large to have a plural category throws a `RangeError` unless an exact branch matches it, as in `plural()`. In Svelte, a branch passed as `undefined` counts as absent, as in React.
|
|
18
|
+
- **Synchronous `<Branch>` in gt-next.** In a Server Component, gt-next's `<Branch>` is now gt-react's component and no longer an async wrapper around it: choosing a branch never needed the request's locale.
|
|
19
|
+
|
|
20
|
+
A `<T>` with a `<Plural>` or a `<Branch>` has new source content, so its hash changes and it is translated again: the children are stored as the `other` branch, and the elements and unnamed variables after them are numbered from the component, not from its children. `gt`, the compiler, the gt-next SWC plugin and the Vue and Svelte extractors all read the new props, so update them together with the runtime packages.
|
|
21
|
+
|
|
22
|
+
The `static-jsx` lint rule's fix writes `{x && "Active"}` as `<Branch branch={!!x} true="Active">{null}</Branch>`, since a `false` value needs a fallback, and a `null` alternative of a ternary the same way. A string that JSX text would not read back as written, such as `"&"` or `"a < b"`, is written in braces.
|
|
23
|
+
|
|
24
|
+
- c0f8d3d: **Breaking:** a variable in the content of a `<T>` is found by its id, and has a name only when its author gave it one. A variable component without a `name` used to get a generated one, such as `_gt_cost_2`.
|
|
25
|
+
|
|
26
|
+
```diff
|
|
27
|
+
- { "i": 2, "k": "_gt_cost_2", "v": "c" } // <Currency>
|
|
28
|
+
+ { "i": 2, "v": "c" }
|
|
29
|
+
|
|
30
|
+
{ "i": 3, "k": "price", "v": "c" } // <Currency name="price">, unchanged
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- `i` identifies a variable among its siblings, as it does an element. The runtimes match a translated variable to its value by `i`, so two variables with the same `name` no longer render the same value.
|
|
34
|
+
- `v`, the type, is always there, and is how a variable is told from an element. `Variable` in `@generaltranslation/format` is now `{ i: number; v: VariableType; k?: string }`.
|
|
35
|
+
- `k` is only a label for translators. An empty `name` counts as none, in every runtime and extractor.
|
|
36
|
+
- `hashSource` hashes a variable by its `v` and, when it has one, its `k`.
|
|
37
|
+
|
|
38
|
+
Every `<T>` that holds a `<Var>`, `<Num>`, `<Currency>`, `<DateTime>` or `<RelativeTime>` without a `name` gets a new hash. The runtimes, `gt`, the compiler, the Next.js SWC plugin and the Vue and Svelte extractors all write the new form, so upgrade them together, then run `gt translate` again. Translations stored under the old hashes are no longer found, and a translated variable needs its `i`: local translation files need their keys and variables updated or regenerated. A `<T>` whose variables all have a `name`, or that has no variables, keeps its hash.
|
|
39
|
+
|
|
40
|
+
gt-svelte's `_gtm` metadata no longer lists variable names.
|
|
41
|
+
|
|
42
|
+
- b078069: The variable components `<Num>`, `<Currency>`, `<DateTime>` and `<RelativeTime>` take the same values and format the same way as `number()`, `date()` and `time()` in a `` t`…` `` message. In gt-vue and gt-svelte the value is the `value` prop where gt-react takes children.
|
|
43
|
+
- `<Currency>` requires `currency`; it no longer defaults to `USD`: `<Currency>{price}</Currency>` → `<Currency currency="USD">{price}</Currency>`.
|
|
44
|
+
- `<Num>` and `<Currency>` take a `number` or a `bigint`, not a string: `<Num>1000</Num>` → `<Num>{1000}</Num>`, `<Num>{text}</Num>` → `<Num>{Number(text)}</Num>`. gt-vue no longer renders text that is not a number as it is.
|
|
45
|
+
- `<DateTime>` takes a `Date` or a timestamp, not a string: in gt-vue, `<DateTime value="2024-01-01" />` → `<DateTime :value="new Date('2024-01-01')" />`.
|
|
46
|
+
- `<DateTime>` without a style or a date or time field in `options` formats in the medium date style, like `date(value)`: `Mar 14, 2024`, not `3/14/2024`. For the old output, pass `options={{ year: 'numeric', month: 'numeric', day: 'numeric' }}`.
|
|
47
|
+
- `<DateTime>` keeps the direction marks of the formatted date, which it removed. The Arabic `14/3/2024` holds two right-to-left marks that keep its parts in order inside left-to-right text.
|
|
48
|
+
- `<RelativeTime>` takes the date as children, like `<DateTime>`, and no longer has the `date` prop: `<RelativeTime date={date} />` → `<RelativeTime>{date}</RelativeTime>`. A count still takes `value` and `unit`.
|
|
49
|
+
- The `currency` prop of `<Currency>` wins over `options.currency`.
|
|
50
|
+
- The `locales` prop is removed from `<Num>`, `<Currency>`, `<DateTime>`, `<RelativeTime>` and gt-react's `<Plural>`. They format in the current locale, then the default locale. To format in another locale, call a formatter: `<Num locales={['de']}>{n}</Num>` → `{formatNum(n, { locales: ['de'] })}` with `formatNum` from `generaltranslation`, wrapped in `<Var>` inside a `<T>`.
|
|
51
|
+
- `useFormatLocales()` takes no argument and returns the current locale, then the default locale: `useFormatLocales(['de'])` → `useFormatLocales()`. `getFormatLocales()` from `@generaltranslation/react-core/pure` no longer takes `localesProp`.
|
|
52
|
+
- The prop types `NumProps`, `CurrencyProps`, `DateTimeProps` and `RelativeTimeProps`, and the props of `<Var>`, no longer have the internal `_locale` and `_enableI18n`; the `Resolved…Props` types still do.
|
|
53
|
+
|
|
54
|
+
`formatNum()` and `formatCurrency()` from `generaltranslation` and `@generaltranslation/format` accept a `bigint`, and `formatDateTime()` accepts a timestamp, as do the `GTIntl` methods.
|
|
55
|
+
|
|
56
|
+
- ac272be: `t()` from `@generaltranslation/react-core/pure` and `gt-react` now reports every call outside a client-rendered (SPA) app, not only calls made before GT has a locale: in development it throws, and in production it logs the error and renders the source with its variables. Before, in production it logged a promise to fall back and then threw "Cannot read GT runtime context", and calls after `<GTProvider>` mounted were not reported. `t` from `/unstable` reports the same error. In a server-rendered app, use `useGT()` in components, `getGT()` in loaders and server functions, or `msg()` with `m()` from `useMessages()` or `getMessages()`.
|
|
57
|
+
- 99a2528: Tidy the `<T>` props and the `/unstable` type exports:
|
|
58
|
+
- `<T>` no longer declares or reads the internal props `_locale`, `_enableI18n`, and `_renderPreparedT`; it always renders in the locale from context. The RSC `T` and `Tx` from `@generaltranslation/react-core/components-rsc` still take them, and gt-next passes them there.
|
|
59
|
+
- `gt-i18n/unstable` and the framework `/unstable` entries export the type of a `` part`...` `` value as `Part` instead of `Fragment`, which collided with React's `Fragment`.
|
|
60
|
+
|
|
61
|
+
### Minor Changes
|
|
62
|
+
|
|
63
|
+
- 28a2e47: Add an experimental global `m` to `/unstable` entries, the `useMessages()` counterpart of `t`: ``m(msg`Hello, ${{ name }}!`)`` renders a message from `msg()` with the current locale, without calling a hook. `gt-i18n/unstable` exports an `m` bound to the condition store. `@generaltranslation/react-core/unstable` and `gt-react/unstable` export an `m` that, like `t`, works only in client-rendered (SPA) apps, including at module level. In server-rendered apps, it throws in development and logs an error and renders the source in production; use `useMessages()` or `getMessages()` instead. Server components and `gt-react-native/unstable` do not export it, for the same reasons as `t`.
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- 550e8ca: A `<T>` whose props stay the same no longer prepares its children and subscribes to its translation again on every render. In a client-rendered app without a provider, the function `useGT()` returns keeps its identity between renders, so effects that depend on it no longer run after each one.
|
|
68
|
+
- Updated dependencies [2c3f4f6]
|
|
69
|
+
- Updated dependencies [2c3f4f6]
|
|
70
|
+
- Updated dependencies [cdee423]
|
|
71
|
+
- Updated dependencies [c30676f]
|
|
72
|
+
- Updated dependencies [5e95a50]
|
|
73
|
+
- Updated dependencies [cdee423]
|
|
74
|
+
- Updated dependencies [550e8ca]
|
|
75
|
+
- Updated dependencies [550e8ca]
|
|
76
|
+
- Updated dependencies [5cb51b4]
|
|
77
|
+
- Updated dependencies [c0f8d3d]
|
|
78
|
+
- Updated dependencies [b078069]
|
|
79
|
+
- Updated dependencies [7d49a34]
|
|
80
|
+
- Updated dependencies [99a2528]
|
|
81
|
+
- Updated dependencies [28a2e47]
|
|
82
|
+
- generaltranslation@10.0.0-samsara.10
|
|
83
|
+
- @generaltranslation/format@1.0.0-samsara.10
|
|
84
|
+
- gt-i18n@2.0.0-samsara.10
|
|
85
|
+
|
|
86
|
+
## 12.0.0-samsara.9
|
|
87
|
+
|
|
88
|
+
### Major Changes
|
|
89
|
+
|
|
90
|
+
- 016ace7: Remove the `devApiKey` option. One `apiKey` now covers both uses: in development it enables hot reload translation, and in production it lets server code translate at runtime. Pass your key as `apiKey` wherever you passed `devApiKey`, for example `initializeGT({ apiKey })` in gt-node.
|
|
91
|
+
|
|
92
|
+
gt-react ignores an `apiKey` that reaches production browser code and logs a warning, because anyone can read a key from a browser bundle. Translate at runtime on your server instead.
|
|
93
|
+
|
|
94
|
+
- cf7029c: Move the dictionary (key-based) API to `/compat` subpaths. `useTranslations()`, `getTranslations()`, `initializeGTDictionary()` and the `Dictionary*` types now come from `gt-react/compat`, `gt-react-native/compat`, `gt-next/compat` (its export conditions mirror `gt-next`), `gt-next/compat/server` (server-only `getTranslations()`, like `gt-next/server`) and `gt-tanstack-start/compat`. The old exports are removed without stubs, the root `GTProvider` no longer accepts `dictionaries`, `onMissingDictionaryEntry` or `onMissingDictionaryObj`, and `initializeGT()`/`initializeGTSPA()` no longer accept `dictionary` or `loadDictionary`.
|
|
95
|
+
|
|
96
|
+
Each `/compat` entry exports its own `GTProvider`, which takes everything the root `GTProvider` takes plus those dictionary props, so moving the provider changes only its import. `useTranslations()` reads dictionaries only from it and, under the root `GTProvider`, throws an error that names the `/compat` entry. `initializeGTDictionary()` takes `cacheExpiryTime` like `initializeGT()` and no longer inherits it. In gt-next, the App Router `GTProvider` from `gt-next/compat` also loads the request locale's dictionaries and streams them to client components, as `GTProvider` did; in the Pages Router, `withGTServerSideProps()` and `withGTStaticProps()` from `gt-next/compat` add `dictionaries` to page props for it. In gt-tanstack-start, `setupRouterGTIntegration({ router })` from `gt-tanstack-start/compat` also loads the request locale's dictionary before render and hydrates the browser from that snapshot. Dictionary dev hot reload keeps working.
|
|
97
|
+
|
|
98
|
+
Apps that only use the native APIs no longer ship any dictionary code. gt-next requires the `gt-next/internal/_dictionary` and `_load-dictionary` aliases only from `gt-next/compat` modules, and the gt-tanstack-start Vite plugin serves the dictionary from its own `internal/_compat-config` virtual module, so your dictionary file is bundled only when you import a `/compat` entry. The webpack rule that parses gt-next's ESM dist as `javascript/auto` now detects the dist through `internal/_load-translations.mjs`. The `dictionary` and `loadDictionaryPath` options of `withGTConfig()`, `gt.config.json` and the Vite plugin are unchanged. gt-next no longer treats a `[defaultLocale].json` or `[languageCode].json` file (for example `en.json`) as the dictionary; name the file `dictionary.json` or set the `dictionary` option.
|
|
99
|
+
|
|
100
|
+
`@generaltranslation/react-core` keeps the dictionary internals behind `@generaltranslation/react-core/compat`: `InternalGTProvider` no longer accepts `dictionaries` or `onMissingDictionary*`, `internalInitializeGTSRA()` no longer accepts `dictionary` or `loadDictionary`, and the unused legacy `Dictionary` types are removed. The gt-next `GTProvider` type no longer declares the unused `id` prop.
|
|
101
|
+
|
|
102
|
+
Migration:
|
|
103
|
+
|
|
104
|
+
| Before | After |
|
|
105
|
+
| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
106
|
+
| `import { useTranslations } from 'gt-react'` | `import { useTranslations } from 'gt-react/compat'` |
|
|
107
|
+
| `import { GTProvider } from 'gt-react'` with `dictionaries`, `onMissingDictionaryEntry` or `onMissingDictionaryObj` | `import { GTProvider } from 'gt-react/compat'`, which takes the same props |
|
|
108
|
+
| `initializeGT({ …, dictionary, loadDictionary })`, `initializeGTSPA({ …, dictionary, loadDictionary })` (gt-react) | `initializeGT({ … })` / `initializeGTSPA({ … })`, then `initializeGTDictionary({ dictionary, loadDictionary, cacheExpiryTime })` from `gt-react/compat`. Pass the `cacheExpiryTime` the dictionaries used before: the one you pass to `initializeGT()`, or `null` where `initializeGT()` defaulted it to `null` (gt-react's browser `initializeGT()`); without it, loaded dictionaries expire after the default 60 seconds |
|
|
109
|
+
| `import { useTranslations } from 'gt-react-native'` | `import { useTranslations } from 'gt-react-native/compat'` |
|
|
110
|
+
| `<GTProvider dictionaries={…}>`, `initializeGT({ …, dictionary, loadDictionary })` (gt-react-native) | `GTProvider` and `initializeGTDictionary({ dictionary, loadDictionary, cacheExpiryTime })` from `gt-react-native/compat`, with the `cacheExpiryTime` you pass to `initializeGT()` |
|
|
111
|
+
| `import { useTranslations } from 'gt-next'` | `import { useTranslations } from 'gt-next/compat'` |
|
|
112
|
+
| `import { getTranslations } from 'gt-next/server'` | `import { getTranslations } from 'gt-next/compat/server'` |
|
|
113
|
+
| gt-next `GTProvider` streamed dictionaries to client components | import `GTProvider` from `gt-next/compat`. In the Pages Router, also import `withGTServerSideProps` / `withGTStaticProps` from `gt-next/compat`, which add `dictionaries` to page props |
|
|
114
|
+
| `import { useTranslations, getTranslations } from 'gt-tanstack-start'` | `import { useTranslations, getTranslations } from 'gt-tanstack-start/compat'`, and import `setupRouterGTIntegration` from `gt-tanstack-start/compat` instead of `gt-tanstack-start` |
|
|
115
|
+
|
|
116
|
+
- 943c094: `@generaltranslation/react-core/pure` no longer re-exports names that `gt-i18n`, `generaltranslation`, or `@generaltranslation/format` own. Import them from their owner:
|
|
117
|
+
- `msg`, `decodeMsg`, `decodeOptions`, `mFallback`, `gtFallback`, `getDefaultLocale`, `getLocaleProperties`, `getLocales`, `resolveCanonicalLocale`, `getVersionId`: import from `gt-i18n`.
|
|
118
|
+
- `derive`, `declareVar`, `decodeVars`: import from `generaltranslation` (or `gt-i18n`).
|
|
119
|
+
- `ReadonlyConditionStore`: import from `gt-i18n/internal`.
|
|
120
|
+
- `defaultLocaleCookieName`, `defaultRegionCookieName`, `defaultEnableI18nCookieName`, `defaultResetLocaleCookieName`: import from `gt-i18n/internal/cookies`.
|
|
121
|
+
- Types `GTTranslationOptions`, `GTFunctionType`, `MFunctionType`, `RuntimeTranslationOptions`: import from `gt-i18n`.
|
|
122
|
+
- Type `GTProp`: import from `@generaltranslation/format`.
|
|
123
|
+
|
|
124
|
+
`@generaltranslation/react-core/unstable` now exports only `t`, `useGT`, and `useMessages`. Import the message helpers (`msg`, `mFallback`, `derive`, `plural`, `select`, `selectordinal`, `part`, `number`, `n`, `date`) and their types from `gt-i18n/unstable`.
|
|
125
|
+
|
|
126
|
+
`gt-react`, `gt-react-native`, `gt-next`, and `gt-tanstack-start` still export the same user-facing names.
|
|
127
|
+
|
|
128
|
+
- 943c094: Each name is now exported from one entry:
|
|
129
|
+
- `@generaltranslation/react-core/components-rsc` no longer re-exports what `@generaltranslation/react-core/pure` exports: `t`, `getTranslationsSnapshot`, `getFormatLocales`, `createRenderPipeline`, `RenderPipeline`, `getReactI18nCache`, `setReactI18nCache`, `internalInitializeGTSRA`, `getReadonlyConditionStore`, `RelativeTimeFormatOptions` and `RenderVariable`. Import them from `@generaltranslation/react-core/pure`.
|
|
130
|
+
- `I18nStore` is no longer exported from `@generaltranslation/react-core/components`. Import it from `@generaltranslation/react-core/pure`.
|
|
131
|
+
|
|
132
|
+
- 13dae8a: Remove the remaining backward compatibility:
|
|
133
|
+
- `<T>` no longer reads `$context`, `$id`, `$maxChars`, `$requiresReview`, `$format`, or `$_hash`; use `context`, `id`, `maxChars`, `requiresReview`.
|
|
134
|
+
- `<LocaleSelector>` drops `customNames`; use `customMapping={{ [locale]: { name } }}`.
|
|
135
|
+
- gt-next: `parseLocale()` no longer detects the locale from request headers, cookies, or `Accept-Language` when Next.js provides none; it uses Next.js `defaultLocale` (or the GT default) and warns, like `withGTStaticProps`. Configure Next.js `i18n`.
|
|
136
|
+
- gt-next and gt-tanstack-start: `experimentalCompilerOptions.compileTimeHash: false` no longer switches the compiler off; use `experimentalCompilerOptions.type: 'none'`.
|
|
137
|
+
- gt-next: runtime translation requests no longer send `projectId`, `timeout`, `publish`, `fast`, or `sourceLocale` in request `metadata`.
|
|
138
|
+
- gt-react-native: locale detection drops the fallbacks for unsupported runtimes (Android < 24 and Internet Explorer's `navigator.userLanguage`).
|
|
139
|
+
|
|
140
|
+
### Patch Changes
|
|
141
|
+
|
|
142
|
+
- 96f428a: Remove duplicate and unused type exports.
|
|
143
|
+
- `import type { UseTranslationsFunction } from 'gt-react/compat'` (also `gt-react-native/compat` and `gt-tanstack-start/compat`): use `TFunctionType` from the same entry. From `gt-next/compat`, use `TFunctionType` from `gt-next/compat/server`; from `@generaltranslation/react-core/compat`, use `TFunctionType` from `gt-i18n/internal/compat`.
|
|
144
|
+
- `@generaltranslation/react-core/pure` no longer exports the `OnMissingTranslation` and `VariableProps` types.
|
|
145
|
+
- `@generaltranslation/react-core/components-rsc` no longer exports the `RenderDefaultChildrenArgs`, `RenderPreparedTParams` and `RenderTranslatedChildrenArgs` types.
|
|
146
|
+
- `I18nCacheConfig` from `gt-i18n/internal` no longer has `projectId`, `apiKey` and `runtimeUrl`; `I18nCache` never read them.
|
|
147
|
+
|
|
148
|
+
- cf7029c: Move the dictionary (compat) internals to their own internal subpaths, `gt-i18n/internal/compat` and `@generaltranslation/react-core/compat`, so CommonJS builds of the native entries no longer load the dictionary runtime. `gt-i18n/internal` and `@generaltranslation/react-core/{pure,hooks,components}` no longer export it. No public API change.
|
|
149
|
+
- 63b6748: `withGTConfig()` props, `createNextMiddleware()` options and `RenderMethod` now take their types from the `gt.config.json` schemas: the shared keys from `GTConfig`, and gt-next's routing keys (`pathConfig`, `pathRegex`, `prefixDefaultLocale` and the others) from gt-next's own schema, so they match what `gt.config.json` accepts. No behavior changes.
|
|
150
|
+
- 82999f0: Remove the internal `setup/cookieNames` pass-through and other internal re-exports.
|
|
151
|
+
- ea429a2: `@generaltranslation/react-core/pure` exports the `RenderMethod` type. `RegionSelectorProps` now derives its region options from `InternalRegionSelectorOptions`; the accepted props are unchanged.
|
|
152
|
+
- 2d7f9bd: Remove runtime checks that TypeScript already guarantees and duplicated locale resolution. gt-react's browser condition store now resolves the locale once on initialization and server updates, and gt-vue's `initializeGTSPA()` builds its locale matcher once instead of on every lookup. Translation hashes do not change.
|
|
153
|
+
|
|
154
|
+
Two observable changes:
|
|
155
|
+
- `generaltranslation`: runtime translation results from the General Translation API are no longer shape-checked on the client; their type comes from the generated API client. A successful result whose `translation` did not match its `dataFormat` used to become `{ success: false, error: 'Invalid translation returned', code: 500 }`; it is now returned as the service sent it. Failed requests, missing entries (`'No translation returned'`) and network errors behave as before.
|
|
156
|
+
- `gt-tanstack-start`: request locales are now resolved against the configuration that `initializeGT()` already loaded, instead of a copy rebuilt on every request. That configuration always includes `defaultLocale` among the supported locales, so with `defaultLocale: 'en'`, `locales: ['fr']` and `Accept-Language: en, fr`, the request locale is now `en` (previously `fr`), matching path-based locale detection.
|
|
157
|
+
|
|
158
|
+
- 44a3832: - gt-vue's `<Num>`, `<Currency>` and `<DateTime>` format through `generaltranslation`'s formatters, as gt-react's do. They reuse one `Intl` formatter per locale and options, where they built a new one on every render, and they print what gt-react prints: Latin digits and the Gregorian calendar, so `<Num :value="1234.5"/>` in `ar-EG` is `1,234.5`, not `١٬٢٣٤٫٥`. A `<DateTime>` without a `timeZone` is still in the host's.
|
|
159
|
+
- The region selector builds one `Intl.Collator` to sort its regions, not one per comparison.
|
|
160
|
+
- Updated dependencies [96f428a]
|
|
161
|
+
- Updated dependencies [96f428a]
|
|
162
|
+
- Updated dependencies [cf7029c]
|
|
163
|
+
- Updated dependencies [2d7f9bd]
|
|
164
|
+
- Updated dependencies [ba09ee2]
|
|
165
|
+
- Updated dependencies [ba09ee2]
|
|
166
|
+
- Updated dependencies [63b6748]
|
|
167
|
+
- Updated dependencies [ea429a2]
|
|
168
|
+
- Updated dependencies [82999f0]
|
|
169
|
+
- Updated dependencies [ba09ee2]
|
|
170
|
+
- Updated dependencies [ba09ee2]
|
|
171
|
+
- Updated dependencies [943c094]
|
|
172
|
+
- Updated dependencies [016ace7]
|
|
173
|
+
- Updated dependencies [ba09ee2]
|
|
174
|
+
- Updated dependencies [82999f0]
|
|
175
|
+
- Updated dependencies [96f428a]
|
|
176
|
+
- Updated dependencies [3832c15]
|
|
177
|
+
- Updated dependencies [2d7f9bd]
|
|
178
|
+
- Updated dependencies [943c094]
|
|
179
|
+
- Updated dependencies [cf7029c]
|
|
180
|
+
- Updated dependencies [82999f0]
|
|
181
|
+
- Updated dependencies [63b6748]
|
|
182
|
+
- Updated dependencies [13dae8a]
|
|
183
|
+
- Updated dependencies [2d7f9bd]
|
|
184
|
+
- Updated dependencies [943c094]
|
|
185
|
+
- Updated dependencies [a191c9a]
|
|
186
|
+
- Updated dependencies [2d7f9bd]
|
|
187
|
+
- Updated dependencies [1a5e9ae]
|
|
188
|
+
- Updated dependencies [e29f6f9]
|
|
189
|
+
- generaltranslation@10.0.0-samsara.9
|
|
190
|
+
- gt-i18n@2.0.0-samsara.9
|
|
191
|
+
- @generaltranslation/format@1.0.0-samsara.9
|
|
192
|
+
|
|
193
|
+
## 12.0.0-samsara.8
|
|
194
|
+
|
|
195
|
+
### Patch Changes
|
|
196
|
+
|
|
197
|
+
- generaltranslation@10.0.0-samsara.8
|
|
198
|
+
- @generaltranslation/format@1.0.0-samsara.8
|
|
199
|
+
- gt-i18n@2.0.0-samsara.8
|
|
200
|
+
|
|
201
|
+
## 12.0.0-samsara.7
|
|
202
|
+
|
|
203
|
+
### Patch Changes
|
|
204
|
+
|
|
205
|
+
- Updated dependencies [27c26cd]
|
|
206
|
+
- Updated dependencies [27c26cd]
|
|
207
|
+
- gt-i18n@2.0.0-samsara.7
|
|
208
|
+
- @generaltranslation/format@1.0.0-samsara.7
|
|
209
|
+
- generaltranslation@10.0.0-samsara.7
|
|
210
|
+
|
|
211
|
+
## 12.0.0-samsara.6
|
|
212
|
+
|
|
213
|
+
### Minor Changes
|
|
214
|
+
|
|
215
|
+
- f88a4dc: Rename the `message` field of translation lookups to `content`, to match `GLOSSARY.md`: it holds content in any data format, JSX and message trees included, not only string messages. No behavior changes.
|
|
216
|
+
- `gt-i18n/internal`: the variant of `TranslateListenerLookup` that carries the source is `{ locale, content, options }`; the `{ locale, hash }` variant is unchanged. The entries passed to a lookup's `prefetchEntries` are `{ content, options }`.
|
|
217
|
+
- `@generaltranslation/react-core`: `TranslateLookup` is `{ locale, content, options }`.
|
|
218
|
+
|
|
219
|
+
`RegisteredMessage.message` is unchanged: it is a string message.
|
|
220
|
+
|
|
221
|
+
### Patch Changes
|
|
222
|
+
|
|
223
|
+
- ada6894: Rename three names to match `GLOSSARY.md`. No behavior changes.
|
|
224
|
+
- The `Message` type in `gt-i18n/types`, a string message with its metadata as passed to `getGT()` and `useGT()`, is now `RegisteredMessage`. `Message` is left to mean a message tree and its formats.
|
|
225
|
+
- `hashMessage` in `gt-i18n/internal` is now `hashContent`: it hashes content in any data format, JSX included.
|
|
226
|
+
- `LocaleConfig.formatMessageTree()` takes the data for its variables as `values`, not `variables`, as `formatMessageTree` does everywhere else. This also applies to `LocaleConfig` in `generaltranslation` and `I18nConfig` in `gt-i18n`.
|
|
227
|
+
|
|
228
|
+
- 067e175: `gt-next` and `@generaltranslation/react-core` use `RegisteredMessage` from `gt-i18n/types` instead of declaring their own copies. The copy in `gt-next` had fallen behind, so the messages passed to its `useGT()` and `useMessages()` now also accept `$format`, `$locale` and `$requiresReview`.
|
|
229
|
+
- Updated dependencies [6440bd1]
|
|
230
|
+
- Updated dependencies [f88a4dc]
|
|
231
|
+
- Updated dependencies [8dde4bb]
|
|
232
|
+
- Updated dependencies [ada6894]
|
|
233
|
+
- @generaltranslation/format@1.0.0-samsara.6
|
|
234
|
+
- generaltranslation@10.0.0-samsara.6
|
|
235
|
+
- gt-i18n@2.0.0-samsara.6
|
|
236
|
+
|
|
237
|
+
## 12.0.0-samsara.5
|
|
238
|
+
|
|
239
|
+
### Patch Changes
|
|
240
|
+
|
|
241
|
+
- Updated dependencies [886232a]
|
|
242
|
+
- generaltranslation@10.0.0-samsara.5
|
|
243
|
+
- @generaltranslation/format@1.0.0-samsara.5
|
|
244
|
+
- gt-i18n@2.0.0-samsara.5
|
|
245
|
+
|
|
246
|
+
## 12.0.0-samsara.4
|
|
247
|
+
|
|
248
|
+
### Minor Changes
|
|
249
|
+
|
|
250
|
+
- 7ef8d91: In the `/unstable` entries, `number()`, `date()` and the new `time()` split their options. Message options (`style`, `unit`, date and time fields) are part of the message and must be one literal. `date()` and `time()` name their style `style`, as `number()` does: `date({ due }, { style: 'medium' })` and `time({ start }, { style: 'short' })`, not Intl's `dateStyle` and `timeStyle`. Formatting context, such as `currency` or `timeZone`, may be any value and never changes the message's hash, so `currency: order.currency` is translated once; a `Msg` carries it in `formats`, which is `{}` when there is none. A `timeZone` in `gt.config.json`, `initializeGT()` or `withGTConfig()` sets the default time zone of every date and time formatted without one, in a message or in `<DateTime>`; the `GT` class takes the same `timeZone`. A message without placeholders is one string tree, so its hash changes once.
|
|
251
|
+
|
|
252
|
+
### Patch Changes
|
|
253
|
+
|
|
254
|
+
- Updated dependencies [7ef8d91]
|
|
255
|
+
- Updated dependencies [7ef8d91]
|
|
256
|
+
- Updated dependencies [3c013b5]
|
|
257
|
+
- @generaltranslation/format@1.0.0-samsara.4
|
|
258
|
+
- generaltranslation@10.0.0-samsara.4
|
|
259
|
+
- gt-i18n@2.0.0-samsara.4
|
|
260
|
+
|
|
261
|
+
## 12.0.0-samsara.3
|
|
262
|
+
|
|
263
|
+
### Patch Changes
|
|
264
|
+
|
|
265
|
+
- Updated dependencies [cf23e00]
|
|
266
|
+
- generaltranslation@10.0.0-samsara.3
|
|
267
|
+
- gt-i18n@2.0.0-samsara.3
|
|
268
|
+
|
|
269
|
+
## 12.0.0-samsara.2
|
|
270
|
+
|
|
271
|
+
### Patch Changes
|
|
272
|
+
|
|
273
|
+
- generaltranslation@10.0.0-samsara.2
|
|
274
|
+
- @generaltranslation/format@1.0.0-samsara.3
|
|
275
|
+
- gt-i18n@2.0.0-samsara.2
|
|
276
|
+
|
|
277
|
+
## 12.0.0-samsara.1
|
|
278
|
+
|
|
279
|
+
### Minor Changes
|
|
280
|
+
|
|
281
|
+
- c5275b4: Add experimental opt-in `/unstable` entries for tagged-template message trees from `gt-i18n/unstable`. Each entry exports the `plural`, `selectordinal`, `select`, `number`, `date`, `part`, and `derive` helpers, `n` for the plural count, and the `GT`, `GTOptions`, `Placeholder`, and `Fragment` types. The `t` tag is only for client-rendered (SPA) apps, so only `gt-react/unstable` and `@generaltranslation/react-core/unstable` export it; server-rendered apps use `useGT()` in components and `getGT()` on the server. Root entries are unchanged. `/unstable` entries may change in any minor release and are not covered by semver.
|
|
282
|
+
- `@generaltranslation/react-core/unstable`: `useGT()` returns a GT bound to the render locale. It reads translations like the legacy `useGT()`: the provider's translations, then the translation cache, and in dev hot reload it sends misses for runtime translation and re-renders when they arrive. `t` works only in client-rendered (SPA) apps, where module-level calls work too; in a server-rendered app every call throws in development and renders the source with an error in production. Messages render untranslated when i18n is disabled or the requested locale needs no translation.
|
|
283
|
+
- `gt-react/unstable` and `gt-react-native/unstable`: the react-core client surface, without `t` in React Native. `gt-react/unstable` resolves to an RSC variant under `react-server`, where `useGT()` waits for the request locale's translations and `t` is not exported.
|
|
284
|
+
- `gt-next/unstable` resolves under the same conditions as `gt-next` and exports `useGT()` instead of `t`. `gt-next/unstable/server` exports an async `getGT()` for the request locale.
|
|
285
|
+
- `gt-tanstack-start/unstable` adds an async `getGT()` bound to the request on the server and to the browser locale in the browser. It exports no `t`, since TanStack Start renders on the server.
|
|
286
|
+
- `gt-node/unstable`: an async `getGT()` for the current `withGT()` locale.
|
|
287
|
+
|
|
288
|
+
- 5ccf4ef: Add deferred messages to the `/unstable` entries. Each entry exports `msg`, `mFallback` and the `M` and `Msg` types from `gt-i18n/unstable`, plus an `m` beside each `GT`: `useMessages()` wherever `useGT()` is exported (react-core, gt-react, gt-react-native, gt-next and gt-tanstack-start, with the gt-react and gt-next RSC variants waiting for the request locale's translations), and an async `getMessages()` wherever `getGT()` is (`gt-next/unstable/server`, `gt-node/unstable` and `gt-tanstack-start/unstable`). ``m(msg`...`)`` renders the message in the bound locale like `useGT()` and `getGT()` do.
|
|
289
|
+
|
|
290
|
+
### Patch Changes
|
|
291
|
+
|
|
292
|
+
- cc73381: Add experimental `gt-i18n/unstable` and `gt-i18n/unstable/internal` entries. Their API may change in any minor release and is not covered by semver. `t` is a tagged template (`` t`Hello, ${{ name }}!` `` or `` t({ context })`Save` ``) that builds a message tree from the template, hashes it with `hashSource`, and formats loaded tree translations without the ICU string parser. Helpers `plural`, `selectordinal`, `select`, `number`, `date`, `part`, `derive`, and `n` are exported from `gt-i18n/unstable`; framework packages use `createGT` and `getGT` from `gt-i18n/unstable/internal`. Missing tree translations render the source message and, in dev hot reload, are sent for runtime translation like string and JSX messages. Template text is always literal, including ICU syntax such as `#`. A bare value (`` t`Hi ${name}` ``) is an anonymous variable and `${{ name }}` a named one; either renders like a template literal (`true` as `'true'`, `12n` as `'12'`, `null` and `undefined` as nothing), and a `Date` is a type error that points to `date()`; helpers take either form, as in `plural({ count }, ...)` or `plural(count, ...)`. Plural and select branches are strings, or `part` templates when they hold placeholders, and a plain template literal with values in a branch is a type error; `n` is the count of the nearest plural (`` part`${n} items` ``). `derive()` inlines static text chosen in code; its argument must be typed as a string literal or a union of them, so the CLI can read every variant from the type.
|
|
293
|
+
|
|
294
|
+
`Content` from `@generaltranslation/format/types` and `generaltranslation/types` replaces the `Translation` type, which `gt-i18n/types` no longer exports. Loaded catalogs, translation loaders, and the translations passed to React Core providers, gt-react-native's `LocaleTranslations`, and gt-svelte's `loadTranslations()` and `<GTProvider>` can hold message trees alongside string and JSX entries. Translation lookups and runtime translation take message trees with `$format: 'ICU_TREE'`, like any other format.
|
|
295
|
+
|
|
296
|
+
- 040ea63: From `main` (react-core 11.4.17): keep the `gt` function from `useGT()` (and the dictionary hooks built on the same dev hot reload queue) stable across renders in development, so effects that list it as a dependency no longer re-run after every render. Its identity still changes when a hot-reloaded translation arrives (#2554).
|
|
297
|
+
- Updated dependencies [22b6915]
|
|
298
|
+
- Updated dependencies [f3ed76d]
|
|
299
|
+
- Updated dependencies [4b6ea22]
|
|
300
|
+
- Updated dependencies [5ccf4ef]
|
|
301
|
+
- Updated dependencies [cc73381]
|
|
302
|
+
- Updated dependencies [726168a]
|
|
303
|
+
- Updated dependencies [040ea63]
|
|
304
|
+
- Updated dependencies [e6ef0c0]
|
|
305
|
+
- generaltranslation@10.0.0-samsara.1
|
|
306
|
+
- @generaltranslation/format@1.0.0-samsara.2
|
|
307
|
+
- gt-i18n@2.0.0-samsara.1
|
|
308
|
+
|
|
3
309
|
## 12.0.0-samsara.0
|
|
4
310
|
|
|
5
311
|
### Major Changes
|
|
@@ -17,6 +323,47 @@
|
|
|
17
323
|
- @generaltranslation/format@1.0.0-samsara.1
|
|
18
324
|
- gt-i18n@2.0.0-samsara.0
|
|
19
325
|
|
|
326
|
+
## 11.4.22
|
|
327
|
+
|
|
328
|
+
### Patch Changes
|
|
329
|
+
|
|
330
|
+
- Updated dependencies [[`7aae545`](https://github.com/generaltranslation/gt/commit/7aae545bd9e65148b8cbf98a4df3ce750ab1cdbf)]:
|
|
331
|
+
- @generaltranslation/format@0.1.10
|
|
332
|
+
- generaltranslation@9.5.12
|
|
333
|
+
- gt-i18n@1.0.43
|
|
334
|
+
|
|
335
|
+
## 11.4.21
|
|
336
|
+
|
|
337
|
+
## 11.4.20
|
|
338
|
+
|
|
339
|
+
### Patch Changes
|
|
340
|
+
|
|
341
|
+
- Updated dependencies [[`b3c3647`](https://github.com/generaltranslation/gt/commit/b3c3647239a6c44c3549e722b7001b83624865f8)]:
|
|
342
|
+
- generaltranslation@9.5.11
|
|
343
|
+
- gt-i18n@1.0.42
|
|
344
|
+
|
|
345
|
+
## 11.4.19
|
|
346
|
+
|
|
347
|
+
### Patch Changes
|
|
348
|
+
|
|
349
|
+
- Updated dependencies [[`e1c64a3`](https://github.com/generaltranslation/gt/commit/e1c64a3c27c7a05ffeb81eb2d04ace795d0c3ab5)]:
|
|
350
|
+
- generaltranslation@9.5.10
|
|
351
|
+
- gt-i18n@1.0.41
|
|
352
|
+
|
|
353
|
+
## 11.4.18
|
|
354
|
+
|
|
355
|
+
### Patch Changes
|
|
356
|
+
|
|
357
|
+
- Updated dependencies [[`c460193`](https://github.com/generaltranslation/gt/commit/c46019337dda8440a7174d783ad94a0f9b15f79a)]:
|
|
358
|
+
- generaltranslation@9.5.9
|
|
359
|
+
- gt-i18n@1.0.40
|
|
360
|
+
|
|
361
|
+
## 11.4.17
|
|
362
|
+
|
|
363
|
+
### Patch Changes
|
|
364
|
+
|
|
365
|
+
- [#2554](https://github.com/generaltranslation/gt/pull/2554) [`a9c1e61`](https://github.com/generaltranslation/gt/commit/a9c1e61c523951637ef0e480e0f6200fd2426643) Thanks [@dyc3](https://github.com/dyc3)! - Keep the `gt` function from `useGT()` (and the dictionary hooks built on the same dev hot reload queue) stable across renders in development, so effects that list it as a dependency no longer re-run after every render. Its identity still changes when a hot-reloaded translation arrives, so memoized and effect-derived strings pick up the new translation.
|
|
366
|
+
|
|
20
367
|
## 11.4.16
|
|
21
368
|
|
|
22
369
|
### Patch Changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../i18n-store/utils/subscriptions.cjs`),t=require(`../i18n-store/utils/runtimeTranslationErrors.cjs`),n=require(`./dictionaries.cjs`);let r=require(`gt-i18n/internal/compat`);function i(){return(0,r.isDictionaryManagerInitialized)()||(0,r.initializeDictionaryManager)({cacheExpiryTime:null}),(0,r.getDictionaryManager)()}function a(){return(0,r.isDictionaryManagerInitialized)()?(0,r.getDictionaryManager)():void 0}var o=class{dictionaryEntryListeners=new Set;dictionaryObjectListeners=new Set;logRuntimeTranslationError=t.createRuntimeTranslationErrorLogger();updateDictionaries=e=>{Object.keys(e).length!==0&&i().updateDictionaries(e)};translateDictionaryEntry=e=>{a()?.lookupDictionaryWithFallback(e.locale,e.id).then(()=>{this.emitDictionaryEvent(e)}).catch(e=>this.logRuntimeTranslationError(e))};translateDictionaryObject=e=>{a()?.lookupDictionaryObjWithFallback(e.locale,e.id).then(()=>{this.emitDictionaryEvent(e)}).catch(e=>this.logRuntimeTranslationError(e))};subscribeToDictionaryEntryEvents=t=>e.subscribeToSet(this.dictionaryEntryListeners,t);subscribeToDictionaryObjectEvents=t=>e.subscribeToSet(this.dictionaryObjectListeners,t);getDictionaryEntrySnapshot=(e,t)=>n.lookupDictionaryEntry(t,e)??a()?.lookupDictionary(e.locale,e.id);getDictionaryObjectSnapshot=(e,t)=>n.lookupDictionaryObject(t,e)??a()?.lookupDictionaryObj(e.locale,e.id);emitDictionaryEvent(e){this.dictionaryEntryListeners.forEach(t=>t(e)),this.dictionaryObjectListeners.forEach(t=>{t(e)})}};exports.CompatStore=o;
|
|
2
|
+
//# sourceMappingURL=CompatStore.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompatStore.cjs","names":["createRuntimeTranslationErrorLogger","subscribeToSet","lookupDictionaryEntry","lookupDictionaryObject"],"sources":["../../src/compat/CompatStore.ts"],"sourcesContent":["import type { Locale } from 'gt-i18n/internal';\nimport {\n getDictionaryManager,\n initializeDictionaryManager,\n isDictionaryManagerInitialized,\n type Dictionary,\n} from 'gt-i18n/internal/compat';\nimport type { Unsubscribe } from '../i18n-store/storeTypes';\nimport { subscribeToSet } from '../i18n-store/utils/subscriptions';\nimport { createRuntimeTranslationErrorLogger } from '../i18n-store/utils/runtimeTranslationErrors';\nimport { lookupDictionaryEntry, lookupDictionaryObject } from './dictionaries';\nimport type {\n DictionaryEntrySnapshot,\n DictionaryLookup,\n DictionaryObjectSnapshot,\n DictionaryStoreListener,\n} from './types';\n\n/**\n * Runtimes that only receive dictionaries through provider snapshots (such as\n * the gt-next client) never initialize a DictionaryManager. Create one without\n * a loader; its entries cannot be refreshed, so they never expire.\n */\nfunction getOrCreateDictionaryManager() {\n if (!isDictionaryManagerInitialized()) {\n initializeDictionaryManager({ cacheExpiryTime: null });\n }\n return getDictionaryManager();\n}\n\n/**\n * Render-time reads and server-side translations must not create a manager:\n * an empty one would stop gt-next from seeding the bundled dictionary later.\n * Only updateDictionaries() (a client effect) creates one.\n */\nfunction getExistingDictionaryManager() {\n return isDictionaryManagerInitialized() ? getDictionaryManager() : undefined;\n}\n\n/**\n * Dictionary counterpart of I18nStore: syncs DictionaryManager updates with\n * renders and drives dictionary dev hot reload.\n */\nexport class CompatStore {\n // ----- Listener Sets ----- //\n\n private dictionaryEntryListeners = new Set<DictionaryStoreListener>();\n private dictionaryObjectListeners = new Set<DictionaryStoreListener>();\n private logRuntimeTranslationError = createRuntimeTranslationErrorLogger();\n\n // ========== Dictionary Updates ========== //\n\n updateDictionaries = (dictionaries: Record<Locale, Dictionary>): void => {\n if (Object.keys(dictionaries).length === 0) return;\n getOrCreateDictionaryManager().updateDictionaries(dictionaries);\n };\n\n // ========== runtime translation ========== //\n\n translateDictionaryEntry = (lookup: DictionaryLookup): void => {\n // Without a manager there is no source dictionary to translate from.\n getExistingDictionaryManager()\n ?.lookupDictionaryWithFallback(lookup.locale, lookup.id)\n .then(() => {\n this.emitDictionaryEvent(lookup);\n })\n .catch((error) => this.logRuntimeTranslationError(error));\n };\n\n translateDictionaryObject = (lookup: DictionaryLookup): void => {\n getExistingDictionaryManager()\n ?.lookupDictionaryObjWithFallback(lookup.locale, lookup.id)\n .then(() => {\n this.emitDictionaryEvent(lookup);\n })\n .catch((error) => this.logRuntimeTranslationError(error));\n };\n\n // ========== UseSyncExternalStore ========== //\n\n // ----- Subscriptions ----- //\n\n // Keep subscription methods as arrow fields so hooks can pass them by\n // reference without losing access to this store instance.\n subscribeToDictionaryEntryEvents = (\n listener: DictionaryStoreListener\n ): Unsubscribe => {\n return subscribeToSet(this.dictionaryEntryListeners, listener);\n };\n\n subscribeToDictionaryObjectEvents = (\n listener: DictionaryStoreListener\n ): Unsubscribe => {\n return subscribeToSet(this.dictionaryObjectListeners, listener);\n };\n\n // ----- Snapshots ----- //\n\n getDictionaryEntrySnapshot = (\n lookup: DictionaryLookup,\n dictionariesSnapshot: Record<Locale, Dictionary>\n ): DictionaryEntrySnapshot => {\n return (\n lookupDictionaryEntry(dictionariesSnapshot, lookup) ??\n getExistingDictionaryManager()?.lookupDictionary(lookup.locale, lookup.id)\n );\n };\n\n getDictionaryObjectSnapshot = (\n lookup: DictionaryLookup,\n dictionariesSnapshot: Record<Locale, Dictionary>\n ): DictionaryObjectSnapshot => {\n return (\n lookupDictionaryObject(dictionariesSnapshot, lookup) ??\n getExistingDictionaryManager()?.lookupDictionaryObj(\n lookup.locale,\n lookup.id\n )\n );\n };\n\n // ----- Listener Utilities ----- //\n\n private emitDictionaryEvent(event: DictionaryLookup): void {\n this.dictionaryEntryListeners.forEach((listener) => listener(event));\n this.dictionaryObjectListeners.forEach((listener) => {\n listener(event);\n });\n }\n}\n"],"mappings":"6OAuBA,SAAS,GAA+B,CAItC,OAHI,EAAA,EAAA,iCAAiC,GACnC,EAAA,EAAA,6BAA4B,CAAE,gBAAiB,KAAM,CAAC,EAExD,EAAA,EAAA,uBAA6B,CAQ/B,SAAS,GAA+B,CACtC,OAAA,EAAA,EAAA,iCAAuC,EAAA,EAAA,EAAA,uBAAyB,CAAG,IAAA,GAOrE,IAAa,EAAb,KAAyB,CAGvB,yBAAmC,IAAI,IACvC,0BAAoC,IAAI,IACxC,2BAAqCA,EAAAA,qCAAqC,CAI1E,mBAAsB,GAAmD,CACnE,OAAO,KAAK,EAAa,CAAC,SAAW,GACzC,GAA8B,CAAC,mBAAmB,EAAa,EAKjE,yBAA4B,GAAmC,CAE7D,GAA8B,EAC1B,6BAA6B,EAAO,OAAQ,EAAO,GAAG,CACvD,SAAW,CACV,KAAK,oBAAoB,EAAO,EAChC,CACD,MAAO,GAAU,KAAK,2BAA2B,EAAM,CAAC,EAG7D,0BAA6B,GAAmC,CAC9D,GAA8B,EAC1B,gCAAgC,EAAO,OAAQ,EAAO,GAAG,CAC1D,SAAW,CACV,KAAK,oBAAoB,EAAO,EAChC,CACD,MAAO,GAAU,KAAK,2BAA2B,EAAM,CAAC,EAS7D,iCACE,GAEOC,EAAAA,eAAe,KAAK,yBAA0B,EAAS,CAGhE,kCACE,GAEOA,EAAAA,eAAe,KAAK,0BAA2B,EAAS,CAKjE,4BACE,EACA,IAGEC,EAAAA,sBAAsB,EAAsB,EAAO,EACnD,GAA8B,EAAE,iBAAiB,EAAO,OAAQ,EAAO,GAAG,CAI9E,6BACE,EACA,IAGEC,EAAAA,uBAAuB,EAAsB,EAAO,EACpD,GAA8B,EAAE,oBAC9B,EAAO,OACP,EAAO,GACR,CAML,oBAA4B,EAA+B,CACzD,KAAK,yBAAyB,QAAS,GAAa,EAAS,EAAM,CAAC,CACpE,KAAK,0BAA0B,QAAS,GAAa,CACnD,EAAS,EAAM,EACf"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Unsubscribe } from "../i18n-store/storeTypes.js";
|
|
2
|
+
import { DictionaryEntrySnapshot, DictionaryLookup, DictionaryObjectSnapshot, DictionaryStoreListener } from "./types.js";
|
|
3
|
+
import { Locale } from "gt-i18n/internal";
|
|
4
|
+
import { Dictionary } from "gt-i18n/internal/compat";
|
|
5
|
+
|
|
6
|
+
//#region src/compat/CompatStore.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Dictionary counterpart of I18nStore: syncs DictionaryManager updates with
|
|
9
|
+
* renders and drives dictionary dev hot reload.
|
|
10
|
+
*/
|
|
11
|
+
declare class CompatStore {
|
|
12
|
+
private dictionaryEntryListeners;
|
|
13
|
+
private dictionaryObjectListeners;
|
|
14
|
+
private logRuntimeTranslationError;
|
|
15
|
+
updateDictionaries: (dictionaries: Record<Locale, Dictionary>) => void;
|
|
16
|
+
translateDictionaryEntry: (lookup: DictionaryLookup) => void;
|
|
17
|
+
translateDictionaryObject: (lookup: DictionaryLookup) => void;
|
|
18
|
+
subscribeToDictionaryEntryEvents: (listener: DictionaryStoreListener) => Unsubscribe;
|
|
19
|
+
subscribeToDictionaryObjectEvents: (listener: DictionaryStoreListener) => Unsubscribe;
|
|
20
|
+
getDictionaryEntrySnapshot: (lookup: DictionaryLookup, dictionariesSnapshot: Record<Locale, Dictionary>) => DictionaryEntrySnapshot;
|
|
21
|
+
getDictionaryObjectSnapshot: (lookup: DictionaryLookup, dictionariesSnapshot: Record<Locale, Dictionary>) => DictionaryObjectSnapshot;
|
|
22
|
+
private emitDictionaryEvent;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { CompatStore };
|
|
26
|
+
//# sourceMappingURL=CompatStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompatStore.d.ts","names":[],"sources":["../../src/compat/CompatStore.ts"],"mappings":";;;;;;;;AA2CA;;cAAa,WAAA;EAAA,QAGH,wBAAA;EAAA,QACA,yBAAA;EAAA,QACA,0BAAA;EAIR,kBAAA,GAAsB,YAAA,EAAc,MAAA,CAAO,MAAA,EAAQ,UAAA;EAOnD,wBAAA,GAA4B,MAAA,EAAQ,gBAAA;EAUpC,yBAAA,GAA6B,MAAA,EAAQ,gBAAA;EAerC,gCAAA,GACE,QAAA,EAAU,uBAAA,KACT,WAAA;EAIH,iCAAA,GACE,QAAA,EAAU,uBAAA,KACT,WAAA;EAMH,0BAAA,GACE,MAAA,EAAQ,gBAAA,EACR,oBAAA,EAAsB,MAAA,CAAO,MAAA,EAAQ,UAAA,MACpC,uBAAA;EAOH,2BAAA,GACE,MAAA,EAAQ,gBAAA,EACR,oBAAA,EAAsB,MAAA,CAAO,MAAA,EAAQ,UAAA,MACpC,wBAAA;EAAA,QAYK,mBAAA;AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{subscribeToSet as e}from"../i18n-store/utils/subscriptions.mjs";import{createRuntimeTranslationErrorLogger as t}from"../i18n-store/utils/runtimeTranslationErrors.mjs";import{lookupDictionaryEntry as n,lookupDictionaryObject as r}from"./dictionaries.mjs";import{getDictionaryManager as i,initializeDictionaryManager as a,isDictionaryManagerInitialized as o}from"gt-i18n/internal/compat";function s(){return o()||a({cacheExpiryTime:null}),i()}function c(){return o()?i():void 0}var l=class{dictionaryEntryListeners=new Set;dictionaryObjectListeners=new Set;logRuntimeTranslationError=t();updateDictionaries=e=>{Object.keys(e).length!==0&&s().updateDictionaries(e)};translateDictionaryEntry=e=>{c()?.lookupDictionaryWithFallback(e.locale,e.id).then(()=>{this.emitDictionaryEvent(e)}).catch(e=>this.logRuntimeTranslationError(e))};translateDictionaryObject=e=>{c()?.lookupDictionaryObjWithFallback(e.locale,e.id).then(()=>{this.emitDictionaryEvent(e)}).catch(e=>this.logRuntimeTranslationError(e))};subscribeToDictionaryEntryEvents=t=>e(this.dictionaryEntryListeners,t);subscribeToDictionaryObjectEvents=t=>e(this.dictionaryObjectListeners,t);getDictionaryEntrySnapshot=(e,t)=>n(t,e)??c()?.lookupDictionary(e.locale,e.id);getDictionaryObjectSnapshot=(e,t)=>r(t,e)??c()?.lookupDictionaryObj(e.locale,e.id);emitDictionaryEvent(e){this.dictionaryEntryListeners.forEach(t=>t(e)),this.dictionaryObjectListeners.forEach(t=>{t(e)})}};export{l as CompatStore};
|
|
2
|
+
//# sourceMappingURL=CompatStore.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompatStore.mjs","names":[],"sources":["../../src/compat/CompatStore.ts"],"sourcesContent":["import type { Locale } from 'gt-i18n/internal';\nimport {\n getDictionaryManager,\n initializeDictionaryManager,\n isDictionaryManagerInitialized,\n type Dictionary,\n} from 'gt-i18n/internal/compat';\nimport type { Unsubscribe } from '../i18n-store/storeTypes';\nimport { subscribeToSet } from '../i18n-store/utils/subscriptions';\nimport { createRuntimeTranslationErrorLogger } from '../i18n-store/utils/runtimeTranslationErrors';\nimport { lookupDictionaryEntry, lookupDictionaryObject } from './dictionaries';\nimport type {\n DictionaryEntrySnapshot,\n DictionaryLookup,\n DictionaryObjectSnapshot,\n DictionaryStoreListener,\n} from './types';\n\n/**\n * Runtimes that only receive dictionaries through provider snapshots (such as\n * the gt-next client) never initialize a DictionaryManager. Create one without\n * a loader; its entries cannot be refreshed, so they never expire.\n */\nfunction getOrCreateDictionaryManager() {\n if (!isDictionaryManagerInitialized()) {\n initializeDictionaryManager({ cacheExpiryTime: null });\n }\n return getDictionaryManager();\n}\n\n/**\n * Render-time reads and server-side translations must not create a manager:\n * an empty one would stop gt-next from seeding the bundled dictionary later.\n * Only updateDictionaries() (a client effect) creates one.\n */\nfunction getExistingDictionaryManager() {\n return isDictionaryManagerInitialized() ? getDictionaryManager() : undefined;\n}\n\n/**\n * Dictionary counterpart of I18nStore: syncs DictionaryManager updates with\n * renders and drives dictionary dev hot reload.\n */\nexport class CompatStore {\n // ----- Listener Sets ----- //\n\n private dictionaryEntryListeners = new Set<DictionaryStoreListener>();\n private dictionaryObjectListeners = new Set<DictionaryStoreListener>();\n private logRuntimeTranslationError = createRuntimeTranslationErrorLogger();\n\n // ========== Dictionary Updates ========== //\n\n updateDictionaries = (dictionaries: Record<Locale, Dictionary>): void => {\n if (Object.keys(dictionaries).length === 0) return;\n getOrCreateDictionaryManager().updateDictionaries(dictionaries);\n };\n\n // ========== runtime translation ========== //\n\n translateDictionaryEntry = (lookup: DictionaryLookup): void => {\n // Without a manager there is no source dictionary to translate from.\n getExistingDictionaryManager()\n ?.lookupDictionaryWithFallback(lookup.locale, lookup.id)\n .then(() => {\n this.emitDictionaryEvent(lookup);\n })\n .catch((error) => this.logRuntimeTranslationError(error));\n };\n\n translateDictionaryObject = (lookup: DictionaryLookup): void => {\n getExistingDictionaryManager()\n ?.lookupDictionaryObjWithFallback(lookup.locale, lookup.id)\n .then(() => {\n this.emitDictionaryEvent(lookup);\n })\n .catch((error) => this.logRuntimeTranslationError(error));\n };\n\n // ========== UseSyncExternalStore ========== //\n\n // ----- Subscriptions ----- //\n\n // Keep subscription methods as arrow fields so hooks can pass them by\n // reference without losing access to this store instance.\n subscribeToDictionaryEntryEvents = (\n listener: DictionaryStoreListener\n ): Unsubscribe => {\n return subscribeToSet(this.dictionaryEntryListeners, listener);\n };\n\n subscribeToDictionaryObjectEvents = (\n listener: DictionaryStoreListener\n ): Unsubscribe => {\n return subscribeToSet(this.dictionaryObjectListeners, listener);\n };\n\n // ----- Snapshots ----- //\n\n getDictionaryEntrySnapshot = (\n lookup: DictionaryLookup,\n dictionariesSnapshot: Record<Locale, Dictionary>\n ): DictionaryEntrySnapshot => {\n return (\n lookupDictionaryEntry(dictionariesSnapshot, lookup) ??\n getExistingDictionaryManager()?.lookupDictionary(lookup.locale, lookup.id)\n );\n };\n\n getDictionaryObjectSnapshot = (\n lookup: DictionaryLookup,\n dictionariesSnapshot: Record<Locale, Dictionary>\n ): DictionaryObjectSnapshot => {\n return (\n lookupDictionaryObject(dictionariesSnapshot, lookup) ??\n getExistingDictionaryManager()?.lookupDictionaryObj(\n lookup.locale,\n lookup.id\n )\n );\n };\n\n // ----- Listener Utilities ----- //\n\n private emitDictionaryEvent(event: DictionaryLookup): void {\n this.dictionaryEntryListeners.forEach((listener) => listener(event));\n this.dictionaryObjectListeners.forEach((listener) => {\n listener(event);\n });\n }\n}\n"],"mappings":"yYAuBA,SAAS,GAA+B,CAItC,OAHK,GAAgC,EACnC,EAA4B,CAAE,gBAAiB,KAAM,CAAC,CAEjD,GAAsB,CAQ/B,SAAS,GAA+B,CACtC,OAAO,GAAgC,CAAG,GAAsB,CAAG,IAAA,GAOrE,IAAa,EAAb,KAAyB,CAGvB,yBAAmC,IAAI,IACvC,0BAAoC,IAAI,IACxC,2BAAqC,GAAqC,CAI1E,mBAAsB,GAAmD,CACnE,OAAO,KAAK,EAAa,CAAC,SAAW,GACzC,GAA8B,CAAC,mBAAmB,EAAa,EAKjE,yBAA4B,GAAmC,CAE7D,GAA8B,EAC1B,6BAA6B,EAAO,OAAQ,EAAO,GAAG,CACvD,SAAW,CACV,KAAK,oBAAoB,EAAO,EAChC,CACD,MAAO,GAAU,KAAK,2BAA2B,EAAM,CAAC,EAG7D,0BAA6B,GAAmC,CAC9D,GAA8B,EAC1B,gCAAgC,EAAO,OAAQ,EAAO,GAAG,CAC1D,SAAW,CACV,KAAK,oBAAoB,EAAO,EAChC,CACD,MAAO,GAAU,KAAK,2BAA2B,EAAM,CAAC,EAS7D,iCACE,GAEO,EAAe,KAAK,yBAA0B,EAAS,CAGhE,kCACE,GAEO,EAAe,KAAK,0BAA2B,EAAS,CAKjE,4BACE,EACA,IAGE,EAAsB,EAAsB,EAAO,EACnD,GAA8B,EAAE,iBAAiB,EAAO,OAAQ,EAAO,GAAG,CAI9E,6BACE,EACA,IAGE,EAAuB,EAAsB,EAAO,EACpD,GAA8B,EAAE,oBAC9B,EAAO,OACP,EAAO,GACR,CAML,oBAA4B,EAA+B,CACzD,KAAK,yBAAyB,QAAS,GAAa,EAAS,EAAM,CAAC,CACpE,KAAK,0BAA0B,QAAS,GAAa,CACnD,EAAS,EAAM,EACf"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`gt-i18n/internal`),t=require(`generaltranslation/diagnostics`),n=require(`react`);const r=(0,e.createGlobalSingleton)({namespace:`reactCore`,key:`dictionaryContext`,notInitialized:()=>(0,t.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read DictionaryContext before it has been initialized`})});function i(){return r.isInitialized()||r.set((0,n.createContext)(void 0)),r.get()}const a=(0,t.createDiagnosticMessage)({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`useTranslations() was called outside a GTProvider from a /compat entry`,why:`only the /compat GTProvider supplies the dictionaries useTranslations() reads`,fix:`Render GTProvider from your GT package's /compat entry, such as 'gt-react/compat', 'gt-next/compat' or 'gt-react-native/compat', instead of the one from the package root. In gt-tanstack-start, call setupRouterGTIntegration({ router }) from 'gt-tanstack-start/compat'`});function o(){let e=(0,n.useContext)(i());if(!e)throw Error(a);return e}exports.getDictionaryContext=i,exports.useDictionaryContext=o;
|
|
2
|
+
//# sourceMappingURL=DictionaryContext.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DictionaryContext.cjs","names":[],"sources":["../../src/compat/DictionaryContext.ts"],"sourcesContent":["import { createGlobalSingleton, type Locale } from 'gt-i18n/internal';\nimport type { Dictionary } from 'gt-i18n/internal/compat';\nimport { createDiagnosticMessage } from 'generaltranslation/diagnostics';\nimport { createContext, useContext, type Context } from 'react';\nimport type { CompatStore } from './CompatStore';\nimport type { OnMissingDictionaryEntry, OnMissingDictionaryObj } from './types';\n\ntype DictionaryContextType = {\n /**\n * Dictionaries streamed from the server, keyed by locale\n */\n dictionariesSnapshot: Record<Locale, Dictionary>;\n /**\n * CompatStore syncs DictionaryManager updates with renders\n */\n compatStore: CompatStore;\n /**\n * Custom override behavior on missing dictionary entries\n * Used for server triggering dictionary hmr b/c no access to useEffect\n */\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst dictionaryContextSingleton = createGlobalSingleton<\n Context<DictionaryContextType | undefined>\n>({\n namespace: 'reactCore',\n key: 'dictionaryContext',\n notInitialized: () =>\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened:\n 'Cannot read DictionaryContext before it has been initialized',\n }),\n});\n\nexport function getDictionaryContext(): Context<\n DictionaryContextType | undefined\n> {\n // Lazily create the React context once and share it across instances.\n if (!dictionaryContextSingleton.isInitialized()) {\n dictionaryContextSingleton.set(\n createContext<DictionaryContextType | undefined>(undefined)\n );\n }\n return dictionaryContextSingleton.get();\n}\n\nconst missingDictionaryProviderError = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened:\n 'useTranslations() was called outside a GTProvider from a /compat entry',\n why: 'only the /compat GTProvider supplies the dictionaries useTranslations() reads',\n fix: \"Render GTProvider from your GT package's /compat entry, such as 'gt-react/compat', 'gt-next/compat' or 'gt-react-native/compat', instead of the one from the package root. In gt-tanstack-start, call setupRouterGTIntegration({ router }) from 'gt-tanstack-start/compat'\",\n});\n\nexport function useDictionaryContext(): DictionaryContextType {\n const context = useContext(getDictionaryContext());\n if (!context) throw new Error(missingDictionaryProviderError);\n return context;\n}\n"],"mappings":"8IAwBA,MAAM,GAAA,EAAA,EAAA,uBAEJ,CACA,UAAW,YACX,IAAK,oBACL,oBAAA,EAAA,EAAA,yBAC0B,CACtB,OAAQ,iCACR,SAAU,QACV,aACE,+DACH,CAAC,CACL,CAAC,CAEF,SAAgB,GAEd,CAOA,OALK,EAA2B,eAAe,EAC7C,EAA2B,KAAA,EAAA,EAAA,eACwB,IAAA,GAAU,CAC5D,CAEI,EAA2B,KAAK,CAGzC,MAAM,GAAA,EAAA,EAAA,yBAAyD,CAC7D,OAAQ,iCACR,SAAU,QACV,aACE,yEACF,IAAK,gFACL,IAAK,6QACN,CAAC,CAEF,SAAgB,GAA8C,CAC5D,IAAM,GAAA,EAAA,EAAA,YAAqB,GAAsB,CAAC,CAClD,GAAI,CAAC,EAAS,MAAU,MAAM,EAA+B,CAC7D,OAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createGlobalSingleton as e}from"gt-i18n/internal";import{createDiagnosticMessage as t}from"generaltranslation/diagnostics";import{createContext as n,useContext as r}from"react";const i=e({namespace:`reactCore`,key:`dictionaryContext`,notInitialized:()=>t({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`Cannot read DictionaryContext before it has been initialized`})});function a(){return i.isInitialized()||i.set(n(void 0)),i.get()}const o=t({source:`@generaltranslation/react-core`,severity:`Error`,whatHappened:`useTranslations() was called outside a GTProvider from a /compat entry`,why:`only the /compat GTProvider supplies the dictionaries useTranslations() reads`,fix:`Render GTProvider from your GT package's /compat entry, such as 'gt-react/compat', 'gt-next/compat' or 'gt-react-native/compat', instead of the one from the package root. In gt-tanstack-start, call setupRouterGTIntegration({ router }) from 'gt-tanstack-start/compat'`});function s(){let e=r(a());if(!e)throw Error(o);return e}export{a as getDictionaryContext,s as useDictionaryContext};
|
|
2
|
+
//# sourceMappingURL=DictionaryContext.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DictionaryContext.mjs","names":[],"sources":["../../src/compat/DictionaryContext.ts"],"sourcesContent":["import { createGlobalSingleton, type Locale } from 'gt-i18n/internal';\nimport type { Dictionary } from 'gt-i18n/internal/compat';\nimport { createDiagnosticMessage } from 'generaltranslation/diagnostics';\nimport { createContext, useContext, type Context } from 'react';\nimport type { CompatStore } from './CompatStore';\nimport type { OnMissingDictionaryEntry, OnMissingDictionaryObj } from './types';\n\ntype DictionaryContextType = {\n /**\n * Dictionaries streamed from the server, keyed by locale\n */\n dictionariesSnapshot: Record<Locale, Dictionary>;\n /**\n * CompatStore syncs DictionaryManager updates with renders\n */\n compatStore: CompatStore;\n /**\n * Custom override behavior on missing dictionary entries\n * Used for server triggering dictionary hmr b/c no access to useEffect\n */\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst dictionaryContextSingleton = createGlobalSingleton<\n Context<DictionaryContextType | undefined>\n>({\n namespace: 'reactCore',\n key: 'dictionaryContext',\n notInitialized: () =>\n createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened:\n 'Cannot read DictionaryContext before it has been initialized',\n }),\n});\n\nexport function getDictionaryContext(): Context<\n DictionaryContextType | undefined\n> {\n // Lazily create the React context once and share it across instances.\n if (!dictionaryContextSingleton.isInitialized()) {\n dictionaryContextSingleton.set(\n createContext<DictionaryContextType | undefined>(undefined)\n );\n }\n return dictionaryContextSingleton.get();\n}\n\nconst missingDictionaryProviderError = createDiagnosticMessage({\n source: '@generaltranslation/react-core',\n severity: 'Error',\n whatHappened:\n 'useTranslations() was called outside a GTProvider from a /compat entry',\n why: 'only the /compat GTProvider supplies the dictionaries useTranslations() reads',\n fix: \"Render GTProvider from your GT package's /compat entry, such as 'gt-react/compat', 'gt-next/compat' or 'gt-react-native/compat', instead of the one from the package root. In gt-tanstack-start, call setupRouterGTIntegration({ router }) from 'gt-tanstack-start/compat'\",\n});\n\nexport function useDictionaryContext(): DictionaryContextType {\n const context = useContext(getDictionaryContext());\n if (!context) throw new Error(missingDictionaryProviderError);\n return context;\n}\n"],"mappings":"wLAwBA,MAAM,EAA6B,EAEjC,CACA,UAAW,YACX,IAAK,oBACL,mBACE,EAAwB,CACtB,OAAQ,iCACR,SAAU,QACV,aACE,+DACH,CAAC,CACL,CAAC,CAEF,SAAgB,GAEd,CAOA,OALK,EAA2B,eAAe,EAC7C,EAA2B,IACzB,EAAiD,IAAA,GAAU,CAC5D,CAEI,EAA2B,KAAK,CAGzC,MAAM,EAAiC,EAAwB,CAC7D,OAAQ,iCACR,SAAU,QACV,aACE,yEACF,IAAK,gFACL,IAAK,6QACN,CAAC,CAEF,SAAgB,GAA8C,CAC5D,IAAM,EAAU,EAAW,GAAsB,CAAC,CAClD,GAAI,CAAC,EAAS,MAAU,MAAM,EAA+B,CAC7D,OAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./CompatStore.cjs`),t=require(`./DictionaryContext.cjs`);let n=require(`react/jsx-runtime`),r=require(`react`);const i=t.getDictionaryContext(),a={};function o({children:t,dictionaries:o=a,compatStore:s,onMissingDictionaryEntry:c,onMissingDictionaryObj:l}){let u=(0,r.useRef)(null);s==null&&u.current==null&&(u.current=new e.CompatStore);let d=s??u.current,f=(0,r.useMemo)(()=>({dictionariesSnapshot:o,compatStore:d,onMissingDictionaryEntry:c,onMissingDictionaryObj:l}),[o,d,c,l]);return(0,r.useEffect)(()=>{d.updateDictionaries(o)},[o,d]),(0,n.jsx)(i.Provider,{value:f,children:t})}exports.DictionaryProvider=o;
|
|
2
|
+
//# sourceMappingURL=DictionaryProvider.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DictionaryProvider.cjs","names":["getDictionaryContext","CompatStore"],"sources":["../../src/compat/DictionaryProvider.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, type ReactNode } from 'react';\nimport type { Dictionary } from 'gt-i18n/internal/compat';\nimport type { Locale } from 'gt-i18n/internal';\nimport { CompatStore } from './CompatStore';\nimport { getDictionaryContext } from './DictionaryContext';\nimport type { OnMissingDictionaryEntry, OnMissingDictionaryObj } from './types';\n\nexport type DictionaryProviderProps = {\n children?: ReactNode;\n // For streaming dictionaries from the server\n dictionaries?: Record<Locale, Dictionary>;\n // Defaults to a store owned by this provider\n compatStore?: CompatStore;\n // Custom override missing dictionary behavior for dev hot reload\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst DictionaryContext = getDictionaryContext();\nconst EMPTY_DICTIONARIES: Record<Locale, Dictionary> = {};\n\n/**\n * Shared dictionary provider logic for the key-based (compat) API. Not\n * user-facing: runtime packages wrap it with their own loading.\n */\nexport function DictionaryProvider({\n children,\n dictionaries = EMPTY_DICTIONARIES,\n compatStore: compatStoreProp,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n}: DictionaryProviderProps) {\n const ownStoreRef = useRef<CompatStore | null>(null);\n if (compatStoreProp == null && ownStoreRef.current == null) {\n ownStoreRef.current = new CompatStore();\n }\n const compatStore = compatStoreProp ?? ownStoreRef.current!;\n\n const value = useMemo(\n () => ({\n dictionariesSnapshot: dictionaries,\n compatStore,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n }),\n [\n dictionaries,\n compatStore,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n ]\n );\n\n // Update the dictionary manager with data from the server, do not emit events\n useEffect(() => {\n compatStore.updateDictionaries(dictionaries);\n }, [dictionaries, compatStore]);\n\n return (\n <DictionaryContext.Provider value={value}>\n {children}\n </DictionaryContext.Provider>\n );\n}\n"],"mappings":"6KAkBA,MAAM,EAAoBA,EAAAA,sBAAsB,CAC1C,EAAiD,EAAE,CAMzD,SAAgB,EAAmB,CACjC,WACA,eAAe,EACf,YAAa,EACb,2BACA,0BAC0B,CAC1B,IAAM,GAAA,EAAA,EAAA,QAAyC,KAAK,CAChD,GAAmB,MAAQ,EAAY,SAAW,OACpD,EAAY,QAAU,IAAIC,EAAAA,aAE5B,IAAM,EAAc,GAAmB,EAAY,QAE7C,GAAA,EAAA,EAAA,cACG,CACL,qBAAsB,EACtB,cACA,2BACA,yBACD,EACD,CACE,EACA,EACA,EACA,EACD,CACF,CAOD,OAJA,EAAA,EAAA,eAAgB,CACd,EAAY,mBAAmB,EAAa,EAC3C,CAAC,EAAc,EAAY,CAAC,EAG7B,EAAA,EAAA,KAAC,EAAkB,SAAnB,CAAmC,QAChC,WAC0B,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OnMissingDictionaryEntry, OnMissingDictionaryObj } from "./types.js";
|
|
2
|
+
import { CompatStore } from "./CompatStore.js";
|
|
3
|
+
import { Locale } from "gt-i18n/internal";
|
|
4
|
+
import { Dictionary } from "gt-i18n/internal/compat";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
import { ReactNode } from "react";
|
|
7
|
+
|
|
8
|
+
//#region src/compat/DictionaryProvider.d.ts
|
|
9
|
+
type DictionaryProviderProps = {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
dictionaries?: Record<Locale, Dictionary>;
|
|
12
|
+
compatStore?: CompatStore;
|
|
13
|
+
onMissingDictionaryEntry?: OnMissingDictionaryEntry;
|
|
14
|
+
onMissingDictionaryObj?: OnMissingDictionaryObj;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Shared dictionary provider logic for the key-based (compat) API. Not
|
|
18
|
+
* user-facing: runtime packages wrap it with their own loading.
|
|
19
|
+
*/
|
|
20
|
+
declare function DictionaryProvider({
|
|
21
|
+
children,
|
|
22
|
+
dictionaries,
|
|
23
|
+
compatStore: compatStoreProp,
|
|
24
|
+
onMissingDictionaryEntry,
|
|
25
|
+
onMissingDictionaryObj
|
|
26
|
+
}: DictionaryProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { DictionaryProvider, DictionaryProviderProps };
|
|
29
|
+
//# sourceMappingURL=DictionaryProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DictionaryProvider.d.ts","names":[],"sources":["../../src/compat/DictionaryProvider.tsx"],"mappings":";;;;;;;;KAOY,uBAAA;EACV,QAAA,GAAW,SAAA;EAEX,YAAA,GAAe,MAAA,CAAO,MAAA,EAAQ,UAAA;EAE9B,WAAA,GAAc,WAAA;EAEd,wBAAA,GAA2B,wBAAA;EAC3B,sBAAA,GAAyB,sBAAA;AAAA;;;;;iBAUX,kBAAA,CAAA;EACd,QAAA;EACA,YAAA;EACA,WAAA,EAAa,eAAA;EACb,wBAAA;EACA;AAAA,GACC,uBAAA,GAAuB,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{CompatStore as e}from"./CompatStore.mjs";import{getDictionaryContext as t}from"./DictionaryContext.mjs";import{jsx as n}from"react/jsx-runtime";import{useEffect as r,useMemo as i,useRef as a}from"react";const o=t(),s={};function c({children:t,dictionaries:c=s,compatStore:l,onMissingDictionaryEntry:u,onMissingDictionaryObj:d}){let f=a(null);l==null&&f.current==null&&(f.current=new e);let p=l??f.current,m=i(()=>({dictionariesSnapshot:c,compatStore:p,onMissingDictionaryEntry:u,onMissingDictionaryObj:d}),[c,p,u,d]);return r(()=>{p.updateDictionaries(c)},[c,p]),n(o.Provider,{value:m,children:t})}export{c as DictionaryProvider};
|
|
2
|
+
//# sourceMappingURL=DictionaryProvider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DictionaryProvider.mjs","names":[],"sources":["../../src/compat/DictionaryProvider.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, type ReactNode } from 'react';\nimport type { Dictionary } from 'gt-i18n/internal/compat';\nimport type { Locale } from 'gt-i18n/internal';\nimport { CompatStore } from './CompatStore';\nimport { getDictionaryContext } from './DictionaryContext';\nimport type { OnMissingDictionaryEntry, OnMissingDictionaryObj } from './types';\n\nexport type DictionaryProviderProps = {\n children?: ReactNode;\n // For streaming dictionaries from the server\n dictionaries?: Record<Locale, Dictionary>;\n // Defaults to a store owned by this provider\n compatStore?: CompatStore;\n // Custom override missing dictionary behavior for dev hot reload\n onMissingDictionaryEntry?: OnMissingDictionaryEntry;\n onMissingDictionaryObj?: OnMissingDictionaryObj;\n};\n\nconst DictionaryContext = getDictionaryContext();\nconst EMPTY_DICTIONARIES: Record<Locale, Dictionary> = {};\n\n/**\n * Shared dictionary provider logic for the key-based (compat) API. Not\n * user-facing: runtime packages wrap it with their own loading.\n */\nexport function DictionaryProvider({\n children,\n dictionaries = EMPTY_DICTIONARIES,\n compatStore: compatStoreProp,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n}: DictionaryProviderProps) {\n const ownStoreRef = useRef<CompatStore | null>(null);\n if (compatStoreProp == null && ownStoreRef.current == null) {\n ownStoreRef.current = new CompatStore();\n }\n const compatStore = compatStoreProp ?? ownStoreRef.current!;\n\n const value = useMemo(\n () => ({\n dictionariesSnapshot: dictionaries,\n compatStore,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n }),\n [\n dictionaries,\n compatStore,\n onMissingDictionaryEntry,\n onMissingDictionaryObj,\n ]\n );\n\n // Update the dictionary manager with data from the server, do not emit events\n useEffect(() => {\n compatStore.updateDictionaries(dictionaries);\n }, [dictionaries, compatStore]);\n\n return (\n <DictionaryContext.Provider value={value}>\n {children}\n </DictionaryContext.Provider>\n );\n}\n"],"mappings":"kNAkBA,MAAM,EAAoB,GAAsB,CAC1C,EAAiD,EAAE,CAMzD,SAAgB,EAAmB,CACjC,WACA,eAAe,EACf,YAAa,EACb,2BACA,0BAC0B,CAC1B,IAAM,EAAc,EAA2B,KAAK,CAChD,GAAmB,MAAQ,EAAY,SAAW,OACpD,EAAY,QAAU,IAAI,GAE5B,IAAM,EAAc,GAAmB,EAAY,QAE7C,EAAQ,OACL,CACL,qBAAsB,EACtB,cACA,2BACA,yBACD,EACD,CACE,EACA,EACA,EACA,EACD,CACF,CAOD,OAJA,MAAgB,CACd,EAAY,mBAAmB,EAAa,EAC3C,CAAC,EAAc,EAAY,CAAC,CAG7B,EAAC,EAAkB,SAAnB,CAAmC,QAChC,WAC0B,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`gt-i18n/internal/compat`);function t(t,n){return(0,e.getDictionaryEntry)(r(t,n))}function n(e,t){return r(e,t)}function r(t,{locale:n,id:r}){let a=t[n];if(!a)return;if(!r)return a;let o=a;for(let t of r.split(`.`)){if(!i(t)||!(0,e.isDictionaryValue)(o)||!Object.prototype.hasOwnProperty.call(o,t))return;o=o[t]}return o}function i(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}exports.lookupDictionaryEntry=t,exports.lookupDictionaryObject=n;
|
|
2
|
+
//# sourceMappingURL=dictionaries.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionaries.cjs","names":[],"sources":["../../src/compat/dictionaries.ts"],"sourcesContent":["import type { Locale } from 'gt-i18n/internal';\nimport {\n getDictionaryEntry,\n isDictionaryValue,\n type Dictionary,\n type DictionaryObject,\n} from 'gt-i18n/internal/compat';\nimport type {\n DictionaryEntrySnapshot,\n DictionaryLookup,\n DictionaryObjectSnapshot,\n} from './types';\n\nexport function lookupDictionaryEntry(\n dictionariesSnapshot: Record<Locale, Dictionary>,\n lookup: DictionaryLookup\n): DictionaryEntrySnapshot {\n return getDictionaryEntry(\n lookupDictionaryValue(dictionariesSnapshot, lookup)\n );\n}\n\nexport function lookupDictionaryObject(\n dictionariesSnapshot: Record<Locale, Dictionary>,\n lookup: DictionaryLookup\n): DictionaryObjectSnapshot {\n return lookupDictionaryValue(dictionariesSnapshot, lookup);\n}\n\nfunction lookupDictionaryValue(\n dictionariesSnapshot: Record<Locale, Dictionary>,\n { locale, id }: DictionaryLookup\n): DictionaryObjectSnapshot {\n const dictionary = dictionariesSnapshot[locale];\n if (!dictionary) return undefined;\n if (!id) return dictionary;\n\n let current: DictionaryObject | undefined = dictionary;\n for (const segment of id.split('.')) {\n if (!isSafeDictionaryPathSegment(segment)) return undefined;\n if (!isDictionaryValue(current)) return undefined;\n if (!Object.prototype.hasOwnProperty.call(current, segment)) {\n return undefined;\n }\n current = current[segment];\n }\n return current;\n}\n\nfunction isSafeDictionaryPathSegment(segment: string): boolean {\n return (\n segment !== '__proto__' &&\n segment !== 'constructor' &&\n segment !== 'prototype'\n );\n}\n"],"mappings":"sFAaA,SAAgB,EACd,EACA,EACyB,CACzB,OAAA,EAAA,EAAA,oBACE,EAAsB,EAAsB,EAAO,CACpD,CAGH,SAAgB,EACd,EACA,EAC0B,CAC1B,OAAO,EAAsB,EAAsB,EAAO,CAG5D,SAAS,EACP,EACA,CAAE,SAAQ,MACgB,CAC1B,IAAM,EAAa,EAAqB,GACxC,GAAI,CAAC,EAAY,OACjB,GAAI,CAAC,EAAI,OAAO,EAEhB,IAAI,EAAwC,EAC5C,IAAK,IAAM,KAAW,EAAG,MAAM,IAAI,CAAE,CAGnC,GAFI,CAAC,EAA4B,EAAQ,EACrC,EAAA,EAAA,EAAA,mBAAmB,EAAQ,EAC3B,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,EAAQ,CACzD,OAEF,EAAU,EAAQ,GAEpB,OAAO,EAGT,SAAS,EAA4B,EAA0B,CAC7D,OACE,IAAY,aACZ,IAAY,eACZ,IAAY"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getDictionaryEntry as e,isDictionaryValue as t}from"gt-i18n/internal/compat";function n(t,n){return e(i(t,n))}function r(e,t){return i(e,t)}function i(e,{locale:n,id:r}){let i=e[n];if(!i)return;if(!r)return i;let o=i;for(let e of r.split(`.`)){if(!a(e)||!t(o)||!Object.prototype.hasOwnProperty.call(o,e))return;o=o[e]}return o}function a(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}export{n as lookupDictionaryEntry,r as lookupDictionaryObject};
|
|
2
|
+
//# sourceMappingURL=dictionaries.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionaries.mjs","names":[],"sources":["../../src/compat/dictionaries.ts"],"sourcesContent":["import type { Locale } from 'gt-i18n/internal';\nimport {\n getDictionaryEntry,\n isDictionaryValue,\n type Dictionary,\n type DictionaryObject,\n} from 'gt-i18n/internal/compat';\nimport type {\n DictionaryEntrySnapshot,\n DictionaryLookup,\n DictionaryObjectSnapshot,\n} from './types';\n\nexport function lookupDictionaryEntry(\n dictionariesSnapshot: Record<Locale, Dictionary>,\n lookup: DictionaryLookup\n): DictionaryEntrySnapshot {\n return getDictionaryEntry(\n lookupDictionaryValue(dictionariesSnapshot, lookup)\n );\n}\n\nexport function lookupDictionaryObject(\n dictionariesSnapshot: Record<Locale, Dictionary>,\n lookup: DictionaryLookup\n): DictionaryObjectSnapshot {\n return lookupDictionaryValue(dictionariesSnapshot, lookup);\n}\n\nfunction lookupDictionaryValue(\n dictionariesSnapshot: Record<Locale, Dictionary>,\n { locale, id }: DictionaryLookup\n): DictionaryObjectSnapshot {\n const dictionary = dictionariesSnapshot[locale];\n if (!dictionary) return undefined;\n if (!id) return dictionary;\n\n let current: DictionaryObject | undefined = dictionary;\n for (const segment of id.split('.')) {\n if (!isSafeDictionaryPathSegment(segment)) return undefined;\n if (!isDictionaryValue(current)) return undefined;\n if (!Object.prototype.hasOwnProperty.call(current, segment)) {\n return undefined;\n }\n current = current[segment];\n }\n return current;\n}\n\nfunction isSafeDictionaryPathSegment(segment: string): boolean {\n return (\n segment !== '__proto__' &&\n segment !== 'constructor' &&\n segment !== 'prototype'\n );\n}\n"],"mappings":"oFAaA,SAAgB,EACd,EACA,EACyB,CACzB,OAAO,EACL,EAAsB,EAAsB,EAAO,CACpD,CAGH,SAAgB,EACd,EACA,EAC0B,CAC1B,OAAO,EAAsB,EAAsB,EAAO,CAG5D,SAAS,EACP,EACA,CAAE,SAAQ,MACgB,CAC1B,IAAM,EAAa,EAAqB,GACxC,GAAI,CAAC,EAAY,OACjB,GAAI,CAAC,EAAI,OAAO,EAEhB,IAAI,EAAwC,EAC5C,IAAK,IAAM,KAAW,EAAG,MAAM,IAAI,CAAE,CAGnC,GAFI,CAAC,EAA4B,EAAQ,EACrC,CAAC,EAAkB,EAAQ,EAC3B,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,EAAQ,CACzD,OAEF,EAAU,EAAQ,GAEpB,OAAO,EAGT,SAAS,EAA4B,EAA0B,CAC7D,OACE,IAAY,aACZ,IAAY,eACZ,IAAY"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../hooks/utils.cjs`),t=require(`../hooks/utils/missing-translation.cjs`),n=require(`./DictionaryContext.cjs`);let r=require(`react`),i=require(`gt-i18n/internal/compat`);const a=()=>{},o=()=>{};function s(){let{compatStore:r}=n.useDictionaryContext();return t.useDevHotReloadQueue(e.useShouldTranslate(),({type:e,lookup:t})=>{switch(e){case`dictionaryEntry`:r.translateDictionaryEntry(t);break;case`dictionaryObject`:r.translateDictionaryObject(t);break}})}function c(){return a}function l(){let e=n.useDictionaryContext().onMissingDictionaryEntry,t=s();return(0,r.useCallback)(n=>{e?e(n):t((0,i.getDictionaryListenerKey)(n),{type:`dictionaryEntry`,lookup:n})},[e,t])}function u(){return o}function d(){let e=n.useDictionaryContext().onMissingDictionaryObj,t=s();return(0,r.useCallback)(n=>{e?e(n):t((0,i.getDictionaryListenerKey)(n),{type:`dictionaryObject`,lookup:n})},[e,t])}const f=process.env.NODE_ENV===`production`?c:l,p=process.env.NODE_ENV===`production`?u:d;exports.useHandleMissingDictionaryEntry=f,exports.useHandleMissingDictionaryObject=p;
|
|
2
|
+
//# sourceMappingURL=missing-dictionary.cjs.map
|