gt-react 3.1.37 → 3.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mjs/client/client-only/GTClientProvider.d.ts.map +1 -1
- package/dist/mjs/client/client-only/GTClientProvider.js +4 -3
- package/dist/mjs/client/client-only/GTClientProvider.js.map +1 -1
- package/dist/mjs/client/client-only/helpers/renderDictionary.d.ts.map +1 -1
- package/dist/mjs/client/client-only/helpers/renderDictionary.js +84 -3
- package/dist/mjs/client/client-only/helpers/renderDictionary.js.map +1 -1
- package/dist/mjs/client/plural/ClientPlural.d.ts +2 -1
- package/dist/mjs/client/plural/ClientPlural.d.ts.map +1 -1
- package/dist/mjs/client/plural/ClientPlural.js +3 -2
- package/dist/mjs/client/plural/ClientPlural.js.map +1 -1
- package/dist/mjs/client/value/ClientValue.d.ts.map +1 -1
- package/dist/mjs/client/value/ClientValue.js +2 -1
- package/dist/mjs/client/value/ClientValue.js.map +1 -1
- package/dist/mjs/dictionary/createDictFunction.d.ts.map +1 -1
- package/dist/mjs/dictionary/createDictFunction.js +2 -4
- package/dist/mjs/dictionary/createDictFunction.js.map +1 -1
- package/dist/mjs/dictionary/createExecuteTFunction.d.ts +12 -0
- package/dist/mjs/dictionary/createExecuteTFunction.d.ts.map +1 -0
- package/dist/mjs/dictionary/createExecuteTFunction.js +88 -0
- package/dist/mjs/dictionary/createExecuteTFunction.js.map +1 -0
- package/dist/mjs/dictionary/createGetGTFunction.d.ts +1 -1
- package/dist/mjs/dictionary/createGetGTFunction.d.ts.map +1 -1
- package/dist/mjs/dictionary/createTFunction.d.ts.map +1 -1
- package/dist/mjs/dictionary/createTFunction.js +20 -10
- package/dist/mjs/dictionary/createTFunction.js.map +1 -1
- package/dist/mjs/primitives/createValues.d.ts +6 -0
- package/dist/mjs/primitives/createValues.d.ts.map +1 -0
- package/dist/mjs/primitives/createValues.js +13 -0
- package/dist/mjs/primitives/createValues.js.map +1 -0
- package/dist/mjs/primitives/flattenDictionary.d.ts +3 -3
- package/dist/mjs/primitives/flattenDictionary.js +3 -3
- package/dist/mjs/primitives/getEntryMetadata.d.ts +5 -0
- package/dist/mjs/primitives/getEntryMetadata.d.ts.map +1 -0
- package/dist/mjs/primitives/getEntryMetadata.js +14 -0
- package/dist/mjs/primitives/getEntryMetadata.js.map +1 -0
- package/dist/mjs/primitives/getEntryTranslationType.d.ts +2 -0
- package/dist/mjs/primitives/getEntryTranslationType.d.ts.map +1 -0
- package/dist/mjs/primitives/getEntryTranslationType.js +25 -0
- package/dist/mjs/primitives/getEntryTranslationType.js.map +1 -0
- package/dist/mjs/primitives/getRenderAttributes.d.ts +5 -0
- package/dist/mjs/primitives/getRenderAttributes.d.ts.map +1 -0
- package/dist/mjs/primitives/getRenderAttributes.js +21 -0
- package/dist/mjs/primitives/getRenderAttributes.js.map +1 -0
- package/dist/mjs/server/T.d.ts.map +1 -1
- package/dist/mjs/server/T.js +2 -5
- package/dist/mjs/server/T.js.map +1 -1
- package/dist/mjs/server/plural/InnerPlural.d.ts +2 -1
- package/dist/mjs/server/plural/InnerPlural.d.ts.map +1 -1
- package/dist/mjs/server/plural/InnerPlural.js +3 -2
- package/dist/mjs/server/plural/InnerPlural.js.map +1 -1
- package/dist/mjs/server/plural/createPluralComponent.d.ts +1 -1
- package/dist/mjs/server/plural/createPluralComponent.d.ts.map +1 -1
- package/dist/mjs/server/plural/createPluralComponent.js +2 -2
- package/dist/mjs/server/plural/createPluralComponent.js.map +1 -1
- package/dist/mjs/server/provider/GTProvider.d.ts +2 -3
- package/dist/mjs/server/provider/GTProvider.d.ts.map +1 -1
- package/dist/mjs/server/provider/GTProvider.js +8 -26
- package/dist/mjs/server/provider/GTProvider.js.map +1 -1
- package/dist/mjs/server/provider/createGTProviderComponent.d.ts +2 -3
- package/dist/mjs/server/provider/createGTProviderComponent.d.ts.map +1 -1
- package/dist/mjs/server/provider/createGTProviderComponent.js +2 -2
- package/dist/mjs/server/provider/createGTProviderComponent.js.map +1 -1
- package/dist/mjs/server/renderChildren.d.ts +1 -1
- package/dist/mjs/server/renderChildren.d.ts.map +1 -1
- package/dist/mjs/server/value/InnerValue.d.ts +2 -2
- package/dist/mjs/server/value/InnerValue.d.ts.map +1 -1
- package/dist/mjs/server/value/InnerValue.js +4 -4
- package/dist/mjs/server/value/InnerValue.js.map +1 -1
- package/dist/mjs/server.d.ts.map +1 -1
- package/dist/mjs/server.js +5 -4
- package/dist/mjs/server.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/client/ClientProvider.d.ts +0 -19
- package/dist/cjs/client/ClientProvider.d.ts.map +0 -1
- package/dist/cjs/client/ClientProvider.js +0 -29
- package/dist/cjs/client/ClientProvider.js.map +0 -1
- package/dist/cjs/client/client-only/GTClientProvider.d.ts +0 -13
- package/dist/cjs/client/client-only/GTClientProvider.d.ts.map +0 -1
- package/dist/cjs/client/client-only/GTClientProvider.js +0 -94
- package/dist/cjs/client/client-only/GTClientProvider.js.map +0 -1
- package/dist/cjs/client/client-only/helpers/renderDictionary.d.ts +0 -2
- package/dist/cjs/client/client-only/helpers/renderDictionary.d.ts.map +0 -1
- package/dist/cjs/client/client-only/helpers/renderDictionary.js +0 -10
- package/dist/cjs/client/client-only/helpers/renderDictionary.js.map +0 -1
- package/dist/cjs/client/hooks/useBrowserLocale.d.ts +0 -7
- package/dist/cjs/client/hooks/useBrowserLocale.d.ts.map +0 -1
- package/dist/cjs/client/hooks/useBrowserLocale.js +0 -41
- package/dist/cjs/client/hooks/useBrowserLocale.js.map +0 -1
- package/dist/cjs/client/hooks/useDefaultLocale.d.ts +0 -5
- package/dist/cjs/client/hooks/useDefaultLocale.d.ts.map +0 -1
- package/dist/cjs/client/hooks/useDefaultLocale.js +0 -13
- package/dist/cjs/client/hooks/useDefaultLocale.js.map +0 -1
- package/dist/cjs/client/hooks/useGT.d.ts +0 -10
- package/dist/cjs/client/hooks/useGT.d.ts.map +0 -1
- package/dist/cjs/client/hooks/useGT.js +0 -61
- package/dist/cjs/client/hooks/useGT.js.map +0 -1
- package/dist/cjs/client/hooks/useLocale.d.ts +0 -5
- package/dist/cjs/client/hooks/useLocale.d.ts.map +0 -1
- package/dist/cjs/client/hooks/useLocale.js +0 -13
- package/dist/cjs/client/hooks/useLocale.js.map +0 -1
- package/dist/cjs/client/plural/ClientPlural.d.ts +0 -27
- package/dist/cjs/client/plural/ClientPlural.d.ts.map +0 -1
- package/dist/cjs/client/plural/ClientPlural.js +0 -77
- package/dist/cjs/client/plural/ClientPlural.js.map +0 -1
- package/dist/cjs/client/value/ClientValue.d.ts +0 -16
- package/dist/cjs/client/value/ClientValue.d.ts.map +0 -1
- package/dist/cjs/client/value/ClientValue.js +0 -42
- package/dist/cjs/client/value/ClientValue.js.map +0 -1
- package/dist/cjs/client/value/RenderClientVariable.d.ts +0 -6
- package/dist/cjs/client/value/RenderClientVariable.d.ts.map +0 -1
- package/dist/cjs/client/value/RenderClientVariable.js +0 -106
- package/dist/cjs/client/value/RenderClientVariable.js.map +0 -1
- package/dist/cjs/client/variables/ClientCurrency.d.ts +0 -13
- package/dist/cjs/client/variables/ClientCurrency.d.ts.map +0 -1
- package/dist/cjs/client/variables/ClientCurrency.js +0 -31
- package/dist/cjs/client/variables/ClientCurrency.js.map +0 -1
- package/dist/cjs/client/variables/ClientDateTime.d.ts +0 -12
- package/dist/cjs/client/variables/ClientDateTime.d.ts.map +0 -1
- package/dist/cjs/client/variables/ClientDateTime.js +0 -45
- package/dist/cjs/client/variables/ClientDateTime.js.map +0 -1
- package/dist/cjs/client/variables/ClientNum.d.ts +0 -12
- package/dist/cjs/client/variables/ClientNum.d.ts.map +0 -1
- package/dist/cjs/client/variables/ClientNum.js +0 -29
- package/dist/cjs/client/variables/ClientNum.js.map +0 -1
- package/dist/cjs/client/variables/ClientVar.d.ts +0 -21
- package/dist/cjs/client/variables/ClientVar.d.ts.map +0 -1
- package/dist/cjs/client/variables/ClientVar.js +0 -26
- package/dist/cjs/client/variables/ClientVar.js.map +0 -1
- package/dist/cjs/client.d.ts +0 -12
- package/dist/cjs/client.d.ts.map +0 -1
- package/dist/cjs/client.js +0 -27
- package/dist/cjs/client.js.map +0 -1
- package/dist/cjs/config/I18NConfiguration.d.ts +0 -135
- package/dist/cjs/config/I18NConfiguration.d.ts.map +0 -1
- package/dist/cjs/config/I18NConfiguration.js +0 -343
- package/dist/cjs/config/I18NConfiguration.js.map +0 -1
- package/dist/cjs/config/LocalDictionaryManager.d.ts +0 -31
- package/dist/cjs/config/LocalDictionaryManager.d.ts.map +0 -1
- package/dist/cjs/config/LocalDictionaryManager.js +0 -95
- package/dist/cjs/config/LocalDictionaryManager.js.map +0 -1
- package/dist/cjs/config/RemoteDictionaryManager.d.ts +0 -59
- package/dist/cjs/config/RemoteDictionaryManager.d.ts.map +0 -1
- package/dist/cjs/config/RemoteDictionaryManager.js +0 -120
- package/dist/cjs/config/RemoteDictionaryManager.js.map +0 -1
- package/dist/cjs/config/determineLocale.d.ts +0 -2
- package/dist/cjs/config/determineLocale.d.ts.map +0 -1
- package/dist/cjs/config/determineLocale.js +0 -32
- package/dist/cjs/config/determineLocale.js.map +0 -1
- package/dist/cjs/config/local/getDefaultFromEnv.d.ts +0 -12
- package/dist/cjs/config/local/getDefaultFromEnv.d.ts.map +0 -1
- package/dist/cjs/config/local/getDefaultFromEnv.js +0 -21
- package/dist/cjs/config/local/getDefaultFromEnv.js.map +0 -1
- package/dist/cjs/dictionary/createDictFunction.d.ts +0 -3
- package/dist/cjs/dictionary/createDictFunction.d.ts.map +0 -1
- package/dist/cjs/dictionary/createDictFunction.js +0 -13
- package/dist/cjs/dictionary/createDictFunction.js.map +0 -1
- package/dist/cjs/dictionary/createGetGTFunction.d.ts +0 -3
- package/dist/cjs/dictionary/createGetGTFunction.d.ts.map +0 -1
- package/dist/cjs/dictionary/createGetGTFunction.js +0 -10
- package/dist/cjs/dictionary/createGetGTFunction.js.map +0 -1
- package/dist/cjs/dictionary/createTFunction.d.ts +0 -12
- package/dist/cjs/dictionary/createTFunction.d.ts.map +0 -1
- package/dist/cjs/dictionary/createTFunction.js +0 -75
- package/dist/cjs/dictionary/createTFunction.js.map +0 -1
- package/dist/cjs/dictionary/getDictionaryEntry.d.ts +0 -2
- package/dist/cjs/dictionary/getDictionaryEntry.d.ts.map +0 -1
- package/dist/cjs/dictionary/getDictionaryEntry.js +0 -14
- package/dist/cjs/dictionary/getDictionaryEntry.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -6
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -15
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/intl/createIntlFunction.d.ts +0 -6
- package/dist/cjs/intl/createIntlFunction.d.ts.map +0 -1
- package/dist/cjs/intl/createIntlFunction.js +0 -48
- package/dist/cjs/intl/createIntlFunction.js.map +0 -1
- package/dist/cjs/middleware/cookieSettings.d.ts +0 -2
- package/dist/cjs/middleware/cookieSettings.d.ts.map +0 -1
- package/dist/cjs/middleware/cookieSettings.js +0 -5
- package/dist/cjs/middleware/cookieSettings.js.map +0 -1
- package/dist/cjs/middleware/createNextMiddleware.d.ts +0 -10
- package/dist/cjs/middleware/createNextMiddleware.d.ts.map +0 -1
- package/dist/cjs/middleware/createNextMiddleware.js +0 -151
- package/dist/cjs/middleware/createNextMiddleware.js.map +0 -1
- package/dist/cjs/middleware.d.ts +0 -3
- package/dist/cjs/middleware.d.ts.map +0 -1
- package/dist/cjs/middleware.js +0 -9
- package/dist/cjs/middleware.js.map +0 -1
- package/dist/cjs/next/imports/imports.d.ts +0 -6
- package/dist/cjs/next/imports/imports.d.ts.map +0 -1
- package/dist/cjs/next/imports/imports.js +0 -84
- package/dist/cjs/next/imports/imports.js.map +0 -1
- package/dist/cjs/next/requestFunctions.d.ts +0 -21
- package/dist/cjs/next/requestFunctions.d.ts.map +0 -1
- package/dist/cjs/next/requestFunctions.js +0 -58
- package/dist/cjs/next/requestFunctions.js.map +0 -1
- package/dist/cjs/next.d.ts +0 -38
- package/dist/cjs/next.d.ts.map +0 -1
- package/dist/cjs/next.js +0 -58
- package/dist/cjs/next.js.map +0 -1
- package/dist/cjs/primitives/calculateID.d.ts +0 -2
- package/dist/cjs/primitives/calculateID.d.ts.map +0 -1
- package/dist/cjs/primitives/calculateID.js +0 -49
- package/dist/cjs/primitives/calculateID.js.map +0 -1
- package/dist/cjs/primitives/defaultVariableNames.d.ts +0 -3
- package/dist/cjs/primitives/defaultVariableNames.d.ts.map +0 -1
- package/dist/cjs/primitives/defaultVariableNames.js +0 -10
- package/dist/cjs/primitives/defaultVariableNames.js.map +0 -1
- package/dist/cjs/primitives/flattenDictionary.d.ts +0 -9
- package/dist/cjs/primitives/flattenDictionary.d.ts.map +0 -1
- package/dist/cjs/primitives/flattenDictionary.js +0 -29
- package/dist/cjs/primitives/flattenDictionary.js.map +0 -1
- package/dist/cjs/primitives/getDictionaryReference.d.ts +0 -8
- package/dist/cjs/primitives/getDictionaryReference.d.ts.map +0 -1
- package/dist/cjs/primitives/getDictionaryReference.js +0 -13
- package/dist/cjs/primitives/getDictionaryReference.js.map +0 -1
- package/dist/cjs/primitives/getPluralBranch.d.ts +0 -14
- package/dist/cjs/primitives/getPluralBranch.d.ts.map +0 -1
- package/dist/cjs/primitives/getPluralBranch.js +0 -88
- package/dist/cjs/primitives/getPluralBranch.js.map +0 -1
- package/dist/cjs/primitives/getValueBranch.d.ts +0 -9
- package/dist/cjs/primitives/getValueBranch.d.ts.map +0 -1
- package/dist/cjs/primitives/getValueBranch.js +0 -67
- package/dist/cjs/primitives/getValueBranch.js.map +0 -1
- package/dist/cjs/primitives/hasTransformation.d.ts +0 -3
- package/dist/cjs/primitives/hasTransformation.d.ts.map +0 -1
- package/dist/cjs/primitives/hasTransformation.js +0 -16
- package/dist/cjs/primitives/hasTransformation.js.map +0 -1
- package/dist/cjs/primitives/isPromise.d.ts +0 -7
- package/dist/cjs/primitives/isPromise.d.ts.map +0 -1
- package/dist/cjs/primitives/isPromise.js +0 -12
- package/dist/cjs/primitives/isPromise.js.map +0 -1
- package/dist/cjs/primitives/isValidReactNode.d.ts +0 -15
- package/dist/cjs/primitives/isValidReactNode.d.ts.map +0 -1
- package/dist/cjs/primitives/isValidReactNode.js +0 -27
- package/dist/cjs/primitives/isValidReactNode.js.map +0 -1
- package/dist/cjs/server/T.d.ts +0 -15
- package/dist/cjs/server/T.d.ts.map +0 -1
- package/dist/cjs/server/T.js +0 -101
- package/dist/cjs/server/T.js.map +0 -1
- package/dist/cjs/server/createTComponent.d.ts +0 -12
- package/dist/cjs/server/createTComponent.d.ts.map +0 -1
- package/dist/cjs/server/createTComponent.js +0 -31
- package/dist/cjs/server/createTComponent.js.map +0 -1
- package/dist/cjs/server/helpers/Resolver.d.ts +0 -5
- package/dist/cjs/server/helpers/Resolver.d.ts.map +0 -1
- package/dist/cjs/server/helpers/Resolver.js +0 -25
- package/dist/cjs/server/helpers/Resolver.js.map +0 -1
- package/dist/cjs/server/helpers/addGTIdentifier.d.ts +0 -11
- package/dist/cjs/server/helpers/addGTIdentifier.d.ts.map +0 -1
- package/dist/cjs/server/helpers/addGTIdentifier.js +0 -148
- package/dist/cjs/server/helpers/addGTIdentifier.js.map +0 -1
- package/dist/cjs/server/helpers/writeChildrenAsObjects.d.ts +0 -11
- package/dist/cjs/server/helpers/writeChildrenAsObjects.d.ts.map +0 -1
- package/dist/cjs/server/helpers/writeChildrenAsObjects.js +0 -116
- package/dist/cjs/server/helpers/writeChildrenAsObjects.js.map +0 -1
- package/dist/cjs/server/plural/InnerPlural.d.ts +0 -23
- package/dist/cjs/server/plural/InnerPlural.d.ts.map +0 -1
- package/dist/cjs/server/plural/InnerPlural.js +0 -34
- package/dist/cjs/server/plural/InnerPlural.js.map +0 -1
- package/dist/cjs/server/plural/createPluralComponent.d.ts +0 -12
- package/dist/cjs/server/plural/createPluralComponent.d.ts.map +0 -1
- package/dist/cjs/server/plural/createPluralComponent.js +0 -30
- package/dist/cjs/server/plural/createPluralComponent.js.map +0 -1
- package/dist/cjs/server/provider/GTProvider.d.ts +0 -14
- package/dist/cjs/server/provider/GTProvider.d.ts.map +0 -1
- package/dist/cjs/server/provider/GTProvider.js +0 -79
- package/dist/cjs/server/provider/GTProvider.js.map +0 -1
- package/dist/cjs/server/provider/createGTProviderComponent.d.ts +0 -11
- package/dist/cjs/server/provider/createGTProviderComponent.d.ts.map +0 -1
- package/dist/cjs/server/provider/createGTProviderComponent.js +0 -30
- package/dist/cjs/server/provider/createGTProviderComponent.js.map +0 -1
- package/dist/cjs/server/renderChildren.d.ts +0 -24
- package/dist/cjs/server/renderChildren.d.ts.map +0 -1
- package/dist/cjs/server/renderChildren.js +0 -177
- package/dist/cjs/server/renderChildren.js.map +0 -1
- package/dist/cjs/server/value/InnerValue.d.ts +0 -12
- package/dist/cjs/server/value/InnerValue.d.ts.map +0 -1
- package/dist/cjs/server/value/InnerValue.js +0 -30
- package/dist/cjs/server/value/InnerValue.js.map +0 -1
- package/dist/cjs/server/value/createValueComponent.d.ts +0 -13
- package/dist/cjs/server/value/createValueComponent.d.ts.map +0 -1
- package/dist/cjs/server/value/createValueComponent.js +0 -29
- package/dist/cjs/server/value/createValueComponent.js.map +0 -1
- package/dist/cjs/server/value/renderVariable.d.ts +0 -9
- package/dist/cjs/server/value/renderVariable.d.ts.map +0 -1
- package/dist/cjs/server/value/renderVariable.js +0 -66
- package/dist/cjs/server/value/renderVariable.js.map +0 -1
- package/dist/cjs/server/variables/Currency/Currency.d.ts +0 -15
- package/dist/cjs/server/variables/Currency/Currency.d.ts.map +0 -1
- package/dist/cjs/server/variables/Currency/Currency.js +0 -29
- package/dist/cjs/server/variables/Currency/Currency.js.map +0 -1
- package/dist/cjs/server/variables/Currency/createCurrencyComponent.d.ts +0 -8
- package/dist/cjs/server/variables/Currency/createCurrencyComponent.d.ts.map +0 -1
- package/dist/cjs/server/variables/Currency/createCurrencyComponent.js +0 -29
- package/dist/cjs/server/variables/Currency/createCurrencyComponent.js.map +0 -1
- package/dist/cjs/server/variables/DateTime/DateTime.d.ts +0 -13
- package/dist/cjs/server/variables/DateTime/DateTime.d.ts.map +0 -1
- package/dist/cjs/server/variables/DateTime/DateTime.js +0 -45
- package/dist/cjs/server/variables/DateTime/DateTime.js.map +0 -1
- package/dist/cjs/server/variables/DateTime/createDateTimeComponent.d.ts +0 -8
- package/dist/cjs/server/variables/DateTime/createDateTimeComponent.d.ts.map +0 -1
- package/dist/cjs/server/variables/DateTime/createDateTimeComponent.js +0 -29
- package/dist/cjs/server/variables/DateTime/createDateTimeComponent.js.map +0 -1
- package/dist/cjs/server/variables/Num/Num.d.ts +0 -14
- package/dist/cjs/server/variables/Num/Num.d.ts.map +0 -1
- package/dist/cjs/server/variables/Num/Num.js +0 -27
- package/dist/cjs/server/variables/Num/Num.js.map +0 -1
- package/dist/cjs/server/variables/Num/createNumComponent.d.ts +0 -8
- package/dist/cjs/server/variables/Num/createNumComponent.d.ts.map +0 -1
- package/dist/cjs/server/variables/Num/createNumComponent.js +0 -30
- package/dist/cjs/server/variables/Num/createNumComponent.js.map +0 -1
- package/dist/cjs/server/variables/Var/Var.d.ts +0 -12
- package/dist/cjs/server/variables/Var/Var.d.ts.map +0 -1
- package/dist/cjs/server/variables/Var/Var.js +0 -24
- package/dist/cjs/server/variables/Var/Var.js.map +0 -1
- package/dist/cjs/server/variables/Var/createVarComponent.d.ts +0 -7
- package/dist/cjs/server/variables/Var/createVarComponent.d.ts.map +0 -1
- package/dist/cjs/server/variables/Var/createVarComponent.js +0 -29
- package/dist/cjs/server/variables/Var/createVarComponent.js.map +0 -1
- package/dist/cjs/server.d.ts +0 -45
- package/dist/cjs/server.d.ts.map +0 -1
- package/dist/cjs/server.js +0 -148
- package/dist/cjs/server.js.map +0 -1
- package/dist/cjs/types/CreateGTProps.d.ts +0 -23
- package/dist/cjs/types/CreateGTProps.d.ts.map +0 -1
- package/dist/cjs/types/CreateGTProps.js +0 -3
- package/dist/cjs/types/CreateGTProps.js.map +0 -1
- package/dist/cjs/types/GeneralTranslationInterface.d.ts +0 -118
- package/dist/cjs/types/GeneralTranslationInterface.d.ts.map +0 -1
- package/dist/cjs/types/GeneralTranslationInterface.js +0 -3
- package/dist/cjs/types/GeneralTranslationInterface.js.map +0 -1
- package/dist/cjs/types/Variables.d.ts +0 -83
- package/dist/cjs/types/Variables.d.ts.map +0 -1
- package/dist/cjs/types/Variables.js +0 -3
- package/dist/cjs/types/Variables.js.map +0 -1
- package/dist/cjs/types/defaultGTProps.d.ts +0 -20
- package/dist/cjs/types/defaultGTProps.d.ts.map +0 -1
- package/dist/cjs/types/defaultGTProps.js +0 -31
- package/dist/cjs/types/defaultGTProps.js.map +0 -1
- package/dist/mjs/primitives/isPromise.d.ts +0 -7
- package/dist/mjs/primitives/isPromise.d.ts.map +0 -1
- package/dist/mjs/primitives/isPromise.js +0 -9
- package/dist/mjs/primitives/isPromise.js.map +0 -1
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RemoteDictionaryManager = void 0;
|
|
16
|
-
const getDictionaryReference_1 = __importDefault(require("../primitives/getDictionaryReference"));
|
|
17
|
-
/**
|
|
18
|
-
* Manages remote dictionaries for translation purposes.
|
|
19
|
-
*/
|
|
20
|
-
class RemoteDictionaryManager {
|
|
21
|
-
/**
|
|
22
|
-
* Creates an instance of RemoteDictionaryManager.
|
|
23
|
-
*/
|
|
24
|
-
constructor() {
|
|
25
|
-
this.config = {
|
|
26
|
-
cacheURL: "https://cache.gtx.dev",
|
|
27
|
-
projectID: ""
|
|
28
|
-
};
|
|
29
|
-
this.dictionaryMap = new Map();
|
|
30
|
-
this.fetchPromises = new Map();
|
|
31
|
-
this.requestedTranslations = new Map();
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Sets the configuration for the RemoteDictionaryManager.
|
|
35
|
-
* @param {Partial<RemoteDictionaryConfig>} newConfig - The new configuration to apply.
|
|
36
|
-
*/
|
|
37
|
-
setConfig(newConfig) {
|
|
38
|
-
this.config = Object.assign(Object.assign({}, this.config), newConfig);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Fetches a dictionary from the remote cache.
|
|
42
|
-
* @param {string} reference - The dictionary reference.
|
|
43
|
-
* @returns {Promise<Record<string, any> | null>} The fetched dictionary or null if not found.
|
|
44
|
-
*/
|
|
45
|
-
_fetchDictionary(reference) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
try {
|
|
48
|
-
const response = yield fetch(`${this.config.cacheURL}/${this.config.projectID}/${reference}`);
|
|
49
|
-
const result = yield response.json();
|
|
50
|
-
if (Object.keys(result).length) {
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
console.error('Remote dictionary error:', error);
|
|
56
|
-
}
|
|
57
|
-
return null;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Retrieves a dictionary based on locale and dictionary name.
|
|
62
|
-
* @param {string} locale - The locale of the dictionary.
|
|
63
|
-
* @param {string} dictionaryName - The name of the dictionary.
|
|
64
|
-
* @returns {Promise<Record<string, any> | null>} The dictionary data or null if not found.
|
|
65
|
-
*/
|
|
66
|
-
getDictionary(locale, dictionaryName) {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
const reference = (0, getDictionaryReference_1.default)(locale, dictionaryName);
|
|
69
|
-
if (this.dictionaryMap.has(reference)) {
|
|
70
|
-
return this.dictionaryMap.get(reference) || null;
|
|
71
|
-
}
|
|
72
|
-
if (this.fetchPromises.has(reference)) {
|
|
73
|
-
return (yield this.fetchPromises.get(reference)) || null;
|
|
74
|
-
}
|
|
75
|
-
const fetchPromise = this._fetchDictionary(reference);
|
|
76
|
-
this.fetchPromises.set(reference, fetchPromise);
|
|
77
|
-
const retrievedDictionary = yield fetchPromise;
|
|
78
|
-
this.fetchPromises.delete(reference);
|
|
79
|
-
if (retrievedDictionary) {
|
|
80
|
-
this.dictionaryMap.set(reference, retrievedDictionary);
|
|
81
|
-
}
|
|
82
|
-
return retrievedDictionary;
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Sets a new entry in the specified dictionary.
|
|
87
|
-
* @param {string} locale - The locale of the dictionary.
|
|
88
|
-
* @param {string} dictionaryName - The name of the dictionary.
|
|
89
|
-
* @param {string} key - The key for the new entry.
|
|
90
|
-
* @param {string} [id=key] - The id for the new entry, defaults to key if not provided.
|
|
91
|
-
* @param {any} translation - The translation value.
|
|
92
|
-
* @returns {boolean} True if the entry was set successfully, false otherwise.
|
|
93
|
-
*/
|
|
94
|
-
setDictionary(locale, dictionaryName, key, id = key, translation) {
|
|
95
|
-
if (!(locale && dictionaryName && key && id && translation))
|
|
96
|
-
return false;
|
|
97
|
-
const reference = (0, getDictionaryReference_1.default)(locale, dictionaryName);
|
|
98
|
-
const currentDictionary = this.dictionaryMap.get(reference) || {};
|
|
99
|
-
this.dictionaryMap.set(reference, Object.assign(Object.assign({}, currentDictionary), { [id]: { k: key, t: translation } }));
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Marks a translation as requested for a given locale and dictionary
|
|
104
|
-
*/
|
|
105
|
-
setTranslationRequested(locale, dictionaryName) {
|
|
106
|
-
const reference = (0, getDictionaryReference_1.default)(locale, dictionaryName);
|
|
107
|
-
this.requestedTranslations.set(reference, true);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Checks if a translation has been requested for a given locale and dictionary
|
|
111
|
-
*/
|
|
112
|
-
getTranslationRequested(locale, dictionaryName) {
|
|
113
|
-
const reference = (0, getDictionaryReference_1.default)(locale, dictionaryName);
|
|
114
|
-
return this.requestedTranslations.get(reference) ? true : false;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
exports.RemoteDictionaryManager = RemoteDictionaryManager;
|
|
118
|
-
const remoteDictionaryManager = new RemoteDictionaryManager();
|
|
119
|
-
exports.default = remoteDictionaryManager;
|
|
120
|
-
//# sourceMappingURL=RemoteDictionaryManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteDictionaryManager.js","sourceRoot":"","sources":["../../../src/config/RemoteDictionaryManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kGAA0E;AAU1E;;GAEG;AACH,MAAa,uBAAuB;IAMhC;;OAEG;IACH;QACI,IAAI,CAAC,MAAM,GAAG;YACV,QAAQ,EAAE,uBAAuB;YACjC,SAAS,EAAE,EAAE;SAChB,CAAC;QACF,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,qBAAqB,GAAG,IAAI,GAAG,EAAE,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,SAA0C;QAChD,IAAI,CAAC,MAAM,mCAAQ,IAAI,CAAC,MAAM,GAAK,SAAS,CAAE,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACW,gBAAgB,CAAC,SAAiB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GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC9D,kBAAe,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"determineLocale.d.ts","sourceRoot":"","sources":["../../../src/config/determineLocale.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,aAAa,GAAE,MAAW,GAAG,MAAM,CA4B3I"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = determineLocale;
|
|
4
|
-
const generaltranslation_1 = require("generaltranslation");
|
|
5
|
-
function determineLocale(approvedLocales, possibleLocales, defaultLocale = '') {
|
|
6
|
-
if (typeof possibleLocales === 'string')
|
|
7
|
-
possibleLocales = [possibleLocales];
|
|
8
|
-
if (!possibleLocales || !Array.isArray(possibleLocales))
|
|
9
|
-
return defaultLocale;
|
|
10
|
-
// if no approved locales, anything goes
|
|
11
|
-
if (!approvedLocales)
|
|
12
|
-
return possibleLocales[0];
|
|
13
|
-
// check for an exact match
|
|
14
|
-
for (const locale of possibleLocales) {
|
|
15
|
-
for (const approvedLocale of approvedLocales) {
|
|
16
|
-
if (locale === approvedLocale) {
|
|
17
|
-
return approvedLocale;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
// check for a linguistic match
|
|
22
|
-
for (const locale of possibleLocales) {
|
|
23
|
-
for (const approvedLocale of approvedLocales) {
|
|
24
|
-
if ((0, generaltranslation_1.isSameLanguage)(locale, approvedLocale)) {
|
|
25
|
-
return approvedLocale;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
// default
|
|
30
|
-
return defaultLocale;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=determineLocale.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"determineLocale.js","sourceRoot":"","sources":["../../../src/config/determineLocale.ts"],"names":[],"mappings":";;AAEA,kCA4BC;AA9BD,2DAAoD;AAEpD,SAAwB,eAAe,CAAC,eAA0B,EAAE,eAAmC,EAAE,gBAAwB,EAAE;IAE/H,IAAI,OAAO,eAAe,KAAK,QAAQ;QAAE,eAAe,GAAG,CAAC,eAAe,CAAC,CAAC;IAC7E,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC;QAAE,OAAO,aAAa,CAAC;IAE9E,wCAAwC;IACxC,IAAI,CAAC,eAAe;QAAE,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC;IAEhD,2BAA2B;IAC3B,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;QACnC,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE,CAAC;YAC3C,IAAI,MAAM,KAAK,cAAc,EAAE,CAAC;gBAC5B,OAAO,cAAc,CAAC;YAC1B,CAAC;QACL,CAAC;IACL,CAAC;IAED,+BAA+B;IAC/B,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;QACnC,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE,CAAC;YAC3C,IAAI,IAAA,mCAAc,EAAC,MAAM,EAAE,cAAc,CAAC,EAAE,CAAC;gBACzC,OAAO,cAAc,CAAC;YAC1B,CAAC;QACL,CAAC;IACL,CAAC;IAED,UAAU;IACV,OAAO,aAAa,CAAC;AACzB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the value of an environment variable as a string.
|
|
3
|
-
*
|
|
4
|
-
* This function checks if the `process` object is defined and if the specified environment
|
|
5
|
-
* variable is set. If both conditions are met, it returns the value of the environment
|
|
6
|
-
* variable. If not, it returns an empty string.
|
|
7
|
-
*
|
|
8
|
-
* @param {string} VARIABLE - The name of the environment variable to retrieve.
|
|
9
|
-
* @returns {string} The value of the environment variable, or an empty string if the variable is not set.
|
|
10
|
-
*/
|
|
11
|
-
export default function getDefaultFromEnv(VARIABLE: string): string;
|
|
12
|
-
//# sourceMappingURL=getDefaultFromEnv.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultFromEnv.d.ts","sourceRoot":"","sources":["../../../../src/config/local/getDefaultFromEnv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKlE"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = getDefaultFromEnv;
|
|
4
|
-
/**
|
|
5
|
-
* Retrieves the value of an environment variable as a string.
|
|
6
|
-
*
|
|
7
|
-
* This function checks if the `process` object is defined and if the specified environment
|
|
8
|
-
* variable is set. If both conditions are met, it returns the value of the environment
|
|
9
|
-
* variable. If not, it returns an empty string.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} VARIABLE - The name of the environment variable to retrieve.
|
|
12
|
-
* @returns {string} The value of the environment variable, or an empty string if the variable is not set.
|
|
13
|
-
*/
|
|
14
|
-
function getDefaultFromEnv(VARIABLE) {
|
|
15
|
-
var _a;
|
|
16
|
-
if (typeof process !== 'undefined' && ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a[VARIABLE])) {
|
|
17
|
-
return process.env[VARIABLE];
|
|
18
|
-
}
|
|
19
|
-
return '';
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=getDefaultFromEnv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultFromEnv.js","sourceRoot":"","sources":["../../../../src/config/local/getDefaultFromEnv.ts"],"names":[],"mappings":";;AAUA,oCAKC;AAfD;;;;;;;;;GASG;AACH,SAAwB,iBAAiB,CAAC,QAAgB;;IACtD,IAAI,OAAO,OAAO,KAAK,WAAW,KAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,0CAAG,QAAQ,CAAC,CAAA,EAAE,CAAC;QAC7D,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAW,CAAC;IAC3C,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDictFunction.d.ts","sourceRoot":"","sources":["../../../src/dictionary/createDictFunction.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAE5D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,UAAU,EAAE,iBAAiB,QACxD,MAAM,SAOrB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = createDictFunction;
|
|
4
|
-
function createDictFunction(I18NConfig) {
|
|
5
|
-
return (id) => {
|
|
6
|
-
const entry = I18NConfig.getDictionaryEntry(id);
|
|
7
|
-
if (Array.isArray(entry)) {
|
|
8
|
-
return entry[0];
|
|
9
|
-
}
|
|
10
|
-
return entry;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=createDictFunction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDictFunction.js","sourceRoot":"","sources":["../../../src/dictionary/createDictFunction.tsx"],"names":[],"mappings":";;AAEA,qCAQC;AARD,SAAwB,kBAAkB,CAAC,UAA6B;IACpE,OAAO,CAAC,EAAU,EAAE,EAAE;QAClB,MAAM,KAAK,GAAG,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QAChD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAA;AACL,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { tOptions } from "./createTFunction";
|
|
2
|
-
export default function createGetGTFunction(t: (id: string, options?: tOptions) => Promise<string> | JSX.Element): (id?: string) => (id: string, options?: tOptions) => Promise<string> | JSX.Element;
|
|
3
|
-
//# sourceMappingURL=createGetGTFunction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createGetGTFunction.d.ts","sourceRoot":"","sources":["../../../src/dictionary/createGetGTFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,SAC/F,MAAM,UAD6B,MAAM,YAAY,QAAQ,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAK/G"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = createGetGTFunction;
|
|
4
|
-
function createGetGTFunction(t) {
|
|
5
|
-
return (id) => {
|
|
6
|
-
let innerID = id;
|
|
7
|
-
return innerID ? (id, options) => t(`${innerID}.${id}`, options) : t;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=createGetGTFunction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createGetGTFunction.js","sourceRoot":"","sources":["../../../src/dictionary/createGetGTFunction.ts"],"names":[],"mappings":";;AAEA,sCAKC;AALD,SAAwB,mBAAmB,CAAC,CAAoE;IAC5G,OAAO,CAAC,EAAW,EAAE,EAAE;QACnB,IAAI,OAAO,GAAG,EAAE,CAAC;QACjB,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,EAAU,EAAE,OAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5F,CAAC,CAAA;AACL,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import I18NConfiguration from "../config/I18NConfiguration";
|
|
2
|
-
export type tOptions = {
|
|
3
|
-
n?: number;
|
|
4
|
-
values?: Record<string, any>;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
};
|
|
7
|
-
export default function createTFunction({ I18NConfig, T, intl }: {
|
|
8
|
-
I18NConfig: I18NConfiguration;
|
|
9
|
-
T: any;
|
|
10
|
-
intl: any;
|
|
11
|
-
}): (id: string, options?: tOptions) => JSX.Element | Promise<string>;
|
|
12
|
-
//# sourceMappingURL=createTFunction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTFunction.d.ts","sourceRoot":"","sources":["../../../src/dictionary/createTFunction.tsx"],"names":[],"mappings":"AACA,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAM5D,MAAM,MAAM,QAAQ,GAAG;IACnB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,UAAU,EAAE,iBAAiB,CAAC;IAAC,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,QACrG,MAAM,YAAY,QAAQ,KAAG,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA2EzE"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.default = createTFunction;
|
|
18
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
const InnerValue_1 = __importDefault(require("../server/value/InnerValue"));
|
|
20
|
-
const InnerPlural_1 = __importDefault(require("../server/plural/InnerPlural"));
|
|
21
|
-
const hasTransformation_1 = __importDefault(require("../primitives/hasTransformation"));
|
|
22
|
-
const isPromise_1 = __importDefault(require("../primitives/isPromise"));
|
|
23
|
-
function createTFunction({ I18NConfig, T, intl }) {
|
|
24
|
-
return (id, options) => {
|
|
25
|
-
let entry = I18NConfig.getDictionaryEntry(id);
|
|
26
|
-
if (Array.isArray(entry)) {
|
|
27
|
-
if (typeof entry[1] === 'object') {
|
|
28
|
-
options = Object.assign(Object.assign({}, entry[1]), options);
|
|
29
|
-
}
|
|
30
|
-
entry = entry[0];
|
|
31
|
-
}
|
|
32
|
-
if ((0, hasTransformation_1.default)(entry) || (0, isPromise_1.default)(entry)) {
|
|
33
|
-
return entry;
|
|
34
|
-
}
|
|
35
|
-
;
|
|
36
|
-
// Turn into an async function if the target is a string
|
|
37
|
-
if (typeof entry === 'string')
|
|
38
|
-
return intl(entry, Object.assign({ id }, options));
|
|
39
|
-
// If a plural or value is required
|
|
40
|
-
if (options) {
|
|
41
|
-
const locales = [I18NConfig.getLocale(), I18NConfig.getDefaultLocale()];
|
|
42
|
-
const { n, values, ranges, zero, one, two, few, many, other, singular, dual, plural } = options, tOptions = __rest(options, ["n", "values", "ranges", "zero", "one", "two", "few", "many", "other", "singular", "dual", "plural"]);
|
|
43
|
-
if (typeof n === 'number') {
|
|
44
|
-
const innerProps = {
|
|
45
|
-
n,
|
|
46
|
-
ranges,
|
|
47
|
-
zero: zero || (entry === null || entry === void 0 ? void 0 : entry.zero),
|
|
48
|
-
one: one || (entry === null || entry === void 0 ? void 0 : entry.one),
|
|
49
|
-
two: two || (entry === null || entry === void 0 ? void 0 : entry.two),
|
|
50
|
-
few: few || (entry === null || entry === void 0 ? void 0 : entry.few),
|
|
51
|
-
many: many || (entry === null || entry === void 0 ? void 0 : entry.many),
|
|
52
|
-
other: other || (entry === null || entry === void 0 ? void 0 : entry.other),
|
|
53
|
-
singular: singular || (entry === null || entry === void 0 ? void 0 : entry.singular),
|
|
54
|
-
dual: dual || (entry === null || entry === void 0 ? void 0 : entry.dual),
|
|
55
|
-
plural: plural || (entry === null || entry === void 0 ? void 0 : entry.plural)
|
|
56
|
-
};
|
|
57
|
-
if (values) {
|
|
58
|
-
// Plural + Value
|
|
59
|
-
return ((0, jsx_runtime_1.jsx)(T, Object.assign({ id: id }, tOptions, { children: (0, jsx_runtime_1.jsx)(InnerValue_1.default, { values: values, locales: locales, children: (0, jsx_runtime_1.jsx)(InnerPlural_1.default, Object.assign({ locales: locales }, innerProps, { children: entry })) }) })));
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
// Plural only
|
|
63
|
-
return ((0, jsx_runtime_1.jsx)(T, Object.assign({ id: id }, tOptions, { children: (0, jsx_runtime_1.jsx)(InnerPlural_1.default, Object.assign({ locales: locales }, innerProps, { children: entry })) })));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
else if (values) {
|
|
67
|
-
// Value only
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)(T, Object.assign({ id: id }, tOptions, { children: (0, jsx_runtime_1.jsx)(InnerValue_1.default, { values: values, locales: locales, children: entry }) })));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
// base case, just return T
|
|
72
|
-
return (0, jsx_runtime_1.jsx)(T, Object.assign({ id: id }, options, { children: entry }));
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=createTFunction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTFunction.js","sourceRoot":"","sources":["../../../src/dictionary/createTFunction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAaA,kCA4EC;;AAvFD,4EAA+C;AAC/C,+EAAkD;AAClD,wFAAgE;AAChE,wEAAgD;AAQhD,SAAwB,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAwD;IACjH,OAAO,CAAC,EAAU,EAAE,OAAkB,EAAiC,EAAE;QAErE,IAAI,KAAK,GAAG,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACvB,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC/B,OAAO,mCAAQ,KAAK,CAAC,CAAC,CAAC,GAAK,OAAO,CAAE,CAAA;YACzC,CAAC;YACD,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;QAED,IAAI,IAAA,2BAAiB,EAAC,KAAK,CAAC,IAAI,IAAA,mBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,OAAO,KAAK,CAAC;QACjB,CAAC;QAAA,CAAC;QAEF,w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-1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = getDictionaryEntry;
|
|
4
|
-
function getDictionaryEntry(id, dictionary) {
|
|
5
|
-
if (!id || typeof id !== 'string' || !dictionary || typeof dictionary !== 'object')
|
|
6
|
-
return null;
|
|
7
|
-
let current = dictionary;
|
|
8
|
-
let dictionaryPath = id.split(".");
|
|
9
|
-
for (const key of dictionaryPath) {
|
|
10
|
-
current = current === null || current === void 0 ? void 0 : current[key];
|
|
11
|
-
}
|
|
12
|
-
return current;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=getDictionaryEntry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDictionaryEntry.js","sourceRoot":"","sources":["../../../src/dictionary/getDictionaryEntry.ts"],"names":[],"mappings":";;AAAA,qCAQC;AARD,SAAwB,kBAAkB,CAAC,EAAU,EAAE,UAA+B;IAClF,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,CAAC,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAChG,IAAI,OAAO,GAAG,UAAU,CAAC;IACzB,IAAI,cAAc,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnC,KAAK,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;QAC/B,OAAO,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import calculateID from "./primitives/calculateID";
|
|
2
|
-
import flattenDictionary from "./primitives/flattenDictionary";
|
|
3
|
-
import addGTIdentifier from "./server/helpers/addGTIdentifier";
|
|
4
|
-
import writeChildrenAsObjects from "./server/helpers/writeChildrenAsObjects";
|
|
5
|
-
export { calculateID, flattenDictionary, writeChildrenAsObjects, addGTIdentifier };
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO,eAAe,MAAM,kCAAkC,CAAC;AAC/D,OAAO,sBAAsB,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EACH,WAAW,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,eAAe,EAC1E,CAAA"}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addGTIdentifier = exports.writeChildrenAsObjects = exports.flattenDictionary = exports.calculateID = void 0;
|
|
7
|
-
const calculateID_1 = __importDefault(require("./primitives/calculateID"));
|
|
8
|
-
exports.calculateID = calculateID_1.default;
|
|
9
|
-
const flattenDictionary_1 = __importDefault(require("./primitives/flattenDictionary"));
|
|
10
|
-
exports.flattenDictionary = flattenDictionary_1.default;
|
|
11
|
-
const addGTIdentifier_1 = __importDefault(require("./server/helpers/addGTIdentifier"));
|
|
12
|
-
exports.addGTIdentifier = addGTIdentifier_1.default;
|
|
13
|
-
const writeChildrenAsObjects_1 = __importDefault(require("./server/helpers/writeChildrenAsObjects"));
|
|
14
|
-
exports.writeChildrenAsObjects = writeChildrenAsObjects_1.default;
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,2EAAmD;AAK/C,sBALG,qBAAW,CAKH;AAJf,uFAA+D;AAI9C,4BAJV,2BAAiB,CAIU;AAHlC,uFAA+D;AAGH,0BAHrD,yBAAe,CAGqD;AAF3E,qGAA6E;AAEzC,iCAF7B,gCAAsB,CAE6B"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import I18NConfiguration from "../config/I18NConfiguration";
|
|
2
|
-
export default function createIntlFunction({ I18NConfig, ...defaultOptions }: {
|
|
3
|
-
I18NConfig: I18NConfiguration;
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}): (content: string, options?: Record<string, any>) => Promise<string>;
|
|
6
|
-
//# sourceMappingURL=createIntlFunction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createIntlFunction.d.ts","sourceRoot":"","sources":["../../../src/intl/createIntlFunction.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,6BAA6B,CAAA;AAG3D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACvC,UAAU,EAAE,GAAG,cAAc,EAChC,EAAE;IAAE,UAAU,EAAE,iBAAiB,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,aAEvC,MAAM,YAAW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAC9C,OAAO,CAAC,MAAM,CAAC,CAerB"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.default = createIntlFunction;
|
|
27
|
-
const calculateID_1 = __importDefault(require("../primitives/calculateID"));
|
|
28
|
-
function createIntlFunction(_a) {
|
|
29
|
-
var { I18NConfig } = _a, defaultOptions = __rest(_a, ["I18NConfig"]);
|
|
30
|
-
return (content_1, ...args_1) => __awaiter(this, [content_1, ...args_1], void 0, function* (content, options = Object.assign({}, defaultOptions)) {
|
|
31
|
-
options.targetLanguage = options.targetLanguage || I18NConfig.getLocale();
|
|
32
|
-
if (!content || typeof content !== 'string' || !I18NConfig.translationRequired(options.targetLanguage))
|
|
33
|
-
return content;
|
|
34
|
-
const key = yield (0, calculateID_1.default)(content);
|
|
35
|
-
const translation = yield I18NConfig.getTranslation(options.targetLanguage, key, options.id, options.dictionaryName);
|
|
36
|
-
if (translation)
|
|
37
|
-
return translation;
|
|
38
|
-
if (I18NConfig.automaticTranslationEnabled()) {
|
|
39
|
-
const translationPromise = I18NConfig.intl({ content, targetLanguage: options.targetLanguage, options: Object.assign(Object.assign({}, options), { hash: key }) });
|
|
40
|
-
const renderSettings = I18NConfig.getRenderSettings();
|
|
41
|
-
if (renderSettings.method !== "subtle") {
|
|
42
|
-
return yield translationPromise;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return content;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=createIntlFunction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createIntlFunction.js","sourceRoot":"","sources":["../../../src/intl/createIntlFunction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,qCAoBC;AAtBD,4EAAoD;AAEpD,SAAwB,kBAAkB,CAAC,EAEa;QAFb,EACvC,UAAU,OAC0C,EADrC,cAAc,cADU,cAE1C,CADgC;IAE7B,OAAO,uBAEY,EAAE,4DADjB,OAAe,EAAE,4BAAoC,cAAc,CAAE;QAErE,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;QAC1E,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAc,CAAC;YAAE,OAAO,OAAO,CAAC;QACvH,MAAM,GAAG,GAAG,MAAM,IAAA,qBAAW,EAAC,OAAO,CAAC,CAAC;QACvC,MAAM,WAAW,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QACrH,IAAI,WAAW;YAAE,OAAO,WAAW,CAAC;QACpC,IAAI,UAAU,CAAC,2BAA2B,EAAE,EAAE,CAAC;YAC3C,MAAM,kBAAkB,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,OAAO,kCAAO,OAAO,KAAE,IAAI,EAAE,GAAG,GAAE,EAAE,CAAC,CAAC;YACpI,MAAM,cAAc,GAAG,UAAU,CAAC,iBAAiB,EAAE,CAAA;YACrD,IAAI,cAAc,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACrC,OAAO,MAAM,kBAAkB,CAAC;YACpC,CAAC;QACL,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC,CAAA,CAAA;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cookieSettings.d.ts","sourceRoot":"","sources":["../../../src/middleware/cookieSettings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,8BAA8B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cookieSettings.js","sourceRoot":"","sources":["../../../src/middleware/cookieSettings.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,2BAA2B,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Middleware to set a cookie based on the locale.
|
|
3
|
-
* @param {NextRequest} req - The incoming request object.
|
|
4
|
-
*/
|
|
5
|
-
export default function createNextMiddleware({ defaultLocale, approvedLocales, localeRouting }?: {
|
|
6
|
-
defaultLocale: string;
|
|
7
|
-
approvedLocales?: string[];
|
|
8
|
-
localeRouting: boolean;
|
|
9
|
-
}): (req: any) => any;
|
|
10
|
-
//# sourceMappingURL=createNextMiddleware.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createNextMiddleware.d.ts","sourceRoot":"","sources":["../../../src/middleware/createNextMiddleware.ts"],"names":[],"mappings":"AAoDA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EACzC,aAAoB,EAAE,eAAe,EAAE,aAAoB,EAC9D,GAAE;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAChC,SAE7B,GAAG,SAoHnB"}
|