@intlayer/core 9.7.0 → 9.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/deepTransformPlugins/getEditedContent.cjs +2 -3
- package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs +5 -6
- package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs +4 -5
- package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs +3 -4
- package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs +3 -4
- package/dist/cjs/deepTransformPlugins/getMaskContent.cjs +2 -3
- package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs +3 -4
- package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs +3 -4
- package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs +2 -3
- package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs +2 -3
- package/dist/cjs/deepTransformPlugins/index.cjs +11 -11
- package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs +2 -3
- package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +2 -3
- package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs +7 -4
- package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs +2 -3
- package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs +2 -3
- package/dist/cjs/dictionaryManipulator/getNestedDictionaryReferences.cjs +1 -2
- package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +2 -3
- package/dist/cjs/dictionaryManipulator/getNodeType.cjs +3 -4
- package/dist/cjs/dictionaryManipulator/index.cjs +31 -21
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +3 -4
- package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs +4 -5
- package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs +4 -5
- package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +1 -2
- package/dist/cjs/dictionaryManipulator/plainDynamicLoader.cjs +1 -2
- package/dist/cjs/dictionaryManipulator/preloadedDynamicLoader.cjs +7 -3
- package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs +1 -2
- package/dist/cjs/dictionaryManipulator/qualifiedDictionaryDeclaration.cjs +2 -3
- package/dist/cjs/dictionaryManipulator/qualifiedDynamicLoader.cjs +8 -4
- package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +2 -3
- package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +2 -3
- package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs +2 -3
- package/dist/cjs/formatters/compact.cjs +2 -3
- package/dist/cjs/formatters/currency.cjs +2 -3
- package/dist/cjs/formatters/date.cjs +2 -3
- package/dist/cjs/formatters/index.cjs +9 -9
- package/dist/cjs/formatters/list.cjs +2 -3
- package/dist/cjs/formatters/number.cjs +2 -3
- package/dist/cjs/formatters/percentage.cjs +2 -3
- package/dist/cjs/formatters/relativeTime.cjs +2 -3
- package/dist/cjs/formatters/units.cjs +2 -3
- package/dist/cjs/index.cjs +129 -119
- package/dist/cjs/interpreter/dictionaryTransformCache.cjs +1 -2
- package/dist/cjs/interpreter/getCondition.cjs +1 -2
- package/dist/cjs/interpreter/getContent/deepTransform.cjs +2 -3
- package/dist/cjs/interpreter/getContent/getContent.cjs +3 -4
- package/dist/cjs/interpreter/getContent/index.cjs +3 -3
- package/dist/cjs/interpreter/getContent/plugins.cjs +17 -16
- package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
- package/dist/cjs/interpreter/getDictionary.cjs +5 -6
- package/dist/cjs/interpreter/getDictionaryAsync.cjs +7 -8
- package/dist/cjs/interpreter/getEnumeration.cjs +1 -2
- package/dist/cjs/interpreter/getGender.cjs +1 -2
- package/dist/cjs/interpreter/getHTML.cjs +1 -2
- package/dist/cjs/interpreter/getInsertion.cjs +1 -2
- package/dist/cjs/interpreter/getIntlayer.cjs +2 -3
- package/dist/cjs/interpreter/getIntlayerAsync.cjs +3 -4
- package/dist/cjs/interpreter/getNesting.cjs +2 -3
- package/dist/cjs/interpreter/getNesting.optimized.cjs +2 -3
- package/dist/cjs/interpreter/getPlural.cjs +2 -3
- package/dist/cjs/interpreter/getSelect.cjs +1 -2
- package/dist/cjs/interpreter/getTranslation.cjs +1 -2
- package/dist/cjs/interpreter/index.cjs +20 -20
- package/dist/cjs/interpreter/interpolableNode.cjs +3 -4
- package/dist/cjs/interpreter/resolveInterpreterLocale.cjs +2 -3
- package/dist/cjs/interpreter/splitAndJoinInsertion.cjs +1 -2
- package/dist/cjs/localization/comparePaths.cjs +3 -4
- package/dist/cjs/localization/domainUtils.cjs +1 -2
- package/dist/cjs/localization/generateSitemap.cjs +4 -5
- package/dist/cjs/localization/getBrowserLocale.cjs +3 -4
- package/dist/cjs/localization/getCanonicalPath.cjs +2 -3
- package/dist/cjs/localization/getHTMLTextDir.cjs +1 -2
- package/dist/cjs/localization/getLocale.cjs +4 -5
- package/dist/cjs/localization/getLocaleFromPath.cjs +3 -4
- package/dist/cjs/localization/getLocaleFromRequest.cjs +5 -6
- package/dist/cjs/localization/getLocaleLang.cjs +1 -2
- package/dist/cjs/localization/getLocaleName.cjs +2 -3
- package/dist/cjs/localization/getLocalizedPath.cjs +6 -7
- package/dist/cjs/localization/getLocalizedUrl.cjs +5 -6
- package/dist/cjs/localization/getMultilingualUrls.cjs +3 -4
- package/dist/cjs/localization/getPathWithoutLocale.cjs +2 -3
- package/dist/cjs/localization/getPrefix.cjs +2 -3
- package/dist/cjs/localization/index.cjs +24 -24
- package/dist/cjs/localization/localeDetector.cjs +2 -3
- package/dist/cjs/localization/localeMapper.cjs +2 -3
- package/dist/cjs/localization/localeResolver.cjs +1 -2
- package/dist/cjs/localization/proxyMode.cjs +2 -3
- package/dist/cjs/localization/resolveBrowserLocale.cjs +5 -6
- package/dist/cjs/localization/rewriteMatch.cjs +1 -2
- package/dist/cjs/localization/rewriteUtils.cjs +3 -4
- package/dist/cjs/localization/validatePrefix.cjs +2 -3
- package/dist/cjs/markdown/compiler.cjs +6 -7
- package/dist/cjs/markdown/constants.cjs +1 -2
- package/dist/cjs/markdown/elementScanner.cjs +1 -2
- package/dist/cjs/markdown/index.cjs +8 -8
- package/dist/cjs/markdown/parser.cjs +3 -4
- package/dist/cjs/markdown/renderer.cjs +1 -2
- package/dist/cjs/markdown/utils.cjs +2 -3
- package/dist/cjs/messageFormat/ICU.cjs +9 -10
- package/dist/cjs/messageFormat/i18next.cjs +9 -10
- package/dist/cjs/messageFormat/index.cjs +6 -6
- package/dist/cjs/messageFormat/navigatePath.cjs +1 -2
- package/dist/cjs/messageFormat/po.cjs +8 -9
- package/dist/cjs/messageFormat/resolveMessage.cjs +9 -10
- package/dist/cjs/messageFormat/verify-icu-format.cjs +5 -6
- package/dist/cjs/messageFormat/vue-i18n.cjs +5 -6
- package/dist/cjs/transpiler/condition/condition.cjs +1 -2
- package/dist/cjs/transpiler/condition/index.cjs +1 -1
- package/dist/cjs/transpiler/enumeration/enumeration.cjs +1 -2
- package/dist/cjs/transpiler/enumeration/index.cjs +1 -1
- package/dist/cjs/transpiler/file/file.cjs +1 -2
- package/dist/cjs/transpiler/file/fileBrowser.cjs +1 -2
- package/dist/cjs/transpiler/file/index.cjs +1 -1
- package/dist/cjs/transpiler/gender/gender.cjs +1 -2
- package/dist/cjs/transpiler/gender/index.cjs +1 -1
- package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs +1 -2
- package/dist/cjs/transpiler/html/html.cjs +3 -4
- package/dist/cjs/transpiler/html/htmlTags.cjs +1 -2
- package/dist/cjs/transpiler/html/index.cjs +3 -3
- package/dist/cjs/transpiler/html/validateHTML.cjs +1 -2
- package/dist/cjs/transpiler/index.cjs +15 -15
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +1 -2
- package/dist/cjs/transpiler/insertion/index.cjs +2 -2
- package/dist/cjs/transpiler/insertion/insertion.cjs +2 -3
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +2 -3
- package/dist/cjs/transpiler/markdown/index.cjs +3 -3
- package/dist/cjs/transpiler/markdown/markdown.cjs +5 -6
- package/dist/cjs/transpiler/markdown/validateMarkdown.cjs +2 -3
- package/dist/cjs/transpiler/nesting/index.cjs +1 -1
- package/dist/cjs/transpiler/nesting/nesting.cjs +1 -2
- package/dist/cjs/transpiler/plural/index.cjs +1 -1
- package/dist/cjs/transpiler/plural/plural.cjs +1 -2
- package/dist/cjs/transpiler/select/index.cjs +1 -1
- package/dist/cjs/transpiler/select/select.cjs +1 -2
- package/dist/cjs/transpiler/translation/index.cjs +1 -1
- package/dist/cjs/transpiler/translation/translation.cjs +1 -2
- package/dist/cjs/utils/checkIsURLAbsolute.cjs +1 -2
- package/dist/cjs/utils/cookieExpiry.cjs +1 -2
- package/dist/cjs/utils/getCookie.cjs +1 -2
- package/dist/cjs/utils/index.cjs +9 -9
- package/dist/cjs/utils/intl.cjs +2 -3
- package/dist/cjs/utils/intlayerNodePrototype.cjs +1 -2
- package/dist/cjs/utils/isSameKeyPath.cjs +1 -2
- package/dist/cjs/utils/isValidReactElement.cjs +1 -2
- package/dist/cjs/utils/localeStorage.cjs +3 -4
- package/dist/cjs/utils/parseYaml.cjs +1 -2
- package/dist/cjs/utils/stringifyYaml.cjs +1 -2
- package/dist/esm/deepTransformPlugins/getEditedContent.mjs +1 -2
- package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs +2 -3
- package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs +2 -3
- package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs +1 -2
- package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs +2 -3
- package/dist/esm/deepTransformPlugins/getMaskContent.mjs +1 -2
- package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs +1 -2
- package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs +1 -2
- package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs +1 -2
- package/dist/esm/deepTransformPlugins/getSplittedContent.mjs +1 -2
- package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs +1 -2
- package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs +1 -2
- package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs +6 -3
- package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getDefaultNode.mjs +1 -2
- package/dist/esm/dictionaryManipulator/getEmptyNode.mjs +1 -2
- package/dist/esm/dictionaryManipulator/getNestedDictionaryReferences.mjs +1 -2
- package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +1 -2
- package/dist/esm/dictionaryManipulator/getNodeType.mjs +1 -2
- package/dist/esm/dictionaryManipulator/index.mjs +6 -6
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +1 -2
- package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs +2 -3
- package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs +2 -3
- package/dist/esm/dictionaryManipulator/orderDictionaries.mjs +1 -2
- package/dist/esm/dictionaryManipulator/plainDynamicLoader.mjs +1 -2
- package/dist/esm/dictionaryManipulator/preloadedDynamicLoader.mjs +1 -2
- package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs +1 -2
- package/dist/esm/dictionaryManipulator/qualifiedDictionaryDeclaration.mjs +1 -2
- package/dist/esm/dictionaryManipulator/qualifiedDynamicLoader.mjs +1 -2
- package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs +1 -2
- package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs +1 -2
- package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs +1 -2
- package/dist/esm/formatters/compact.mjs +1 -2
- package/dist/esm/formatters/currency.mjs +1 -2
- package/dist/esm/formatters/date.mjs +1 -2
- package/dist/esm/formatters/list.mjs +1 -2
- package/dist/esm/formatters/number.mjs +1 -2
- package/dist/esm/formatters/percentage.mjs +1 -2
- package/dist/esm/formatters/relativeTime.mjs +1 -2
- package/dist/esm/formatters/units.mjs +1 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/interpreter/dictionaryTransformCache.mjs +1 -2
- package/dist/esm/interpreter/getCondition.mjs +1 -2
- package/dist/esm/interpreter/getContent/deepTransform.mjs +1 -2
- package/dist/esm/interpreter/getContent/getContent.mjs +1 -2
- package/dist/esm/interpreter/getContent/index.mjs +1 -1
- package/dist/esm/interpreter/getContent/plugins.mjs +6 -5
- package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
- package/dist/esm/interpreter/getDictionary.mjs +3 -4
- package/dist/esm/interpreter/getDictionaryAsync.mjs +5 -6
- package/dist/esm/interpreter/getEnumeration.mjs +1 -2
- package/dist/esm/interpreter/getGender.mjs +1 -2
- package/dist/esm/interpreter/getHTML.mjs +1 -2
- package/dist/esm/interpreter/getInsertion.mjs +1 -2
- package/dist/esm/interpreter/getIntlayer.mjs +1 -2
- package/dist/esm/interpreter/getIntlayerAsync.mjs +2 -3
- package/dist/esm/interpreter/getNesting.mjs +1 -2
- package/dist/esm/interpreter/getNesting.optimized.mjs +1 -2
- package/dist/esm/interpreter/getPlural.mjs +1 -2
- package/dist/esm/interpreter/getSelect.mjs +1 -2
- package/dist/esm/interpreter/getTranslation.mjs +1 -2
- package/dist/esm/interpreter/index.mjs +7 -7
- package/dist/esm/interpreter/interpolableNode.mjs +1 -2
- package/dist/esm/interpreter/resolveInterpreterLocale.mjs +1 -2
- package/dist/esm/interpreter/splitAndJoinInsertion.mjs +1 -2
- package/dist/esm/localization/comparePaths.mjs +1 -2
- package/dist/esm/localization/domainUtils.mjs +1 -2
- package/dist/esm/localization/generateSitemap.mjs +2 -3
- package/dist/esm/localization/getBrowserLocale.mjs +1 -2
- package/dist/esm/localization/getCanonicalPath.mjs +1 -2
- package/dist/esm/localization/getHTMLTextDir.mjs +1 -2
- package/dist/esm/localization/getLocale.mjs +2 -3
- package/dist/esm/localization/getLocaleFromPath.mjs +1 -2
- package/dist/esm/localization/getLocaleFromRequest.mjs +2 -3
- package/dist/esm/localization/getLocaleLang.mjs +1 -2
- package/dist/esm/localization/getLocaleName.mjs +1 -2
- package/dist/esm/localization/getLocalizedPath.mjs +3 -4
- package/dist/esm/localization/getLocalizedUrl.mjs +2 -3
- package/dist/esm/localization/getMultilingualUrls.mjs +2 -3
- package/dist/esm/localization/getPathWithoutLocale.mjs +1 -2
- package/dist/esm/localization/getPrefix.mjs +1 -2
- package/dist/esm/localization/index.mjs +10 -10
- package/dist/esm/localization/localeDetector.mjs +1 -2
- package/dist/esm/localization/localeMapper.mjs +1 -2
- package/dist/esm/localization/localeResolver.mjs +1 -2
- package/dist/esm/localization/proxyMode.mjs +1 -2
- package/dist/esm/localization/resolveBrowserLocale.mjs +2 -3
- package/dist/esm/localization/rewriteMatch.mjs +1 -2
- package/dist/esm/localization/rewriteUtils.mjs +2 -3
- package/dist/esm/localization/validatePrefix.mjs +1 -2
- package/dist/esm/markdown/compiler.mjs +2 -3
- package/dist/esm/markdown/constants.mjs +1 -2
- package/dist/esm/markdown/elementScanner.mjs +1 -2
- package/dist/esm/markdown/index.mjs +2 -2
- package/dist/esm/markdown/parser.mjs +1 -2
- package/dist/esm/markdown/renderer.mjs +1 -2
- package/dist/esm/markdown/utils.mjs +1 -2
- package/dist/esm/messageFormat/ICU.mjs +1 -2
- package/dist/esm/messageFormat/i18next.mjs +1 -2
- package/dist/esm/messageFormat/index.mjs +1 -1
- package/dist/esm/messageFormat/navigatePath.mjs +1 -2
- package/dist/esm/messageFormat/po.mjs +1 -2
- package/dist/esm/messageFormat/resolveMessage.mjs +2 -3
- package/dist/esm/messageFormat/verify-icu-format.mjs +1 -2
- package/dist/esm/messageFormat/vue-i18n.mjs +1 -2
- package/dist/esm/transpiler/condition/condition.mjs +1 -2
- package/dist/esm/transpiler/enumeration/enumeration.mjs +1 -2
- package/dist/esm/transpiler/file/file.mjs +1 -2
- package/dist/esm/transpiler/file/fileBrowser.mjs +1 -2
- package/dist/esm/transpiler/gender/gender.mjs +1 -2
- package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs +1 -2
- package/dist/esm/transpiler/html/html.mjs +1 -2
- package/dist/esm/transpiler/html/htmlTags.mjs +1 -2
- package/dist/esm/transpiler/html/index.mjs +1 -1
- package/dist/esm/transpiler/html/validateHTML.mjs +1 -2
- package/dist/esm/transpiler/index.mjs +1 -1
- package/dist/esm/transpiler/insertion/getInsertionValues.mjs +1 -2
- package/dist/esm/transpiler/insertion/insertion.mjs +1 -2
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +1 -2
- package/dist/esm/transpiler/markdown/index.mjs +1 -1
- package/dist/esm/transpiler/markdown/markdown.mjs +1 -2
- package/dist/esm/transpiler/markdown/validateMarkdown.mjs +1 -2
- package/dist/esm/transpiler/nesting/nesting.mjs +1 -2
- package/dist/esm/transpiler/plural/plural.mjs +1 -2
- package/dist/esm/transpiler/select/select.mjs +1 -2
- package/dist/esm/transpiler/translation/translation.mjs +1 -2
- package/dist/esm/utils/checkIsURLAbsolute.mjs +1 -2
- package/dist/esm/utils/cookieExpiry.mjs +1 -2
- package/dist/esm/utils/getCookie.mjs +1 -2
- package/dist/esm/utils/index.mjs +4 -4
- package/dist/esm/utils/intl.mjs +1 -2
- package/dist/esm/utils/intlayerNodePrototype.mjs +1 -2
- package/dist/esm/utils/isSameKeyPath.mjs +1 -2
- package/dist/esm/utils/isValidReactElement.mjs +1 -2
- package/dist/esm/utils/localeStorage.mjs +1 -2
- package/dist/esm/utils/parseYaml.mjs +1 -2
- package/dist/esm/utils/stringifyYaml.mjs +1 -2
- package/dist/types/deepTransformPlugins/getEditedContent.d.ts +0 -2
- package/dist/types/deepTransformPlugins/getEditedContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +0 -2
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +0 -2
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +0 -2
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts +0 -2
- package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getMaskContent.d.ts +0 -2
- package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts +0 -2
- package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts +0 -2
- package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts +0 -2
- package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getSplittedContent.d.ts +1 -2
- package/dist/types/deepTransformPlugins/getSplittedContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/index.d.ts +1 -1
- package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts +0 -2
- package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts +0 -2
- package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts +0 -2
- package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +0 -2
- package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getEmptyNode.d.ts +0 -2
- package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getNestedDictionaryReferences.d.ts +0 -2
- package/dist/types/dictionaryManipulator/getNestedDictionaryReferences.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getNodeChildren.d.ts +0 -2
- package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getNodeType.d.ts +0 -2
- package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/index.d.ts +2 -2
- package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts +0 -2
- package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts +0 -2
- package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts +0 -2
- package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +0 -2
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/plainDynamicLoader.d.ts +0 -2
- package/dist/types/dictionaryManipulator/plainDynamicLoader.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/preloadedDynamicLoader.d.ts +0 -2
- package/dist/types/dictionaryManipulator/preloadedDynamicLoader.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts +0 -2
- package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/qualifiedDictionaryDeclaration.d.ts +0 -2
- package/dist/types/dictionaryManipulator/qualifiedDictionaryDeclaration.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/qualifiedDynamicLoader.d.ts +0 -2
- package/dist/types/dictionaryManipulator/qualifiedDynamicLoader.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts +0 -2
- package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts +0 -2
- package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts +0 -2
- package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts.map +1 -1
- package/dist/types/formatters/compact.d.ts +0 -2
- package/dist/types/formatters/compact.d.ts.map +1 -1
- package/dist/types/formatters/currency.d.ts +0 -2
- package/dist/types/formatters/currency.d.ts.map +1 -1
- package/dist/types/formatters/date.d.ts +0 -2
- package/dist/types/formatters/date.d.ts.map +1 -1
- package/dist/types/formatters/index.d.ts +1 -1
- package/dist/types/formatters/list.d.ts +0 -2
- package/dist/types/formatters/list.d.ts.map +1 -1
- package/dist/types/formatters/number.d.ts +0 -2
- package/dist/types/formatters/number.d.ts.map +1 -1
- package/dist/types/formatters/percentage.d.ts +0 -2
- package/dist/types/formatters/percentage.d.ts.map +1 -1
- package/dist/types/formatters/relativeTime.d.ts +1 -2
- package/dist/types/formatters/relativeTime.d.ts.map +1 -1
- package/dist/types/formatters/units.d.ts +0 -2
- package/dist/types/formatters/units.d.ts.map +1 -1
- package/dist/types/index.d.ts +8 -8
- package/dist/types/interpreter/dictionaryTransformCache.d.ts +0 -2
- package/dist/types/interpreter/dictionaryTransformCache.d.ts.map +1 -1
- package/dist/types/interpreter/getCondition.d.ts +0 -2
- package/dist/types/interpreter/getCondition.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/deepTransform.d.ts +0 -2
- package/dist/types/interpreter/getContent/deepTransform.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/getContent.d.ts +0 -2
- package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/index.d.ts +1 -1
- package/dist/types/interpreter/getContent/plugins.d.ts +8 -5
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
- package/dist/types/interpreter/getDictionary.d.ts +0 -2
- package/dist/types/interpreter/getDictionary.d.ts.map +1 -1
- package/dist/types/interpreter/getDictionaryAsync.d.ts +1 -3
- package/dist/types/interpreter/getDictionaryAsync.d.ts.map +1 -1
- package/dist/types/interpreter/getEnumeration.d.ts +0 -2
- package/dist/types/interpreter/getEnumeration.d.ts.map +1 -1
- package/dist/types/interpreter/getGender.d.ts +1 -2
- package/dist/types/interpreter/getGender.d.ts.map +1 -1
- package/dist/types/interpreter/getHTML.d.ts +1 -2
- package/dist/types/interpreter/getHTML.d.ts.map +1 -1
- package/dist/types/interpreter/getInsertion.d.ts +0 -2
- package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
- package/dist/types/interpreter/getIntlayer.d.ts +0 -2
- package/dist/types/interpreter/getIntlayer.d.ts.map +1 -1
- package/dist/types/interpreter/getIntlayerAsync.d.ts +0 -2
- package/dist/types/interpreter/getIntlayerAsync.d.ts.map +1 -1
- package/dist/types/interpreter/getNesting.d.ts +0 -2
- package/dist/types/interpreter/getNesting.d.ts.map +1 -1
- package/dist/types/interpreter/getNesting.optimized.d.ts +2 -4
- package/dist/types/interpreter/getNesting.optimized.d.ts.map +1 -1
- package/dist/types/interpreter/getPlural.d.ts +0 -2
- package/dist/types/interpreter/getPlural.d.ts.map +1 -1
- package/dist/types/interpreter/getSelect.d.ts +0 -2
- package/dist/types/interpreter/getSelect.d.ts.map +1 -1
- package/dist/types/interpreter/getTranslation.d.ts +0 -2
- package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
- package/dist/types/interpreter/index.d.ts +3 -3
- package/dist/types/interpreter/interpolableNode.d.ts +0 -2
- package/dist/types/interpreter/interpolableNode.d.ts.map +1 -1
- package/dist/types/interpreter/resolveInterpreterLocale.d.ts +0 -2
- package/dist/types/interpreter/resolveInterpreterLocale.d.ts.map +1 -1
- package/dist/types/interpreter/splitAndJoinInsertion.d.ts +0 -2
- package/dist/types/interpreter/splitAndJoinInsertion.d.ts.map +1 -1
- package/dist/types/localization/comparePaths.d.ts +0 -2
- package/dist/types/localization/comparePaths.d.ts.map +1 -1
- package/dist/types/localization/domainUtils.d.ts +0 -2
- package/dist/types/localization/domainUtils.d.ts.map +1 -1
- package/dist/types/localization/generateSitemap.d.ts +0 -2
- package/dist/types/localization/generateSitemap.d.ts.map +1 -1
- package/dist/types/localization/getBrowserLocale.d.ts +1 -2
- package/dist/types/localization/getBrowserLocale.d.ts.map +1 -1
- package/dist/types/localization/getCanonicalPath.d.ts +0 -2
- package/dist/types/localization/getCanonicalPath.d.ts.map +1 -1
- package/dist/types/localization/getHTMLTextDir.d.ts +1 -2
- package/dist/types/localization/getHTMLTextDir.d.ts.map +1 -1
- package/dist/types/localization/getLocale.d.ts +0 -2
- package/dist/types/localization/getLocale.d.ts.map +1 -1
- package/dist/types/localization/getLocaleFromPath.d.ts +0 -2
- package/dist/types/localization/getLocaleFromPath.d.ts.map +1 -1
- package/dist/types/localization/getLocaleFromRequest.d.ts +0 -2
- package/dist/types/localization/getLocaleFromRequest.d.ts.map +1 -1
- package/dist/types/localization/getLocaleLang.d.ts +0 -2
- package/dist/types/localization/getLocaleLang.d.ts.map +1 -1
- package/dist/types/localization/getLocaleName.d.ts +0 -2
- package/dist/types/localization/getLocaleName.d.ts.map +1 -1
- package/dist/types/localization/getLocalizedPath.d.ts +0 -2
- package/dist/types/localization/getLocalizedPath.d.ts.map +1 -1
- package/dist/types/localization/getLocalizedUrl.d.ts +0 -2
- package/dist/types/localization/getLocalizedUrl.d.ts.map +1 -1
- package/dist/types/localization/getMultilingualUrls.d.ts +0 -2
- package/dist/types/localization/getMultilingualUrls.d.ts.map +1 -1
- package/dist/types/localization/getPathWithoutLocale.d.ts +0 -2
- package/dist/types/localization/getPathWithoutLocale.d.ts.map +1 -1
- package/dist/types/localization/getPrefix.d.ts +0 -2
- package/dist/types/localization/getPrefix.d.ts.map +1 -1
- package/dist/types/localization/index.d.ts +1 -1
- package/dist/types/localization/localeDetector.d.ts +0 -2
- package/dist/types/localization/localeDetector.d.ts.map +1 -1
- package/dist/types/localization/localeMapper.d.ts +0 -2
- package/dist/types/localization/localeMapper.d.ts.map +1 -1
- package/dist/types/localization/localeResolver.d.ts +0 -2
- package/dist/types/localization/localeResolver.d.ts.map +1 -1
- package/dist/types/localization/proxyMode.d.ts +0 -2
- package/dist/types/localization/proxyMode.d.ts.map +1 -1
- package/dist/types/localization/resolveBrowserLocale.d.ts +0 -2
- package/dist/types/localization/resolveBrowserLocale.d.ts.map +1 -1
- package/dist/types/localization/rewriteMatch.d.ts +0 -2
- package/dist/types/localization/rewriteMatch.d.ts.map +1 -1
- package/dist/types/localization/rewriteUtils.d.ts +1 -2
- package/dist/types/localization/rewriteUtils.d.ts.map +1 -1
- package/dist/types/localization/validatePrefix.d.ts +0 -2
- package/dist/types/localization/validatePrefix.d.ts.map +1 -1
- package/dist/types/markdown/compiler.d.ts +2 -3
- package/dist/types/markdown/compiler.d.ts.map +1 -1
- package/dist/types/markdown/constants.d.ts +0 -2
- package/dist/types/markdown/constants.d.ts.map +1 -1
- package/dist/types/markdown/elementScanner.d.ts +0 -2
- package/dist/types/markdown/elementScanner.d.ts.map +1 -1
- package/dist/types/markdown/index.d.ts +2 -2
- package/dist/types/markdown/parser.d.ts +0 -2
- package/dist/types/markdown/parser.d.ts.map +1 -1
- package/dist/types/markdown/renderer.d.ts +0 -2
- package/dist/types/markdown/renderer.d.ts.map +1 -1
- package/dist/types/markdown/types.d.ts +0 -2
- package/dist/types/markdown/types.d.ts.map +1 -1
- package/dist/types/markdown/utils.d.ts +1 -2
- package/dist/types/markdown/utils.d.ts.map +1 -1
- package/dist/types/messageFormat/ICU.d.ts +0 -2
- package/dist/types/messageFormat/ICU.d.ts.map +1 -1
- package/dist/types/messageFormat/i18next.d.ts +0 -2
- package/dist/types/messageFormat/i18next.d.ts.map +1 -1
- package/dist/types/messageFormat/navigatePath.d.ts +0 -2
- package/dist/types/messageFormat/navigatePath.d.ts.map +1 -1
- package/dist/types/messageFormat/po.d.ts +0 -2
- package/dist/types/messageFormat/po.d.ts.map +1 -1
- package/dist/types/messageFormat/resolveMessage.d.ts +0 -2
- package/dist/types/messageFormat/resolveMessage.d.ts.map +1 -1
- package/dist/types/messageFormat/vue-i18n.d.ts +0 -2
- package/dist/types/messageFormat/vue-i18n.d.ts.map +1 -1
- package/dist/types/transpiler/condition/condition.d.ts +0 -2
- package/dist/types/transpiler/condition/condition.d.ts.map +1 -1
- package/dist/types/transpiler/enumeration/enumeration.d.ts +0 -2
- package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -1
- package/dist/types/transpiler/file/file.d.ts +0 -2
- package/dist/types/transpiler/file/file.d.ts.map +1 -1
- package/dist/types/transpiler/file/fileBrowser.d.ts +0 -2
- package/dist/types/transpiler/file/fileBrowser.d.ts.map +1 -1
- package/dist/types/transpiler/gender/gender.d.ts +0 -2
- package/dist/types/transpiler/gender/gender.d.ts.map +1 -1
- package/dist/types/transpiler/html/getHTMLCustomComponents.d.ts +0 -2
- package/dist/types/transpiler/html/getHTMLCustomComponents.d.ts.map +1 -1
- package/dist/types/transpiler/html/html.d.ts +1 -2
- package/dist/types/transpiler/html/html.d.ts.map +1 -1
- package/dist/types/transpiler/html/htmlTags.d.ts +0 -2
- package/dist/types/transpiler/html/htmlTags.d.ts.map +1 -1
- package/dist/types/transpiler/html/validateHTML.d.ts +0 -2
- package/dist/types/transpiler/html/validateHTML.d.ts.map +1 -1
- package/dist/types/transpiler/insertion/getInsertionValues.d.ts +0 -2
- package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +1 -1
- package/dist/types/transpiler/insertion/insertion.d.ts +0 -2
- package/dist/types/transpiler/insertion/insertion.d.ts.map +1 -1
- package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts +0 -2
- package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +1 -1
- package/dist/types/transpiler/markdown/markdown.d.ts +0 -2
- package/dist/types/transpiler/markdown/markdown.d.ts.map +1 -1
- package/dist/types/transpiler/markdown/validateMarkdown.d.ts +0 -2
- package/dist/types/transpiler/markdown/validateMarkdown.d.ts.map +1 -1
- package/dist/types/transpiler/nesting/nesting.d.ts +0 -2
- package/dist/types/transpiler/nesting/nesting.d.ts.map +1 -1
- package/dist/types/transpiler/plural/plural.d.ts +0 -2
- package/dist/types/transpiler/plural/plural.d.ts.map +1 -1
- package/dist/types/transpiler/select/select.d.ts +0 -2
- package/dist/types/transpiler/select/select.d.ts.map +1 -1
- package/dist/types/transpiler/translation/translation.d.ts +0 -2
- package/dist/types/transpiler/translation/translation.d.ts.map +1 -1
- package/dist/types/utils/checkIsURLAbsolute.d.ts +0 -2
- package/dist/types/utils/checkIsURLAbsolute.d.ts.map +1 -1
- package/dist/types/utils/cookieExpiry.d.ts +0 -2
- package/dist/types/utils/cookieExpiry.d.ts.map +1 -1
- package/dist/types/utils/getCookie.d.ts +0 -2
- package/dist/types/utils/getCookie.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/intl.d.ts +0 -2
- package/dist/types/utils/intl.d.ts.map +1 -1
- package/dist/types/utils/intlayerNodePrototype.d.ts +0 -2
- package/dist/types/utils/intlayerNodePrototype.d.ts.map +1 -1
- package/dist/types/utils/isSameKeyPath.d.ts +0 -2
- package/dist/types/utils/isSameKeyPath.d.ts.map +1 -1
- package/dist/types/utils/isValidReactElement.d.ts +0 -2
- package/dist/types/utils/isValidReactElement.d.ts.map +1 -1
- package/dist/types/utils/localeStorage.d.ts +0 -2
- package/dist/types/utils/localeStorage.d.ts.map +1 -1
- package/dist/types/utils/parseYaml.d.ts +0 -2
- package/dist/types/utils/parseYaml.d.ts.map +1 -1
- package/dist/types/utils/stringifyYaml.d.ts +0 -2
- package/dist/types/utils/stringifyYaml.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/dictionaryManipulator/getNodeChildren.ts
|
|
4
4
|
const getNodeChildren = (section) => {
|
|
5
5
|
if (typeof section === "string") return section;
|
|
6
6
|
if (typeof section === "number") return section;
|
|
@@ -18,6 +18,5 @@ const getNodeChildren = (section) => {
|
|
|
18
18
|
return section;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
//#endregion
|
|
22
21
|
export { getNodeChildren };
|
|
23
22
|
//# sourceMappingURL=getNodeChildren.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isValidElement } from "../utils/isValidReactElement.mjs";
|
|
2
2
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/dictionaryManipulator/getNodeType.ts
|
|
5
5
|
/**
|
|
6
6
|
* Type guard to check if content is a TypedNode
|
|
7
7
|
*/
|
|
@@ -57,6 +57,5 @@ const getNodeType = (content) => {
|
|
|
57
57
|
return NodeTypes.UNKNOWN;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
//#endregion
|
|
61
60
|
export { getNodeType };
|
|
62
61
|
//# sourceMappingURL=getNodeType.mjs.map
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID, getDictionarySelectorCacheKey, isQualifiedDictionaryGroup, parseDictionarySelector, reconstructQualifiedEntry, resolveDictionaryArgument, resolveEffectiveVariantId, resolveProviderVariant, resolveQualifiedDictionary, serializeVariant, serializeVariantChain } from "./qualifiedDictionary.mjs";
|
|
2
|
-
import { PRELOADED_DYNAMIC_KEY, getPreloadedDictionary } from "./preloadedDynamicLoader.mjs";
|
|
3
|
-
import { QUALIFIER_DYNAMIC_TYPES_KEY, isQualifiedDynamicLoaderMap, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync } from "./qualifiedDynamicLoader.mjs";
|
|
4
|
-
import { findPlainDynamicLoader, resolvePlainDynamicLoader } from "./plainDynamicLoader.mjs";
|
|
5
1
|
import { editDictionaryByKeyPath } from "./editDictionaryByKeyPath.mjs";
|
|
6
2
|
import { getContentNodeByKeyPath } from "./getContentNodeByKeyPath.mjs";
|
|
7
3
|
import { getDefaultNode } from "./getDefaultNode.mjs";
|
|
@@ -10,10 +6,14 @@ import { getNestedDictionaryGraph, getNestedDictionaryKeys, getNestedDictionaryR
|
|
|
10
6
|
import { getNodeChildren } from "./getNodeChildren.mjs";
|
|
11
7
|
import { getNodeType } from "./getNodeType.mjs";
|
|
12
8
|
import { mergeDictionaries } from "./mergeDictionaries.mjs";
|
|
13
|
-
import { QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getVariantIds } from "./qualifiedDictionaryDeclaration.mjs";
|
|
14
9
|
import { mergeQualifiedDictionaries } from "./mergeQualifiedDictionaries.mjs";
|
|
15
|
-
import { orderDictionaries } from "./orderDictionaries.mjs";
|
|
16
10
|
import { normalizeDictionaries, normalizeDictionary } from "./normalizeDictionary.mjs";
|
|
11
|
+
import { orderDictionaries } from "./orderDictionaries.mjs";
|
|
12
|
+
import { findPlainDynamicLoader, resolvePlainDynamicLoader } from "./plainDynamicLoader.mjs";
|
|
13
|
+
import { PRELOADED_DYNAMIC_KEY, getPreloadedDictionary } from "./preloadedDynamicLoader.mjs";
|
|
14
|
+
import { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID, getDictionarySelectorCacheKey, isQualifiedDictionaryGroup, parseDictionarySelector, reconstructQualifiedEntry, resolveDictionaryArgument, resolveEffectiveVariantId, resolveProviderVariant, resolveQualifiedDictionary, serializeVariant, serializeVariantChain } from "./qualifiedDictionary.mjs";
|
|
15
|
+
import { QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getVariantIds } from "./qualifiedDictionaryDeclaration.mjs";
|
|
16
|
+
import { QUALIFIER_DYNAMIC_TYPES_KEY, isQualifiedDynamicLoaderMap, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync } from "./qualifiedDynamicLoader.mjs";
|
|
17
17
|
import { removeContentNodeByKeyPath } from "./removeContentNodeByKeyPath.mjs";
|
|
18
18
|
import { renameContentNodeByKeyPath } from "./renameContentNodeByKeyPath.mjs";
|
|
19
19
|
import { updateNodeChildren } from "./updateNodeChildren.mjs";
|
|
@@ -3,7 +3,7 @@ import { getNodeType } from "./getNodeType.mjs";
|
|
|
3
3
|
import { log } from "@intlayer/config/built";
|
|
4
4
|
import { colorizeKey, getAppLogger } from "@intlayer/config/logger";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/dictionaryManipulator/mergeDictionaries.ts
|
|
7
7
|
const checkTypesMatch = (object1, object2, object2LocalId, dictionaryKey, path = []) => {
|
|
8
8
|
const appLogger = getAppLogger({ log });
|
|
9
9
|
if (object1 === void 0 || object1 === null || object2 === void 0 || object2 === null) return;
|
|
@@ -66,6 +66,5 @@ const mergeDictionaries = (dictionaries) => {
|
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
//#endregion
|
|
70
69
|
export { mergeDictionaries };
|
|
71
70
|
//# sourceMappingURL=mergeDictionaries.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID } from "./qualifiedDictionary.mjs";
|
|
2
1
|
import { mergeDictionaries } from "./mergeDictionaries.mjs";
|
|
2
|
+
import { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID } from "./qualifiedDictionary.mjs";
|
|
3
3
|
import { QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierTypes } from "./qualifiedDictionaryDeclaration.mjs";
|
|
4
4
|
import { log } from "@intlayer/config/built";
|
|
5
5
|
import { colorizeKey, getAppLogger } from "@intlayer/config/logger";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/dictionaryManipulator/mergeQualifiedDictionaries.ts
|
|
8
8
|
/**
|
|
9
9
|
* Merges sibling dictionaries sharing the same key, honouring qualifiers.
|
|
10
10
|
*
|
|
@@ -85,6 +85,5 @@ const mergeQualifiedDictionaries = (dictionaries) => {
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
//#endregion
|
|
89
88
|
export { mergeQualifiedDictionaries };
|
|
90
89
|
//# sourceMappingURL=mergeQualifiedDictionaries.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as translation } from "../transpiler/translation/translation.mjs";
|
|
2
1
|
import { getPerLocaleDictionary } from "../deepTransformPlugins/getLocalizedContent.mjs";
|
|
2
|
+
import { t as translation } from "../transpiler/translation/translation.mjs";
|
|
3
3
|
import { orderDictionaries } from "./orderDictionaries.mjs";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/dictionaryManipulator/normalizeDictionary.ts
|
|
6
6
|
const normalizeDictionary = (dictionary, configuration) => {
|
|
7
7
|
const { locales } = configuration.internationalization;
|
|
8
8
|
const parsedDictionary = JSON.parse(JSON.stringify(dictionary));
|
|
@@ -24,6 +24,5 @@ const normalizeDictionaries = (dictionaries, configuration) => {
|
|
|
24
24
|
return orderDictionaries(dictionaries, configuration).map((dictionary) => normalizeDictionary(dictionary, configuration));
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
export { normalizeDictionaries, normalizeDictionary };
|
|
29
28
|
//# sourceMappingURL=normalizeDictionary.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { editor } from "@intlayer/config/built";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/dictionaryManipulator/orderDictionaries.ts
|
|
4
4
|
/**
|
|
5
5
|
* Orders dictionaries based on the dictionary priority strategy.
|
|
6
6
|
*
|
|
@@ -40,6 +40,5 @@ const orderDictionaries = (dictionaries, config) => {
|
|
|
40
40
|
return withIndex.map(({ dictionary }) => dictionary);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
//#endregion
|
|
44
43
|
export { orderDictionaries };
|
|
45
44
|
//# sourceMappingURL=orderDictionaries.mjs.map
|
|
@@ -2,7 +2,7 @@ import { PRELOADED_DYNAMIC_KEY } from "./preloadedDynamicLoader.mjs";
|
|
|
2
2
|
import { QUALIFIER_DYNAMIC_TYPES_KEY } from "./qualifiedDynamicLoader.mjs";
|
|
3
3
|
import { internationalization } from "@intlayer/config/built";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/dictionaryManipulator/plainDynamicLoader.ts
|
|
6
6
|
/** Marker properties a loader map carries alongside its per-locale loaders. */
|
|
7
7
|
const MARKER_KEYS = [PRELOADED_DYNAMIC_KEY, QUALIFIER_DYNAMIC_TYPES_KEY];
|
|
8
8
|
/**
|
|
@@ -65,6 +65,5 @@ const resolvePlainDynamicLoader = (loaderMap, key, locale) => {
|
|
|
65
65
|
throw new Error(`[intlayer] No dynamic chunk found for dictionary "${key}" and locale "${locale}". Emitted locales: ${emittedLocales.length > 0 ? emittedLocales.join(", ") : "(none)"}.`);
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
//#endregion
|
|
69
68
|
export { findPlainDynamicLoader, resolvePlainDynamicLoader };
|
|
70
69
|
//# sourceMappingURL=plainDynamicLoader.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PRELOADED_DYNAMIC_KEY } from "@intlayer/config/defaultValues";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/dictionaryManipulator/preloadedDynamicLoader.ts
|
|
4
4
|
/**
|
|
5
5
|
* Reads the preloaded dictionary of a dynamic loader map, when one was resolved
|
|
6
6
|
* for the requested locale.
|
|
@@ -22,6 +22,5 @@ const getPreloadedDictionary = (loaderMap, locale) => {
|
|
|
22
22
|
return preloaded.dictionary;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
export { PRELOADED_DYNAMIC_KEY, getPreloadedDictionary };
|
|
27
26
|
//# sourceMappingURL=preloadedDynamicLoader.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/dictionaryManipulator/qualifiedDictionary.ts
|
|
2
2
|
/**
|
|
3
3
|
* Separator joining per-dimension ids into a composite entry id. Also used as
|
|
4
4
|
* the chunk path separator in dynamic mode.
|
|
@@ -232,6 +232,5 @@ const getDictionarySelectorCacheKey = (selector) => {
|
|
|
232
232
|
}).join("|");
|
|
233
233
|
};
|
|
234
234
|
|
|
235
|
-
//#endregion
|
|
236
235
|
export { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID, getDictionarySelectorCacheKey, isQualifiedDictionaryGroup, parseDictionarySelector, reconstructQualifiedEntry, resolveDictionaryArgument, resolveEffectiveVariantId, resolveProviderVariant, resolveQualifiedDictionary, serializeVariant, serializeVariantChain };
|
|
237
236
|
//# sourceMappingURL=qualifiedDictionary.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { COMPOSITE_ID_SEPARATOR, serializeVariant } from "./qualifiedDictionary.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/dictionaryManipulator/qualifiedDictionaryDeclaration.ts
|
|
4
4
|
/**
|
|
5
5
|
* Canonical order of qualifier dimensions. A key that declares both dimensions
|
|
6
6
|
* always nests them in this order, with `item` innermost so it can act as the
|
|
@@ -59,6 +59,5 @@ const getDictionaryCompositeIds = (dictionary, qualifierTypes) => {
|
|
|
59
59
|
return compositeIds;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
//#endregion
|
|
63
62
|
export { QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getVariantIds };
|
|
64
63
|
//# sourceMappingURL=qualifiedDictionaryDeclaration.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { COMPOSITE_ID_SEPARATOR, resolveEffectiveVariantId, serializeVariantChain } from "./qualifiedDictionary.mjs";
|
|
2
2
|
import { QUALIFIER_DYNAMIC_TYPES_KEY } from "@intlayer/config/defaultValues";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/dictionaryManipulator/qualifiedDynamicLoader.ts
|
|
5
5
|
/**
|
|
6
6
|
* Type guard discriminating a qualified dynamic loader map (collections /
|
|
7
7
|
* variants, possibly combined) from a plain dynamic loader map.
|
|
@@ -100,6 +100,5 @@ const resolveQualifiedDynamicContentAsync = async (params) => {
|
|
|
100
100
|
return dictionary ? transform(dictionary) : null;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
//#endregion
|
|
104
103
|
export { QUALIFIER_DYNAMIC_TYPES_KEY, isQualifiedDynamicLoaderMap, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync };
|
|
105
104
|
//# sourceMappingURL=qualifiedDynamicLoader.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/dictionaryManipulator/removeContentNodeByKeyPath.ts
|
|
4
4
|
const removeContentNodeByKeyPath = (dictionaryContent, keyPath) => {
|
|
5
5
|
let currentValue = dictionaryContent;
|
|
6
6
|
let parentValue = null;
|
|
@@ -27,6 +27,5 @@ const removeContentNodeByKeyPath = (dictionaryContent, keyPath) => {
|
|
|
27
27
|
return dictionaryContent;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
//#endregion
|
|
31
30
|
export { removeContentNodeByKeyPath };
|
|
32
31
|
//# sourceMappingURL=removeContentNodeByKeyPath.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/dictionaryManipulator/renameContentNodeByKeyPath.ts
|
|
4
4
|
const renameContentNodeByKeyPath = (dictionaryContent, newKey, keyPath) => {
|
|
5
5
|
let currentValue = dictionaryContent;
|
|
6
6
|
let parentValue = null;
|
|
@@ -35,6 +35,5 @@ const renameContentNodeByKeyPath = (dictionaryContent, newKey, keyPath) => {
|
|
|
35
35
|
return dictionaryContent;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { renameContentNodeByKeyPath };
|
|
40
39
|
//# sourceMappingURL=renameContentNodeByKeyPath.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/dictionaryManipulator/updateNodeChildren.ts
|
|
4
4
|
const updateNodeChildren = (section, newChildren) => {
|
|
5
5
|
if (typeof section === "string") return newChildren;
|
|
6
6
|
if (typeof section === "number") return newChildren;
|
|
@@ -32,6 +32,5 @@ const updateNodeChildren = (section, newChildren) => {
|
|
|
32
32
|
}), {});
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
//#endregion
|
|
36
35
|
export { updateNodeChildren };
|
|
37
36
|
//# sourceMappingURL=updateNodeChildren.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCachedIntl } from "../utils/intl.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/formatters/compact.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)
|
|
6
6
|
* based on locale and formatting options.
|
|
@@ -17,6 +17,5 @@ const compact = (value, options) => getCachedIntl("NumberFormat", options?.local
|
|
|
17
17
|
notation: "compact"
|
|
18
18
|
}).format(Number(value));
|
|
19
19
|
|
|
20
|
-
//#endregion
|
|
21
20
|
export { compact };
|
|
22
21
|
//# sourceMappingURL=compact.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCachedIntl } from "../utils/intl.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/formatters/currency.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formats a numeric or string value into a localized currency string using the Intl API.
|
|
6
6
|
*
|
|
@@ -21,6 +21,5 @@ const currency = (value, options) => getCachedIntl("NumberFormat", options?.loca
|
|
|
21
21
|
...options
|
|
22
22
|
}).format(Number(value));
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
export { currency };
|
|
26
25
|
//# sourceMappingURL=currency.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCachedIntl } from "../utils/intl.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/formatters/date.ts
|
|
4
4
|
const presets = {
|
|
5
5
|
short: {
|
|
6
6
|
year: "2-digit",
|
|
@@ -53,6 +53,5 @@ const date = (date, options) => {
|
|
|
53
53
|
return getCachedIntl("DateTimeFormat", locale, resolvedOptions).format(dateTime);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
//#endregion
|
|
57
56
|
export { date, presets };
|
|
58
57
|
//# sourceMappingURL=date.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCachedIntl } from "../utils/intl.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/formatters/list.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formats an array of values into a localized list string using the Intl API.
|
|
6
6
|
*
|
|
@@ -22,6 +22,5 @@ const list = (values, options) => getCachedIntl("ListFormat", options?.locale, {
|
|
|
22
22
|
...options
|
|
23
23
|
}).format(values.map(String));
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
export { list };
|
|
27
26
|
//# sourceMappingURL=list.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCachedIntl } from "../utils/intl.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/formatters/number.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formats a numeric value using locale-aware formatting.
|
|
6
6
|
*
|
|
@@ -12,6 +12,5 @@ import { getCachedIntl } from "../utils/intl.mjs";
|
|
|
12
12
|
*/
|
|
13
13
|
const number = (value, { locale, ...options } = {}) => getCachedIntl("NumberFormat", locale, options).format(Number(value));
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
15
|
export { number };
|
|
17
16
|
//# sourceMappingURL=number.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCachedIntl } from "../utils/intl.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/formatters/percentage.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formats a number as a percentage string (e.g., 0.25 → "25%").
|
|
6
6
|
*
|
|
@@ -19,6 +19,5 @@ const percentage = (value, { locale, ...options } = {}) => {
|
|
|
19
19
|
}).format(Number(numericValue));
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
export { percentage };
|
|
24
23
|
//# sourceMappingURL=percentage.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCachedIntl } from "../utils/intl.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/formatters/relativeTime.ts
|
|
4
4
|
/**
|
|
5
5
|
* Calculate the difference between 2 dates in the given unit.
|
|
6
6
|
*/
|
|
@@ -35,6 +35,5 @@ const relativeTime = (from, to = /* @__PURE__ */ new Date(), options) => {
|
|
|
35
35
|
return getCachedIntl("RelativeTimeFormat", options?.locale, options).format(Math.round(value), unit);
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { relativeTime };
|
|
40
39
|
//# sourceMappingURL=relativeTime.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCachedIntl } from "../utils/intl.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/formatters/units.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formats a numeric value as a localized unit string.
|
|
6
6
|
*
|
|
@@ -15,6 +15,5 @@ const units = (value, options) => getCachedIntl("NumberFormat", options?.locale,
|
|
|
15
15
|
useGrouping: options?.useGrouping ?? false
|
|
16
16
|
}).format(Number(value));
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
export { units };
|
|
20
19
|
//# sourceMappingURL=units.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { getEditedContent, getEditedDictionary } from "./deepTransformPlugins/ge
|
|
|
2
2
|
import { getDictionaryTransformCacheKey, getPluginsCacheKey, readTransformCache, writeTransformCache } from "./interpreter/dictionaryTransformCache.mjs";
|
|
3
3
|
import { getCondition } from "./interpreter/getCondition.mjs";
|
|
4
4
|
import { deepTransformNode } from "./interpreter/getContent/deepTransform.mjs";
|
|
5
|
+
import { DEFAULT_PLURAL_VARIABLE, plural } from "./transpiler/plural/plural.mjs";
|
|
5
6
|
import { findMatchingCondition, getEnumeration } from "./interpreter/getEnumeration.mjs";
|
|
6
7
|
import { getGender } from "./interpreter/getGender.mjs";
|
|
7
8
|
import { getInsertion } from "./interpreter/getInsertion.mjs";
|
|
@@ -48,7 +49,6 @@ import { getMarkdownMetadata } from "./transpiler/markdown/getMarkdownMetadata.m
|
|
|
48
49
|
import { validateMarkdown } from "./transpiler/markdown/validateMarkdown.mjs";
|
|
49
50
|
import { md as markdown } from "./transpiler/markdown/markdown.mjs";
|
|
50
51
|
import { nest as nesting } from "./transpiler/nesting/nesting.mjs";
|
|
51
|
-
import { DEFAULT_PLURAL_VARIABLE, plural } from "./transpiler/plural/plural.mjs";
|
|
52
52
|
import { select } from "./transpiler/select/select.mjs";
|
|
53
53
|
import { t as translation } from "./transpiler/translation/translation.mjs";
|
|
54
54
|
import { filterMissingTranslationsOnlyPlugin, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary } from "./deepTransformPlugins/getFilterMissingTranslationsContent.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/interpreter/dictionaryTransformCache.ts
|
|
2
2
|
/**
|
|
3
3
|
* Stable identity per plugin array, so a cache key can tell two custom plugin
|
|
4
4
|
* sets apart.
|
|
@@ -102,6 +102,5 @@ const writeTransformCache = (dictionary, cacheKey, content) => {
|
|
|
102
102
|
return content;
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
//#endregion
|
|
106
105
|
export { getDictionaryTransformCacheKey, getPluginsCacheKey, readTransformCache, writeTransformCache };
|
|
107
106
|
//# sourceMappingURL=dictionaryTransformCache.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/interpreter/getCondition.ts
|
|
2
2
|
/**
|
|
3
3
|
* Picks content based on a boolean condition.
|
|
4
4
|
*
|
|
@@ -21,6 +21,5 @@ const getCondition = (conditionContent, state) => {
|
|
|
21
21
|
return conditionContent[`${state}`] ?? conditionContent.fallback ?? conditionContent[fallbackState];
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
export { getCondition };
|
|
26
25
|
//# sourceMappingURL=getCondition.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/interpreter/getContent/deepTransform.ts
|
|
4
4
|
/** Props of a child node: same context, one more key path segment. */
|
|
5
5
|
const getChildProps = (props, children, keyPathSegment) => ({
|
|
6
6
|
...props,
|
|
@@ -47,6 +47,5 @@ const deepTransformNode = (node, props) => {
|
|
|
47
47
|
return result;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
//#endregion
|
|
51
50
|
export { deepTransformNode };
|
|
52
51
|
//# sourceMappingURL=deepTransform.mjs.map
|
|
@@ -2,7 +2,7 @@ import { deepTransformNode } from "./deepTransform.mjs";
|
|
|
2
2
|
import { conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, pluralPlugin, selectPlugin, translationPlugin } from "./plugins.mjs";
|
|
3
3
|
import { internationalization } from "@intlayer/config/built";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/interpreter/getContent/getContent.ts
|
|
6
6
|
const getBasePlugins = (locale, fallback = true) => [
|
|
7
7
|
translationPlugin(locale ?? internationalization.defaultLocale, fallback ? internationalization.defaultLocale : void 0),
|
|
8
8
|
enumerationPlugin,
|
|
@@ -25,6 +25,5 @@ const getContent = (node, nodeProps, plugins = []) => deepTransformNode(node, {
|
|
|
25
25
|
plugins
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
//#endregion
|
|
29
28
|
export { getBasePlugins, getContent };
|
|
30
29
|
//# sourceMappingURL=getContent.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { deepTransformNode } from "./deepTransform.mjs";
|
|
2
|
-
import { bindInsertedValues, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, pluralPlugin, resolveInsertedSelector, selectPlugin, translationPlugin } from "./plugins.mjs";
|
|
3
2
|
import { getBasePlugins, getContent } from "./getContent.mjs";
|
|
3
|
+
import { bindInsertedValues, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, pluralPlugin, resolveInsertedSelector, selectPlugin, translationPlugin } from "./plugins.mjs";
|
|
4
4
|
|
|
5
5
|
export { bindInsertedValues, conditionPlugin, deepTransformNode, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, getBasePlugins, getContent, insertionPlugin, nestedPlugin, pluralPlugin, resolveInsertedSelector, selectPlugin, translationPlugin };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_PLURAL_VARIABLE } from "../../transpiler/plural/plural.mjs";
|
|
1
2
|
import { getCondition } from "../getCondition.mjs";
|
|
2
3
|
import { getEnumeration } from "../getEnumeration.mjs";
|
|
3
4
|
import { getGender } from "../getGender.mjs";
|
|
@@ -10,7 +11,7 @@ import { getTranslation } from "../getTranslation.mjs";
|
|
|
10
11
|
import { isInterpolableWrapperNode, transformInterpolableNode } from "../interpolableNode.mjs";
|
|
11
12
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
// src/interpreter/getContent/plugins.ts
|
|
14
15
|
/** ---------------------------------------------
|
|
15
16
|
* FALLBACK PLUGIN
|
|
16
17
|
*
|
|
@@ -87,7 +88,8 @@ const pluralPlugin = (locale) => process.env.INTLAYER_NODE_TYPE_PLURAL === "fals
|
|
|
87
88
|
transform: (node, props, deepTransformNode) => {
|
|
88
89
|
const original = node[NodeTypes.PLURAL];
|
|
89
90
|
const result = {};
|
|
90
|
-
const
|
|
91
|
+
const variable = node.variable ?? "count";
|
|
92
|
+
const branchPlugins = (props.plugins ?? []).filter((plugin) => plugin.id !== "insertion-string-plugin" && plugin.id !== "plural-string-plugin");
|
|
91
93
|
/** String plugin for plural. Replaces string node with a component that renders the insertion. */
|
|
92
94
|
const pluralStringPlugin = {
|
|
93
95
|
id: "plural-string-plugin",
|
|
@@ -127,8 +129,8 @@ const pluralPlugin = (locale) => process.env.INTLAYER_NODE_TYPE_PLURAL === "fals
|
|
|
127
129
|
}
|
|
128
130
|
const effectiveLocale = String(locale ?? props.locale ?? "en");
|
|
129
131
|
return (arg) => {
|
|
130
|
-
const
|
|
131
|
-
const
|
|
132
|
+
const values = typeof arg === "number" ? { [variable]: arg } : arg;
|
|
133
|
+
const count = Number(values[variable]);
|
|
132
134
|
const subResult = getPlural(result, count, effectiveLocale);
|
|
133
135
|
if (isAwaitingValues(subResult)) return subResult(values);
|
|
134
136
|
return subResult;
|
|
@@ -313,6 +315,5 @@ const filePlugin = process.env.INTLAYER_NODE_TYPE_FILE === "false" ? fallbackPlu
|
|
|
313
315
|
})
|
|
314
316
|
};
|
|
315
317
|
|
|
316
|
-
//#endregion
|
|
317
318
|
export { bindInsertedValues, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, pluralPlugin, resolveInsertedSelector, selectPlugin, translationPlugin };
|
|
318
319
|
//# sourceMappingURL=plugins.mjs.map
|