@intlayer/core 7.4.0 → 7.5.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/localization/getLocale.cjs +3 -4
- package/dist/cjs/localization/getLocale.cjs.map +1 -1
- package/dist/cjs/localization/getLocalizedUrl.cjs +2 -1
- package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
- package/dist/cjs/messageFormat/ICU.cjs +309 -0
- package/dist/cjs/messageFormat/ICU.cjs.map +1 -0
- package/dist/cjs/messageFormat/i18next.cjs +320 -0
- package/dist/cjs/messageFormat/i18next.cjs.map +1 -0
- package/dist/cjs/messageFormat/index.cjs +10 -0
- package/dist/cjs/messageFormat/vue-i18n.cjs +166 -0
- package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -0
- package/dist/esm/localization/getLocale.mjs +1 -2
- package/dist/esm/localization/getLocale.mjs.map +1 -1
- package/dist/esm/localization/getLocalizedUrl.mjs +2 -1
- package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
- package/dist/esm/messageFormat/ICU.mjs +307 -0
- package/dist/esm/messageFormat/ICU.mjs.map +1 -0
- package/dist/esm/messageFormat/i18next.mjs +318 -0
- package/dist/esm/messageFormat/i18next.mjs.map +1 -0
- package/dist/esm/messageFormat/index.mjs +5 -0
- package/dist/esm/messageFormat/vue-i18n.mjs +164 -0
- package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -0
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +8 -7
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +8 -7
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +8 -7
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +2 -2
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
- package/dist/types/messageFormat/ICU.d.ts +11 -0
- package/dist/types/messageFormat/ICU.d.ts.map +1 -0
- package/dist/types/messageFormat/i18next.d.ts +9 -0
- package/dist/types/messageFormat/i18next.d.ts.map +1 -0
- package/dist/types/messageFormat/index.d.ts +4 -0
- package/dist/types/messageFormat/vue-i18n.d.ts +9 -0
- package/dist/types/messageFormat/vue-i18n.d.ts.map +1 -0
- package/dist/types/transpiler/translation/translation.d.ts +1 -1
- package/dist/types/transpiler/translation/translation.d.ts.map +1 -1
- package/package.json +11 -6
- package/dist/cjs/dist/esm/getStorageAttributes.cjs +0 -134
- package/dist/cjs/dist/esm/getStorageAttributes.cjs.map +0 -1
- package/dist/cjs/dist/esm/localization/localeResolver.cjs +0 -28
- package/dist/cjs/dist/esm/localization/localeResolver.cjs.map +0 -1
- package/dist/cjs/dist/esm/utils/getCookie.cjs +0 -32
- package/dist/cjs/dist/esm/utils/getCookie.cjs.map +0 -1
- package/dist/cjs/dist/esm/utils/localeStorage.cjs +0 -61
- package/dist/cjs/dist/esm/utils/localeStorage.cjs.map +0 -1
- package/dist/cjs/localization/isValidLocale.cjs +0 -54
- package/dist/cjs/localization/isValidLocale.cjs.map +0 -1
- package/dist/esm/dist/esm/getStorageAttributes.mjs +0 -133
- package/dist/esm/dist/esm/getStorageAttributes.mjs.map +0 -1
- package/dist/esm/dist/esm/localization/localeResolver.mjs +0 -26
- package/dist/esm/dist/esm/localization/localeResolver.mjs.map +0 -1
- package/dist/esm/dist/esm/utils/getCookie.mjs +0 -31
- package/dist/esm/dist/esm/utils/getCookie.mjs.map +0 -1
- package/dist/esm/dist/esm/utils/localeStorage.mjs +0 -59
- package/dist/esm/dist/esm/utils/localeStorage.mjs.map +0 -1
- package/dist/esm/localization/isValidLocale.mjs +0 -52
- package/dist/esm/localization/isValidLocale.mjs.map +0 -1
- package/dist/types/localization/isValidLocale.d.ts +0 -35
- package/dist/types/localization/isValidLocale.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18next.mjs","names":["nodes: I18NextNode[]","options: Record<string, I18NextNode[]>","insert","options: Record<string, any>","enu","transformedOptions: Record<string, string>"],"sources":["../../../src/messageFormat/i18next.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types';\nimport { NodeType } from '@intlayer/types';\nimport { deepTransformNode } from '../interpreter';\nimport { enu, gender, insert } from '../transpiler';\nimport type { JsonValue } from './ICU';\n\n// Types for our AST\ntype I18NextNode =\n | string\n | {\n type: 'argument';\n name: string;\n format?: { type: string; style?: string };\n }\n | { type: 'plural'; name: string; options: Record<string, I18NextNode[]> }\n | { type: 'select'; name: string; options: Record<string, I18NextNode[]> };\n\nconst parseI18Next = (text: string): I18NextNode[] => {\n let index = 0;\n\n const parseNodes = (): I18NextNode[] => {\n const nodes: I18NextNode[] = [];\n let currentText = '';\n\n while (index < text.length) {\n const char = text[index];\n\n // Standard i18next variable: {{var}}\n if (char === '{' && text[index + 1] === '{') {\n if (currentText) {\n nodes.push(currentText);\n currentText = '';\n }\n index += 2; // skip {{\n nodes.push(parseStandardArgument());\n }\n // ICU syntax: {var} or {var, plural, ...}\n else if (char === '{') {\n if (currentText) {\n nodes.push(currentText);\n currentText = '';\n }\n index++; // skip {\n nodes.push(parseICUArgument());\n } else if (char === '}') {\n // End of current block (likely ICU block end)\n break;\n } else {\n currentText += char;\n index++;\n }\n }\n\n if (currentText) {\n nodes.push(currentText);\n }\n return nodes;\n };\n\n const parseStandardArgument = (): I18NextNode => {\n // We are past '{{'\n let name = '';\n while (index < text.length) {\n // Check for closing }}\n if (text[index] === '}' && text[index + 1] === '}') {\n index += 2; // skip }}\n return { type: 'argument', name: name.trim() };\n }\n name += text[index];\n index++;\n }\n throw new Error('Unclosed i18next variable');\n };\n\n const parseICUArgument = (): I18NextNode => {\n // We are past '{'\n let name = '';\n while (index < text.length && /[^,}]/.test(text[index])) {\n name += text[index];\n index++;\n }\n name = name.trim();\n\n if (index >= text.length) throw new Error('Unclosed argument');\n\n if (text[index] === '}') {\n index++;\n return { type: 'argument', name };\n }\n\n // Must be comma\n if (text[index] === ',') {\n index++;\n // Parse type\n let type = '';\n while (index < text.length && /[^,}]/.test(text[index])) {\n type += text[index];\n index++;\n }\n type = type.trim();\n\n if (index >= text.length) throw new Error('Unclosed argument');\n\n if (text[index] === '}') {\n index++;\n return { type: 'argument', name, format: { type } };\n }\n\n if (text[index] === ',') {\n index++;\n\n // If plural or select, parse options\n if (type === 'plural' || type === 'select') {\n const options: Record<string, I18NextNode[]> = {};\n\n while (index < text.length && text[index] !== '}') {\n while (index < text.length && /\\s/.test(text[index])) index++;\n\n let key = '';\n while (index < text.length && /[^{\\s]/.test(text[index])) {\n key += text[index];\n index++;\n }\n\n while (index < text.length && /\\s/.test(text[index])) index++;\n\n if (text[index] !== '{')\n throw new Error('Expected { after option key');\n index++; // skip {\n\n const value = parseNodes();\n\n if (text[index] !== '}')\n throw new Error('Expected } after option value');\n index++; // skip }\n\n options[key] = value;\n\n while (index < text.length && /\\s/.test(text[index])) index++;\n }\n\n index++; // skip closing argument }\n\n if (type === 'plural') {\n return { type: 'plural', name, options };\n } else if (type === 'select') {\n return { type: 'select', name, options };\n }\n } else {\n // Parse style for number/date/time\n let style = '';\n while (index < text.length && text[index] !== '}') {\n style += text[index];\n index++;\n }\n if (index >= text.length) throw new Error('Unclosed argument');\n\n style = style.trim();\n index++; // skip }\n\n return { type: 'argument', name, format: { type, style } };\n }\n }\n }\n\n throw new Error('Malformed argument');\n };\n\n return parseNodes();\n};\n\nconst i18nextNodesToIntlayer = (nodes: I18NextNode[]): any => {\n if (nodes.length === 0) return '';\n if (nodes.length === 1 && typeof nodes[0] === 'string') return nodes[0];\n\n const canFlatten = nodes.every(\n (node) => typeof node === 'string' || node.type === 'argument'\n );\n\n if (canFlatten) {\n let str = '';\n for (const node of nodes) {\n if (typeof node === 'string') {\n str += node;\n } else if (typeof node !== 'string' && node.type === 'argument') {\n if (node.format) {\n // For formatted arguments, use ICU syntax: {name, type, style}\n str += `{${node.name}, ${node.format.type}${\n node.format.style ? `, ${node.format.style}` : ''\n }}`;\n } else {\n // For simple arguments, use standard i18next: {{name}}\n str += `{{${node.name}}}`;\n }\n }\n }\n return insert(str);\n }\n\n if (nodes.length === 1) {\n const node = nodes[0];\n if (typeof node === 'string') return node;\n\n if (node.type === 'argument') {\n if (node.format) {\n return insert(\n `{${node.name}, ${node.format.type}${\n node.format.style ? `, ${node.format.style}` : ''\n }}`\n );\n }\n return insert(`{{${node.name}}}`);\n }\n\n if (node.type === 'plural') {\n const options: Record<string, any> = {};\n for (const [key, val] of Object.entries(node.options)) {\n let newKey = key;\n if (key.startsWith('=')) {\n newKey = key.substring(1);\n } else if (key === 'one') {\n newKey = '1';\n } else if (key === 'two') {\n newKey = '2';\n } else if (key === 'few') {\n newKey = '<=3';\n } else if (key === 'many') {\n newKey = '>=4';\n } else if (key === 'other') {\n newKey = 'fallback';\n }\n // Handle # replacement\n const replacedVal = val.map((v) => {\n if (typeof v === 'string') {\n // In ICU plural, # is replaced by the number\n // In i18next, if using ICU plugin, it behaves same.\n // We map it to {{varName}} in Intlayer\n return v.replace(/#/g, `{{${node.name}}}`);\n }\n return v;\n });\n\n options[newKey] = i18nextNodesToIntlayer(replacedVal);\n }\n\n // Preserve variable name\n options.__intlayer_icu_var = node.name;\n\n return enu(options);\n }\n\n if (node.type === 'select') {\n const options: Record<string, any> = {};\n for (const [key, val] of Object.entries(node.options)) {\n options[key] = i18nextNodesToIntlayer(val);\n }\n\n // Check for gender\n const optionKeys = Object.keys(options);\n const isGender =\n (options.male || options.female) &&\n optionKeys.every((k) =>\n ['male', 'female', 'other', 'fallback'].includes(k)\n );\n\n if (isGender) {\n return gender({\n fallback: options.other,\n male: options.male,\n female: options.female,\n });\n }\n\n // Preserve variable name for generic select\n options.__intlayer_icu_var = node.name;\n\n return enu(options);\n }\n }\n\n return nodes.map((node) => i18nextNodesToIntlayer([node]));\n};\n\nconst i18nextToIntlayerPlugin = {\n canHandle: (node: any) =>\n typeof node === 'string' && (node.includes('{') || node.includes('}')),\n transform: (node: any) => {\n try {\n const ast = parseI18Next(node);\n return i18nextNodesToIntlayer(ast);\n } catch {\n return node;\n }\n },\n};\n\nconst intlayerToI18nextPlugin = {\n canHandle: (node: any) =>\n typeof node === 'string' ||\n (node &&\n typeof node === 'object' &&\n (node.nodeType === NodeType.Insertion ||\n node.nodeType === NodeType.Enumeration ||\n node.nodeType === NodeType.Gender ||\n node.nodeType === 'composite')) ||\n Array.isArray(node),\n transform: (node: any, props: any, next: any) => {\n if (typeof node === 'string') {\n return node;\n }\n\n if (node.nodeType === NodeType.Insertion) {\n // If it contains ICU format syntax (curly braces but not double curly), keep it as is\n // But standard insert creates {{var}}.\n // Check if the original string was formatted (e.g. {val, number})\n if (node.insertion.match(/\\{[^}]*,[^}]*\\}/)) {\n // It's likely an ICU format string like {val, number}\n // We might need to ensure variables inside are not double-braced if they are part of the format\n // But wait, our parser outputs {val, number} as string for insertion.\n return node.insertion;\n }\n\n // Otherwise keep {{name}} for i18next\n return node.insertion;\n }\n\n if (node.nodeType === NodeType.Enumeration) {\n const options = node.enumeration;\n\n const transformedOptions: Record<string, string> = {};\n for (const [key, val] of Object.entries(options)) {\n if (key === '__intlayer_icu_var') continue;\n const childVal = next(val, props);\n transformedOptions[key] =\n typeof childVal === 'string' ? childVal : JSON.stringify(childVal);\n }\n\n // Infer variable name\n let varName = options.__intlayer_icu_var || 'count';\n\n if (!options.__intlayer_icu_var) {\n const fallbackVal =\n transformedOptions.fallback ||\n transformedOptions.other ||\n Object.values(transformedOptions)[0];\n\n // Search for {{var}} or {var}\n // Match {variable} but avoid {variable, ...} (which are nested ICUs)\n const match =\n fallbackVal.match(/\\{\\{([a-zA-Z0-9_]+)\\}\\}/) ||\n fallbackVal.match(/\\{([a-zA-Z0-9_]+)\\}(?!,)/);\n if (match) {\n varName = match[1];\n }\n }\n\n const keys = Object.keys(transformedOptions);\n const pluralKeys = [\n '1',\n '2',\n '<=3',\n '>=4',\n 'fallback',\n 'other',\n 'zero',\n 'one',\n 'two',\n 'few',\n 'many',\n ];\n // Check if it is a plural\n const isPlural = keys.every(\n (k) => pluralKeys.includes(k) || /^[<>=]?\\d+(\\.\\d+)?$/.test(k)\n );\n\n const parts = [];\n\n if (isPlural) {\n for (const [key, val] of Object.entries(transformedOptions)) {\n let icuKey = key;\n if (key === 'fallback') icuKey = 'other';\n else if (key === '<=3') icuKey = 'few';\n else if (key === '>=4') icuKey = 'many';\n else if (/^\\d+$/.test(key)) icuKey = `=${key}`;\n\n let strVal = val;\n\n // Convert {{var}} to {var} inside ICU string\n // Also replace {varName} with # if it matches\n strVal = strVal.replace(/\\{\\{([^}]+)\\}\\}/g, '{$1}');\n strVal = strVal.replace(new RegExp(`\\\\{${varName}\\\\}`, 'g'), '#');\n\n parts.push(`${icuKey} {${strVal}}`);\n }\n return `{${varName}, plural, ${parts.join(' ')}}`;\n } else {\n // Select\n const entries = Object.entries(transformedOptions).sort(\n ([keyA], [keyB]) => {\n if (keyA === 'fallback' || keyA === 'other') return 1;\n if (keyB === 'fallback' || keyB === 'other') return -1;\n return 0;\n }\n );\n\n for (const [key, val] of entries) {\n let icuKey = key;\n if (key === 'fallback') icuKey = 'other';\n\n let strVal = val;\n strVal = strVal.replace(/\\{\\{([^}]+)\\}\\}/g, '{$1}');\n\n parts.push(`${icuKey} {${strVal}}`);\n }\n return `{${varName}, select, ${parts.join(' ')}}`;\n }\n }\n\n if (node.nodeType === NodeType.Gender) {\n const options = node.gender;\n const varName = 'gender';\n const parts = [];\n\n const entries = Object.entries(options).sort(([keyA], [keyB]) => {\n if (keyA === 'fallback') return 1;\n if (keyB === 'fallback') return -1;\n return 0;\n });\n\n for (const [key, val] of entries) {\n let icuKey = key;\n if (key === 'fallback') icuKey = 'other';\n\n const childVal = next(val, props);\n let strVal =\n typeof childVal === 'string' ? childVal : JSON.stringify(childVal);\n\n strVal = strVal.replace(/\\{\\{([^}]+)\\}\\}/g, '{$1}');\n parts.push(`${icuKey} {${strVal}}`);\n }\n return `{${varName}, select, ${parts.join(' ')}}`;\n }\n\n if (\n Array.isArray(node) ||\n (node.nodeType === 'composite' && Array.isArray(node.composite))\n ) {\n const arr = Array.isArray(node) ? node : node.composite;\n const items = arr.map((item: any) => next(item, props));\n return items.join('');\n }\n\n return next(node, props);\n },\n};\n\nexport const intlayerToI18nextFormatter = (\n message: Dictionary['content']\n): JsonValue => {\n return deepTransformNode(message, {\n dictionaryKey: 'i18next',\n keyPath: [],\n plugins: [{ id: 'i18next', ...intlayerToI18nextPlugin }],\n });\n};\n\nexport const i18nextToIntlayerFormatter = (\n message: JsonValue\n): Dictionary['content'] => {\n return deepTransformNode(message, {\n dictionaryKey: 'i18next',\n keyPath: [],\n plugins: [{ id: 'i18next', ...i18nextToIntlayerPlugin }],\n });\n};\n"],"mappings":";;;;;;;AAiBA,MAAM,gBAAgB,SAAgC;CACpD,IAAI,QAAQ;CAEZ,MAAM,mBAAkC;EACtC,MAAMA,QAAuB,EAAE;EAC/B,IAAI,cAAc;AAElB,SAAO,QAAQ,KAAK,QAAQ;GAC1B,MAAM,OAAO,KAAK;AAGlB,OAAI,SAAS,OAAO,KAAK,QAAQ,OAAO,KAAK;AAC3C,QAAI,aAAa;AACf,WAAM,KAAK,YAAY;AACvB,mBAAc;;AAEhB,aAAS;AACT,UAAM,KAAK,uBAAuB,CAAC;cAG5B,SAAS,KAAK;AACrB,QAAI,aAAa;AACf,WAAM,KAAK,YAAY;AACvB,mBAAc;;AAEhB;AACA,UAAM,KAAK,kBAAkB,CAAC;cACrB,SAAS,IAElB;QACK;AACL,mBAAe;AACf;;;AAIJ,MAAI,YACF,OAAM,KAAK,YAAY;AAEzB,SAAO;;CAGT,MAAM,8BAA2C;EAE/C,IAAI,OAAO;AACX,SAAO,QAAQ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Y,QAAO;AAChC,WAAO;KACP;AAEF,QAAK,MAAM,CAAC,KAAK,QAAQ,SAAS;IAChC,IAAI,SAAS;AACb,QAAI,QAAQ,WAAY,UAAS;IAEjC,MAAM,WAAW,KAAK,KAAK,MAAM;IACjC,IAAI,SACF,OAAO,aAAa,WAAW,WAAW,KAAK,UAAU,SAAS;AAEpE,aAAS,OAAO,QAAQ,oBAAoB,OAAO;AACnD,UAAM,KAAK,GAAG,OAAO,IAAI,OAAO,GAAG;;AAErC,UAAO,IAAI,QAAQ,YAAY,MAAM,KAAK,IAAI,CAAC;;AAGjD,MACE,MAAM,QAAQ,KAAK,IAClB,KAAK,aAAa,eAAe,MAAM,QAAQ,KAAK,UAAU,CAI/D,SAFY,MAAM,QAAQ,KAAK,GAAG,OAAO,KAAK,WAC5B,KAAK,SAAc,KAAK,MAAM,MAAM,CAAC,CAC1C,KAAK,GAAG;AAGvB,SAAO,KAAK,MAAM,MAAM;;CAE3B;AAED,MAAa,8BACX,YACc;AACd,QAAO,kBAAkB,SAAS;EAChC,eAAe;EACf,SAAS,EAAE;EACX,SAAS,CAAC;GAAE,IAAI;GAAW,GAAG;GAAyB,CAAC;EACzD,CAAC;;AAGJ,MAAa,8BACX,YAC0B;AAC1B,QAAO,kBAAkB,SAAS;EAChC,eAAe;EACf,SAAS,EAAE;EACX,SAAS,CAAC;GAAE,IAAI;GAAW,GAAG;GAAyB,CAAC;EACzD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { icuToIntlayerFormatter, intlayerToICUFormatter } from "./ICU.mjs";
|
|
2
|
+
import { i18nextToIntlayerFormatter, intlayerToI18nextFormatter } from "./i18next.mjs";
|
|
3
|
+
import { intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter } from "./vue-i18n.mjs";
|
|
4
|
+
|
|
5
|
+
export { i18nextToIntlayerFormatter, icuToIntlayerFormatter, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { deepTransformNode } from "../interpreter/getContent/deepTransform.mjs";
|
|
2
|
+
import { enu as enumeration } from "../transpiler/enumeration/enumeration.mjs";
|
|
3
|
+
import { insert as insertion } from "../transpiler/insertion/insertion.mjs";
|
|
4
|
+
import { NodeType } from "@intlayer/types";
|
|
5
|
+
|
|
6
|
+
//#region src/messageFormat/vue-i18n.ts
|
|
7
|
+
const parseVueI18nPart = (text) => {
|
|
8
|
+
let index = 0;
|
|
9
|
+
const nodes = [];
|
|
10
|
+
let currentText = "";
|
|
11
|
+
while (index < text.length) {
|
|
12
|
+
const char = text[index];
|
|
13
|
+
if (char === "{") {
|
|
14
|
+
if (currentText) {
|
|
15
|
+
nodes.push(currentText);
|
|
16
|
+
currentText = "";
|
|
17
|
+
}
|
|
18
|
+
index++;
|
|
19
|
+
let name = "";
|
|
20
|
+
while (index < text.length && text[index] !== "}") {
|
|
21
|
+
name += text[index];
|
|
22
|
+
index++;
|
|
23
|
+
}
|
|
24
|
+
if (index < text.length) index++;
|
|
25
|
+
nodes.push({
|
|
26
|
+
type: "argument",
|
|
27
|
+
name: name.trim()
|
|
28
|
+
});
|
|
29
|
+
} else {
|
|
30
|
+
currentText += char;
|
|
31
|
+
index++;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (currentText) nodes.push(currentText);
|
|
35
|
+
return nodes;
|
|
36
|
+
};
|
|
37
|
+
const parseVueI18n = (text) => {
|
|
38
|
+
const parts = [];
|
|
39
|
+
let currentPart = "";
|
|
40
|
+
let index = 0;
|
|
41
|
+
while (index < text.length) {
|
|
42
|
+
const char = text[index];
|
|
43
|
+
if (char === "\\" && index + 1 < text.length && text[index + 1] === "|") {
|
|
44
|
+
currentPart += "|";
|
|
45
|
+
index += 2;
|
|
46
|
+
} else if (char === "|") {
|
|
47
|
+
parts.push(currentPart.trim());
|
|
48
|
+
currentPart = "";
|
|
49
|
+
index++;
|
|
50
|
+
} else {
|
|
51
|
+
currentPart += char;
|
|
52
|
+
index++;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
parts.push(currentPart.trim());
|
|
56
|
+
return parts.map(parseVueI18nPart);
|
|
57
|
+
};
|
|
58
|
+
const vueI18nPartToIntlayer = (nodes) => {
|
|
59
|
+
if (nodes.length === 0) return "";
|
|
60
|
+
if (nodes.length === 1 && typeof nodes[0] === "string") return nodes[0];
|
|
61
|
+
let str = "";
|
|
62
|
+
for (const node of nodes) if (typeof node === "string") str += node;
|
|
63
|
+
else str += `{{${node.name}}}`;
|
|
64
|
+
return insertion(str);
|
|
65
|
+
};
|
|
66
|
+
const vueI18nNodesToIntlayer = (parts) => {
|
|
67
|
+
if (parts.length === 1) return vueI18nPartToIntlayer(parts[0]);
|
|
68
|
+
const options = {};
|
|
69
|
+
const varName = "count";
|
|
70
|
+
if (parts.length === 2) {
|
|
71
|
+
options["1"] = vueI18nPartToIntlayer(parts[0]);
|
|
72
|
+
options.fallback = vueI18nPartToIntlayer(parts[1]);
|
|
73
|
+
} else if (parts.length === 3) {
|
|
74
|
+
options["0"] = vueI18nPartToIntlayer(parts[0]);
|
|
75
|
+
options["1"] = vueI18nPartToIntlayer(parts[1]);
|
|
76
|
+
options.fallback = vueI18nPartToIntlayer(parts[2]);
|
|
77
|
+
} else parts.forEach((part, index) => {
|
|
78
|
+
if (index === parts.length - 1) options.fallback = vueI18nPartToIntlayer(part);
|
|
79
|
+
else options[index.toString()] = vueI18nPartToIntlayer(part);
|
|
80
|
+
});
|
|
81
|
+
options.__intlayer_vue_i18n_var = varName;
|
|
82
|
+
return enumeration(options);
|
|
83
|
+
};
|
|
84
|
+
const vueI18nToIntlayerPlugin = {
|
|
85
|
+
canHandle: (node) => typeof node === "string" && (node.includes("{") || node.includes("|")),
|
|
86
|
+
transform: (node) => {
|
|
87
|
+
try {
|
|
88
|
+
return vueI18nNodesToIntlayer(parseVueI18n(node));
|
|
89
|
+
} catch {
|
|
90
|
+
return node;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const intlayerToVueI18nPlugin = {
|
|
95
|
+
canHandle: (node) => typeof node === "string" || node && typeof node === "object" && (node.nodeType === NodeType.Insertion || node.nodeType === NodeType.Enumeration || node.nodeType === NodeType.Gender || node.nodeType === "composite") || Array.isArray(node),
|
|
96
|
+
transform: (node, props, next) => {
|
|
97
|
+
if (typeof node === "string") return node.replace(/\{\{([^}]+)\}\}/g, "{$1}");
|
|
98
|
+
if (node.nodeType === NodeType.Insertion) return node.insertion.replace(/\{\{([^}]+)\}\}/g, "{$1}");
|
|
99
|
+
if (node.nodeType === NodeType.Enumeration) {
|
|
100
|
+
const options = node.enumeration;
|
|
101
|
+
const transformedOptions = {};
|
|
102
|
+
for (const [key, val] of Object.entries(options)) {
|
|
103
|
+
if (key === "__intlayer_vue_i18n_var") continue;
|
|
104
|
+
const childVal = next(val, props);
|
|
105
|
+
transformedOptions[key] = typeof childVal === "string" ? childVal : JSON.stringify(childVal);
|
|
106
|
+
}
|
|
107
|
+
const keys = Object.keys(transformedOptions);
|
|
108
|
+
if (keys.includes("0")) {
|
|
109
|
+
const indices = keys.filter((key) => /^\d+$/.test(key)).map(Number);
|
|
110
|
+
const maxIndex = Math.max(...indices);
|
|
111
|
+
const fallback = transformedOptions.fallback || transformedOptions.other;
|
|
112
|
+
const resultParts = [];
|
|
113
|
+
if (maxIndex <= 1 && !keys.includes("2")) return `${transformedOptions["0"] || ""} | ${transformedOptions["1"] || ""} | ${fallback}`;
|
|
114
|
+
const limit = Math.max(1, maxIndex);
|
|
115
|
+
for (let i = 0; i <= limit; i++) {
|
|
116
|
+
const key = i.toString();
|
|
117
|
+
if (transformedOptions[key]) resultParts.push(transformedOptions[key]);
|
|
118
|
+
else resultParts.push("");
|
|
119
|
+
}
|
|
120
|
+
resultParts.push(fallback);
|
|
121
|
+
return resultParts.join(" | ").replace(/ \| {2}\| /g, " | | ");
|
|
122
|
+
}
|
|
123
|
+
if (keys.includes("1") && (keys.includes("fallback") || keys.includes("other"))) return `${transformedOptions["1"]} | ${transformedOptions.fallback || transformedOptions.other}`;
|
|
124
|
+
if (keys.length === 1 && (keys.includes("fallback") || keys.includes("other"))) return transformedOptions.fallback || transformedOptions.other;
|
|
125
|
+
return transformedOptions.fallback || Object.values(transformedOptions)[0];
|
|
126
|
+
}
|
|
127
|
+
if (node.nodeType === NodeType.Gender) {
|
|
128
|
+
const options = node.gender;
|
|
129
|
+
const transformedOptions = {};
|
|
130
|
+
for (const [key, val] of Object.entries(options)) {
|
|
131
|
+
let newKey = key;
|
|
132
|
+
if (key === "fallback") newKey = "other";
|
|
133
|
+
transformedOptions[newKey] = next(val, props);
|
|
134
|
+
}
|
|
135
|
+
return transformedOptions;
|
|
136
|
+
}
|
|
137
|
+
if (Array.isArray(node) || node.nodeType === "composite" && Array.isArray(node.composite)) return (Array.isArray(node) ? node : node.composite).map((item) => next(item, props)).join("");
|
|
138
|
+
return next(node, props);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const intlayerToVueI18nFormatter = (message) => {
|
|
142
|
+
return deepTransformNode(message, {
|
|
143
|
+
dictionaryKey: "vue-i18n",
|
|
144
|
+
keyPath: [],
|
|
145
|
+
plugins: [{
|
|
146
|
+
id: "vue-i18n",
|
|
147
|
+
...intlayerToVueI18nPlugin
|
|
148
|
+
}]
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
const vueI18nToIntlayerFormatter = (message) => {
|
|
152
|
+
return deepTransformNode(message, {
|
|
153
|
+
dictionaryKey: "vue-i18n",
|
|
154
|
+
keyPath: [],
|
|
155
|
+
plugins: [{
|
|
156
|
+
id: "vue-i18n",
|
|
157
|
+
...vueI18nToIntlayerPlugin
|
|
158
|
+
}]
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
//#endregion
|
|
163
|
+
export { intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter };
|
|
164
|
+
//# sourceMappingURL=vue-i18n.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-i18n.mjs","names":["nodes: VueI18nNode[]","parts: string[]","insert","options: Record<string, any>","enu","transformedOptions: Record<string, string>","transformedOptions: Record<string, any>"],"sources":["../../../src/messageFormat/vue-i18n.ts"],"sourcesContent":["import { type Dictionary, NodeType } from '@intlayer/types';\nimport { deepTransformNode } from '../interpreter';\nimport { enu, insert } from '../transpiler';\nimport type { JsonValue } from './ICU';\n\n// Types for our AST\ntype VueI18nNode =\n | string\n | {\n type: 'argument';\n name: string;\n };\n\nconst parseVueI18nPart = (text: string): VueI18nNode[] => {\n let index = 0;\n const nodes: VueI18nNode[] = [];\n let currentText = '';\n\n while (index < text.length) {\n const char = text[index];\n\n if (char === '{') {\n if (currentText) {\n nodes.push(currentText);\n currentText = '';\n }\n index++; // skip {\n let name = '';\n while (index < text.length && text[index] !== '}') {\n name += text[index];\n index++;\n }\n if (index < text.length) {\n index++; // skip }\n }\n nodes.push({ type: 'argument', name: name.trim() });\n } else {\n currentText += char;\n index++;\n }\n }\n\n if (currentText) {\n nodes.push(currentText);\n }\n\n return nodes;\n};\n\nconst parseVueI18n = (text: string): VueI18nNode[][] => {\n // Split by | but handle escaped \\|\n const parts: string[] = [];\n let currentPart = '';\n let index = 0;\n\n while (index < text.length) {\n const char = text[index];\n if (char === '\\\\' && index + 1 < text.length && text[index + 1] === '|') {\n currentPart += '|';\n index += 2;\n } else if (char === '|') {\n parts.push(currentPart.trim()); // Trim to remove surrounding spaces\n currentPart = '';\n index++;\n } else {\n currentPart += char;\n index++;\n }\n }\n parts.push(currentPart.trim()); // Trim last part too\n\n return parts.map(parseVueI18nPart);\n};\n\nconst vueI18nPartToIntlayer = (nodes: VueI18nNode[]): any => {\n if (nodes.length === 0) return '';\n if (nodes.length === 1 && typeof nodes[0] === 'string') return nodes[0];\n\n let str = '';\n for (const node of nodes) {\n if (typeof node === 'string') {\n str += node;\n } else {\n str += `{{${node.name}}}`;\n }\n }\n return insert(str);\n};\n\nconst vueI18nNodesToIntlayer = (parts: VueI18nNode[][]): any => {\n if (parts.length === 1) {\n return vueI18nPartToIntlayer(parts[0]);\n }\n\n // Handle pluralization (choice)\n const options: Record<string, any> = {};\n const varName = 'count'; // Default variable for vue-i18n choices\n\n if (parts.length === 2) {\n // 2 choices: 1 | other\n options['1'] = vueI18nPartToIntlayer(parts[0]);\n options.fallback = vueI18nPartToIntlayer(parts[1]);\n } else if (parts.length === 3) {\n // 3 choices: 0 | 1 | other\n options['0'] = vueI18nPartToIntlayer(parts[0]);\n options['1'] = vueI18nPartToIntlayer(parts[1]);\n options.fallback = vueI18nPartToIntlayer(parts[2]);\n } else {\n // > 3 choices: 0 | 1 | 2 | ... | other\n parts.forEach((part, index) => {\n if (index === parts.length - 1) {\n options.fallback = vueI18nPartToIntlayer(part);\n } else {\n options[index.toString()] = vueI18nPartToIntlayer(part);\n }\n });\n }\n\n // Preserve variable name\n options.__intlayer_vue_i18n_var = varName;\n\n return enu(options);\n};\n\nconst vueI18nToIntlayerPlugin = {\n canHandle: (node: any) =>\n typeof node === 'string' && (node.includes('{') || node.includes('|')),\n transform: (node: any) => {\n try {\n const ast = parseVueI18n(node);\n return vueI18nNodesToIntlayer(ast);\n } catch {\n return node;\n }\n },\n};\n\nconst intlayerToVueI18nPlugin = {\n canHandle: (node: any) =>\n typeof node === 'string' ||\n (node &&\n typeof node === 'object' &&\n (node.nodeType === NodeType.Insertion ||\n node.nodeType === NodeType.Enumeration ||\n node.nodeType === NodeType.Gender ||\n node.nodeType === 'composite')) ||\n Array.isArray(node),\n transform: (node: any, props: any, next: any) => {\n if (typeof node === 'string') {\n // replace {{...}} with {...} even in strings\n return node.replace(/\\{\\{([^}]+)\\}\\}/g, '{$1}');\n }\n\n if (node.nodeType === NodeType.Insertion) {\n // {{name}} -> {name}\n return node.insertion.replace(/\\{\\{([^}]+)\\}\\}/g, '{$1}');\n }\n\n if (node.nodeType === NodeType.Enumeration) {\n const options = node.enumeration;\n\n const transformedOptions: Record<string, string> = {};\n for (const [key, val] of Object.entries(options)) {\n if (key === '__intlayer_vue_i18n_var') continue;\n const childVal = next(val, props);\n transformedOptions[key] =\n typeof childVal === 'string' ? childVal : JSON.stringify(childVal);\n }\n\n // We need to reconstruct the pipe-separated string.\n // 2 parts: 1, fallback\n // 3 parts: 0, 1, fallback\n\n const keys = Object.keys(transformedOptions);\n\n // Heuristic to decide format\n // Use loose condition for 3 parts: if 0 exists, OR if 2 exists, etc.\n // But typically 0, 1, 2...\n // If '0' is present, we likely want the 3+ parts format.\n if (keys.includes('0')) {\n const indices = keys.filter((key) => /^\\d+$/.test(key)).map(Number);\n const maxIndex = Math.max(...indices);\n\n const fallback =\n transformedOptions.fallback || transformedOptions.other;\n const resultParts = [];\n\n // Check if we can use simple 3-part: 0 | 1 | fallback\n // Only if maxIndex <= 1\n if (maxIndex <= 1 && !keys.includes('2')) {\n const zero = transformedOptions['0'] || '';\n const one = transformedOptions['1'] || ''; // Gap handling?\n return `${zero} | ${one} | ${fallback}`;\n }\n\n // General case: loop until maxIndex\n const limit = Math.max(1, maxIndex);\n\n for (let i = 0; i <= limit; i++) {\n const key = i.toString();\n if (transformedOptions[key]) {\n resultParts.push(transformedOptions[key]);\n } else {\n resultParts.push(''); // Empty string for gaps\n }\n }\n resultParts.push(fallback);\n return resultParts.join(' | ').replace(/ \\| {2}\\| /g, ' | | ');\n }\n\n // 2 parts: 1 | fallback\n if (\n keys.includes('1') &&\n (keys.includes('fallback') || keys.includes('other'))\n ) {\n return `${transformedOptions['1']} | ${transformedOptions.fallback || transformedOptions.other}`;\n }\n\n // Fallback for only fallback?\n if (\n keys.length === 1 &&\n (keys.includes('fallback') || keys.includes('other'))\n ) {\n return transformedOptions.fallback || transformedOptions.other;\n }\n\n // Default fallback\n return (\n transformedOptions.fallback || Object.values(transformedOptions)[0]\n );\n }\n\n // Gender not supported by vue-i18n string format, return object\n if (node.nodeType === NodeType.Gender) {\n const options = node.gender;\n const transformedOptions: Record<string, any> = {};\n\n // Just map values\n for (const [key, val] of Object.entries(options)) {\n let newKey = key;\n if (key === 'fallback') newKey = 'other'; // vue-i18n doesn't strictly have 'other' for gender objects but standard convention often uses similar keys\n\n const childVal = next(val, props);\n transformedOptions[newKey] = childVal;\n }\n return transformedOptions;\n }\n\n if (\n Array.isArray(node) ||\n (node.nodeType === 'composite' && Array.isArray(node.composite))\n ) {\n const arr = Array.isArray(node) ? node : node.composite;\n const items = arr.map((item: any) => next(item, props));\n return items.join('');\n }\n\n return next(node, props);\n },\n};\n\nexport const intlayerToVueI18nFormatter = (\n message: Dictionary['content']\n): JsonValue => {\n return deepTransformNode(message, {\n dictionaryKey: 'vue-i18n',\n keyPath: [],\n plugins: [{ id: 'vue-i18n', ...intlayerToVueI18nPlugin }],\n });\n};\n\nexport const vueI18nToIntlayerFormatter = (\n message: JsonValue\n): Dictionary['content'] => {\n return deepTransformNode(message, {\n dictionaryKey: 'vue-i18n',\n keyPath: [],\n plugins: [{ id: 'vue-i18n', ...vueI18nToIntlayerPlugin }],\n });\n};\n"],"mappings":";;;;;;AAaA,MAAM,oBAAoB,SAAgC;CACxD,IAAI,QAAQ;CACZ,MAAMA,QAAuB,EAAE;CAC/B,IAAI,cAAc;AAElB,QAAO,QAAQ,KAAK,QAAQ;EAC1B,MAAM,OAAO,KAAK;AAElB,MAAI,SAAS,KAAK;AAChB,OAAI,aAAa;AACf,UAAM,KAAK,YAAY;AACvB,kBAAc;;AAEhB;GACA,IAAI,OAAO;AACX,UAAO,QAAQ,KAAK,UAAU,KAAK,WAAW,KAAK;AACjD,YAAQ,KAAK;AACb;;AAEF,OAAI,QAAQ,KAAK,OACf;AAEF,SAAM,KAAK;IAAE,MAAM;IAAY,MAAM,KAAK,MAAM;IAAE,CAAC;SAC9C;AACL,kBAAe;AACf;;;AAIJ,KAAI,YACF,OAAM,KAAK,YAAY;AAGzB,QAAO;;AAGT,MAAM,gBAAgB,SAAkC;CAEtD,MAAMC,QAAkB,EAAE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a,8BACX,YAC0B;AAC1B,QAAO,kBAAkB,SAAS;EAChC,eAAe;EACf,SAAS,EAAE;EACX,SAAS,CAAC;GAAE,IAAI;GAAY,GAAG;GAAyB,CAAC;EAC1D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
|
|
2
2
|
import "../interpreter/index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _intlayer_types0 from "@intlayer/types";
|
|
4
4
|
import { ContentNode, DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts
|
|
@@ -24,11 +24,12 @@ declare const getFilterMissingTranslationsContent: <T extends ContentNode, L ext
|
|
|
24
24
|
declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, localeToCheck: LocalesValues) => {
|
|
25
25
|
content: any;
|
|
26
26
|
$schema?: string;
|
|
27
|
-
id?:
|
|
27
|
+
id?: _intlayer_types0.DictionaryId;
|
|
28
28
|
projectIds?: string[];
|
|
29
|
-
localId?:
|
|
30
|
-
localIds?:
|
|
31
|
-
|
|
29
|
+
localId?: _intlayer_types0.LocalDictionaryId;
|
|
30
|
+
localIds?: _intlayer_types0.LocalDictionaryId[];
|
|
31
|
+
format?: _intlayer_types0.DictionaryFormat;
|
|
32
|
+
key: _intlayer_types0.DictionaryKey;
|
|
32
33
|
title?: string;
|
|
33
34
|
description?: string;
|
|
34
35
|
versions?: string[];
|
|
@@ -36,11 +37,11 @@ declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, l
|
|
|
36
37
|
filePath?: string;
|
|
37
38
|
tags?: string[];
|
|
38
39
|
locale?: LocalesValues;
|
|
39
|
-
fill?:
|
|
40
|
+
fill?: _intlayer_types0.Fill;
|
|
40
41
|
filled?: true;
|
|
41
42
|
priority?: number;
|
|
42
43
|
live?: boolean;
|
|
43
|
-
location?:
|
|
44
|
+
location?: _intlayer_types0.DictionaryLocation;
|
|
44
45
|
};
|
|
45
46
|
//#endregion
|
|
46
47
|
export { filterMissingTranslationsOnlyPlugin, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAmMa,qDACI,kBACd;;AAFH;AA8LA;;;;;;;;AA0BA;;;;cA1Ba,gDACD,uBACA,gBAAgB,uBAEpB,kBACS,cACJ;cAoBA,qDACC,2BACG;;;OAAa,
|
|
1
|
+
{"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAmMa,qDACI,kBACd;;AAFH;AA8LA;;;;;;;;AA0BA;;;;cA1Ba,gDACD,uBACA,gBAAgB,uBAEpB,kBACS,cACJ;cAoBA,qDACC,2BACG;;;OAAa,gBAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeepTransformContent, NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
|
|
2
2
|
import "../interpreter/index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _intlayer_types6 from "@intlayer/types";
|
|
4
4
|
import { ContentNode, DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts
|
|
@@ -16,11 +16,12 @@ declare const getFilterTranslationsOnlyContent: <T extends ContentNode, L extend
|
|
|
16
16
|
declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, locale?: LocalesValues, fallback?: LocalesValues) => {
|
|
17
17
|
content: any;
|
|
18
18
|
$schema?: string;
|
|
19
|
-
id?:
|
|
19
|
+
id?: _intlayer_types6.DictionaryId;
|
|
20
20
|
projectIds?: string[];
|
|
21
|
-
localId?:
|
|
22
|
-
localIds?:
|
|
23
|
-
|
|
21
|
+
localId?: _intlayer_types6.LocalDictionaryId;
|
|
22
|
+
localIds?: _intlayer_types6.LocalDictionaryId[];
|
|
23
|
+
format?: _intlayer_types6.DictionaryFormat;
|
|
24
|
+
key: _intlayer_types6.DictionaryKey;
|
|
24
25
|
title?: string;
|
|
25
26
|
description?: string;
|
|
26
27
|
versions?: string[];
|
|
@@ -28,11 +29,11 @@ declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, loca
|
|
|
28
29
|
filePath?: string;
|
|
29
30
|
tags?: string[];
|
|
30
31
|
locale?: LocalesValues;
|
|
31
|
-
fill?:
|
|
32
|
+
fill?: _intlayer_types6.Fill;
|
|
32
33
|
filled?: true;
|
|
33
34
|
priority?: number;
|
|
34
35
|
live?: boolean;
|
|
35
|
-
location?:
|
|
36
|
+
location?: _intlayer_types6.DictionaryLocation;
|
|
36
37
|
};
|
|
37
38
|
//#endregion
|
|
38
39
|
export { filterTranslationsOnlyPlugin, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFilterTranslationsOnlyContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterTranslationsOnlyContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAoCa,uCACH,0BACG,kBACV;;AAHH;;;;;AAuFa,cAAA,gCAkBZ,EAAA,CAAA,UAjBW,WAiBX,EAAA,UAhBW,aAgBX,GAhB2B,eAgB3B,CAAA,CAAA,IAAA,EAdO,CAcP,EAAA,MAAA,EAbS,CAaT,EAAA,SAAA,EAZY,SAYZ,EAAA,QAAA,CAAA,EAXY,aAWZ,EAAA,GADO,oBACP,CAD4B,CAC5B,CAAA;AAjBW,cAmBC,mCAnBD,EAAA,CAAA,UAAA,EAoBE,UApBF,EAAA,MAAA,CAAA,EAqBF,aArBE,EAAA,QAAA,CAAA,EAuBC,aAvBD,EAAA,GAAA;EACA,OAAA,EAAA,GAAA;EAAgB,OAAA,CAAA,EAAA,MAAA;EAEpB,EAAA,CAAA,EAoBkB,gBAAA,CAAA,YApBlB;EACE,UAAA,CAAA,EAAA,MAAA,EAAA;EACG,OAAA,CAAA,oCAAA;EACA,QAAA,CAAA,sCAAA;EAUgB,GAAA,gCAAA;
|
|
1
|
+
{"version":3,"file":"getFilterTranslationsOnlyContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterTranslationsOnlyContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAoCa,uCACH,0BACG,kBACV;;AAHH;;;;;AAuFa,cAAA,gCAkBZ,EAAA,CAAA,UAjBW,WAiBX,EAAA,UAhBW,aAgBX,GAhB2B,eAgB3B,CAAA,CAAA,IAAA,EAdO,CAcP,EAAA,MAAA,EAbS,CAaT,EAAA,SAAA,EAZY,SAYZ,EAAA,QAAA,CAAA,EAXY,aAWZ,EAAA,GADO,oBACP,CAD4B,CAC5B,CAAA;AAjBW,cAmBC,mCAnBD,EAAA,CAAA,UAAA,EAoBE,UApBF,EAAA,MAAA,CAAA,EAqBF,aArBE,EAAA,QAAA,CAAA,EAuBC,aAvBD,EAAA,GAAA;EACA,OAAA,EAAA,GAAA;EAAgB,OAAA,CAAA,EAAA,MAAA;EAEpB,EAAA,CAAA,EAoBkB,gBAAA,CAAA,YApBlB;EACE,UAAA,CAAA,EAAA,MAAA,EAAA;EACG,OAAA,CAAA,oCAAA;EACA,QAAA,CAAA,sCAAA;EAUgB,MAAA,CAAA,mCAAA;EAArB,GAAA,gCAAA;EAAoB,KAAA,CAAA,EAAA,MAAA;EAGf,WAAA,CAAA,EAAA,MAAA;EACC,QAAA,CAAA,EAAA,MAAA,EAAA;EACJ,OAAA,CAAA,EAAA,MAAA;EAEG,QAAA,CAAA,EAAA,MAAA;EAAa,IAAA,CAAA,EAAA,MAAA,EAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeProps } from "../interpreter/getContent/plugins.js";
|
|
2
2
|
import "../interpreter/index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _intlayer_types13 from "@intlayer/types";
|
|
4
4
|
import { ContentNode, Dictionary, LocalesValues } from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilteredLocalesContent.d.ts
|
|
@@ -8,11 +8,12 @@ declare const getFilteredLocalesContent: (node: ContentNode, locales: LocalesVal
|
|
|
8
8
|
declare const getFilteredLocalesDictionary: (dictionary: Dictionary, locale: LocalesValues | LocalesValues[]) => {
|
|
9
9
|
content: any;
|
|
10
10
|
$schema?: string;
|
|
11
|
-
id?:
|
|
11
|
+
id?: _intlayer_types13.DictionaryId;
|
|
12
12
|
projectIds?: string[];
|
|
13
|
-
localId?:
|
|
14
|
-
localIds?:
|
|
15
|
-
|
|
13
|
+
localId?: _intlayer_types13.LocalDictionaryId;
|
|
14
|
+
localIds?: _intlayer_types13.LocalDictionaryId[];
|
|
15
|
+
format?: _intlayer_types13.DictionaryFormat;
|
|
16
|
+
key: _intlayer_types13.DictionaryKey;
|
|
16
17
|
title?: string;
|
|
17
18
|
description?: string;
|
|
18
19
|
versions?: string[];
|
|
@@ -20,11 +21,11 @@ declare const getFilteredLocalesDictionary: (dictionary: Dictionary, locale: Loc
|
|
|
20
21
|
filePath?: string;
|
|
21
22
|
tags?: string[];
|
|
22
23
|
locale?: LocalesValues;
|
|
23
|
-
fill?:
|
|
24
|
+
fill?: _intlayer_types13.Fill;
|
|
24
25
|
filled?: true;
|
|
25
26
|
priority?: number;
|
|
26
27
|
live?: boolean;
|
|
27
|
-
location?:
|
|
28
|
+
location?: _intlayer_types13.DictionaryLocation;
|
|
28
29
|
};
|
|
29
30
|
//#endregion
|
|
30
31
|
export { getFilteredLocalesContent, getFilteredLocalesDictionary };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFilteredLocalesContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilteredLocalesContent.ts"],"sourcesContent":[],"mappings":";;;;;;cAsCa,kCACL,sBACG,gBAAgB,4BACd;cAwBA,2CACC,oBACJ,gBAAgB;;;EA7Bb,EAAA,CAAA,EA6B0B,
|
|
1
|
+
{"version":3,"file":"getFilteredLocalesContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilteredLocalesContent.ts"],"sourcesContent":[],"mappings":";;;;;;cAsCa,kCACL,sBACG,gBAAgB,4BACd;cAwBA,2CACC,oBACJ,gBAAgB;;;EA7Bb,EAAA,CAAA,EA6B0B,iBAAA,CAAA,YAbtC;EAfO,UAAA,CAAA,EAAA,MAAA,EAAA;EACG,OAAA,CAAA,qCAAA;EAAgB,QAAA,CAAA,uCAAA;EACd,MAAA,CAAA,oCAAA;EAAS,GAAA,iCAAA;EAwBT,KAAA,CAAA,EAAA,MAAA;EACC,WAAA,CAAA,EAAA,MAAA;EACJ,QAAA,CAAA,EAAA,MAAA,EAAA;EAAgB,OAAA,CAAA,EAAA,MAAA;EAAa,QAAA,CAAA,EAAA,MAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types20 from "@intlayer/types";
|
|
2
2
|
import { Dictionary } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/dictionaryManipulator/orderDictionaries.d.ts
|
|
@@ -10,7 +10,7 @@ import { Dictionary } from "@intlayer/types";
|
|
|
10
10
|
* @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')
|
|
11
11
|
* @returns Ordered array of dictionaries
|
|
12
12
|
*/
|
|
13
|
-
declare const orderDictionaries: (dictionaries: Dictionary[], configuration?:
|
|
13
|
+
declare const orderDictionaries: (dictionaries: Dictionary[], configuration?: _intlayer_types20.IntlayerConfig) => Dictionary[];
|
|
14
14
|
//#endregion
|
|
15
15
|
export { orderDictionaries };
|
|
16
16
|
//# sourceMappingURL=orderDictionaries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderDictionaries.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUA;;;;AAGa,cAHA,iBAGA,EAAA,CAAA,YAAA,EAFG,UAEH,EAAA,EAAA,aAAA,CAAA,EAFa,
|
|
1
|
+
{"version":3,"file":"orderDictionaries.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUA;;;;AAGa,cAHA,iBAGA,EAAA,CAAA,YAAA,EAFG,UAEH,EAAA,EAAA,aAAA,CAAA,EAFa,iBAAA,CACxB,cACW,EAAA,GAAV,UAAU,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../../../src/interpreter/getContent/plugins.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAoCA;AAcA;;;;;;AAIqB,KAlBT,OAAA,GAkBS;EAAP,EAAA,EAAA,MAAA;EACR,SAAA,EAAA,CAAA,IAAA,EAAA,GAAA,EAAA,GAAA,OAAA;EAAgB,SAAA,EAAA,CAAA,IAAA,EAAA,GAAA,EAAA,KAAA,EAdX,SAcW,EAAA,WAAA,EAAA,CAAA,IAAA,EAAA,GAAA,EAAA,KAAA,EAbc,SAad,EAAA,GAAA,GAAA,EAAA,GAAA,GAAA;CACO;;;;AACA,KAPjB,eAOiB,CAAA,CAAA,EAAA,CAAA,EAAA,UAPe,aAOf,CAAA,GAPgC,CAOhC,SAAA;EAAQ,QAAA,EANzB,QAMyB,GAAA,MAAA;EAAI,CALtC,QAAA,CAAS,WAAA,CAK6B,EAAA,KAAA,EAAA;CAAjC,GAHJ,CAGI,SAHM,MAGN,CAHa,WAGb,EAAA,OAAA,CAAA,GAFF,CAEE,SAAA,MAFc,CAEd,GADA,oBACA,CADqB,CACrB,CADuB,CACvB,CAAA,EAD2B,CAC3B,CAAA,GAAA,oBAAA,CAAqB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CA3DD,EAAA,MA2DU,kBA3DV,CA2D6B,CA3D7B,EA2DgC,CA3DhC,EA2DmC,CA3DnC,CAAA,EA2DuC,CA3DvC,CAAA,SAAA,KAAA,GA6Dd,QA7Dc,CA6DL,CA7DK,EA6DF,CA7DE,EA6DC,CA7DD,CAAA,GA+Dd,kBA/Dc,CA+DK,CA/DL,EA+DQ,CA/DR,EA+DW,CA/DX,CAAA,CAAA,MA+DoB,kBA/DpB,CA+DuC,CA/DvC,EA+D0C,CA/D1C,EA+D6C,CA/D7C,CAAA,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Dictionary } from "@intlayer/types";
|
|
2
|
+
|
|
3
|
+
//#region src/messageFormat/ICU.d.ts
|
|
4
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
declare const intlayerToICUFormatter: (message: Dictionary["content"]) => JsonValue;
|
|
8
|
+
declare const icuToIntlayerFormatter: (message: Dictionary["content"]) => JsonValue;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { JsonValue, icuToIntlayerFormatter, intlayerToICUFormatter };
|
|
11
|
+
//# sourceMappingURL=ICU.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ICU.d.ts","names":[],"sources":["../../../src/messageFormat/ICU.ts"],"sourcesContent":[],"mappings":";;;KAeY,SAAA,sCAKR;iBACiB;AANrB,CAAA;AA2ba,cAAA,sBACF,EAAA,CAAA,OACR,EADQ,UAOV,CAAA,SAAA,CAAA,EAAA,GANE,SAMF;AAEY,cAAA,sBACF,EAAA,CAAA,OACR,EADQ,UAOV,CAAA,SAAA,CAAA,EAAA,GANE,SAMF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JsonValue } from "./ICU.js";
|
|
2
|
+
import { Dictionary } from "@intlayer/types";
|
|
3
|
+
|
|
4
|
+
//#region src/messageFormat/i18next.d.ts
|
|
5
|
+
declare const intlayerToI18nextFormatter: (message: Dictionary["content"]) => JsonValue;
|
|
6
|
+
declare const i18nextToIntlayerFormatter: (message: JsonValue) => Dictionary["content"];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { i18nextToIntlayerFormatter, intlayerToI18nextFormatter };
|
|
9
|
+
//# sourceMappingURL=i18next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18next.d.ts","names":[],"sources":["../../../src/messageFormat/i18next.ts"],"sourcesContent":[],"mappings":";;;;cAwca,sCACF,0BACR;cAQU,sCACF,cACR"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JsonValue, icuToIntlayerFormatter, intlayerToICUFormatter } from "./ICU.js";
|
|
2
|
+
import { i18nextToIntlayerFormatter, intlayerToI18nextFormatter } from "./i18next.js";
|
|
3
|
+
import { intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter } from "./vue-i18n.js";
|
|
4
|
+
export { JsonValue, i18nextToIntlayerFormatter, icuToIntlayerFormatter, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JsonValue } from "./ICU.js";
|
|
2
|
+
import { Dictionary } from "@intlayer/types";
|
|
3
|
+
|
|
4
|
+
//#region src/messageFormat/vue-i18n.d.ts
|
|
5
|
+
declare const intlayerToVueI18nFormatter: (message: Dictionary["content"]) => JsonValue;
|
|
6
|
+
declare const vueI18nToIntlayerFormatter: (message: JsonValue) => Dictionary["content"];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter };
|
|
9
|
+
//# sourceMappingURL=vue-i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-i18n.d.ts","names":[],"sources":["../../../src/messageFormat/vue-i18n.ts"],"sourcesContent":[],"mappings":";;;;cAqQa,sCACF,0BACR;cAQU,sCACF,cACR"}
|
|
@@ -23,7 +23,7 @@ type TranslationContent<Content = unknown, RecordContent extends StrictModeLocal
|
|
|
23
23
|
* - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
|
|
24
24
|
*/
|
|
25
25
|
declare const translation: <Content = unknown, ContentRecord extends StrictModeLocaleMap<Content> = StrictModeLocaleMap<Content>>(content: ContentRecord) => TypedNodeModel<NodeType.Translation, ContentRecord, {
|
|
26
|
-
nodeType: NodeType.Translation
|
|
26
|
+
nodeType: "translation" | NodeType.Translation;
|
|
27
27
|
} & {
|
|
28
28
|
translation: ContentRecord;
|
|
29
29
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.d.ts","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":[],"mappings":";;;KAOY,4DAGR,oBAAoB,WAAW,oBAAoB,YACnD,eAAe,QAAA,CAAS,aAAa;;AAJzC;;;;;;;;;AAIwD;;;;;;;;;;cAsBlD,WAKkB,EAAA,CAAA,UAAA,OAAA,EAAA,sBAFpB,mBAEoB,CAFA,OAEA,CAAA,GAFW,mBAEX,CAF+B,OAE/B,CAAA,CAAA,CAAA,OAAA,EAAb,aAAa,EAAA,GAAA,cAAA,CAAA,QAAA,CAAA,WAAA,EAAA,aAAA,EAAA;EAAA,QAAA,
|
|
1
|
+
{"version":3,"file":"translation.d.ts","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":[],"mappings":";;;KAOY,4DAGR,oBAAoB,WAAW,oBAAoB,YACnD,eAAe,QAAA,CAAS,aAAa;;AAJzC;;;;;;;;;AAIwD;;;;;;;;;;cAsBlD,WAKkB,EAAA,CAAA,UAAA,OAAA,EAAA,sBAFpB,mBAEoB,CAFA,OAEA,CAAA,GAFW,mBAEX,CAF+B,OAE/B,CAAA,CAAA,CAAA,OAAA,EAAb,aAAa,EAAA,GAAA,cAAA,CAAA,QAAA,CAAA,WAAA,EAAA,aAAA,EAAA;EAAA,QAAA,EAAA,aAAA,uBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
|
|
6
6
|
"keywords": [
|
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
"require": "./dist/cjs/index.cjs",
|
|
43
43
|
"import": "./dist/esm/index.mjs"
|
|
44
44
|
},
|
|
45
|
+
"./messageFormat": {
|
|
46
|
+
"types": "./dist/types/messageFormat/index.d.ts",
|
|
47
|
+
"require": "./dist/cjs/messageFormat/index.cjs",
|
|
48
|
+
"import": "./dist/esm/messageFormat/index.mjs"
|
|
49
|
+
},
|
|
45
50
|
"./file": {
|
|
46
51
|
"types": "./dist/types/transpiler/file/file.d.ts",
|
|
47
52
|
"node": {
|
|
@@ -102,11 +107,11 @@
|
|
|
102
107
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
103
108
|
},
|
|
104
109
|
"dependencies": {
|
|
105
|
-
"@intlayer/api": "7.
|
|
106
|
-
"@intlayer/config": "7.
|
|
107
|
-
"@intlayer/dictionaries-entry": "7.
|
|
108
|
-
"@intlayer/types": "7.
|
|
109
|
-
"@intlayer/unmerged-dictionaries-entry": "7.
|
|
110
|
+
"@intlayer/api": "7.5.0-canary.0",
|
|
111
|
+
"@intlayer/config": "7.5.0-canary.0",
|
|
112
|
+
"@intlayer/dictionaries-entry": "7.5.0-canary.0",
|
|
113
|
+
"@intlayer/types": "7.5.0-canary.0",
|
|
114
|
+
"@intlayer/unmerged-dictionaries-entry": "7.5.0-canary.0",
|
|
110
115
|
"defu": "6.1.4"
|
|
111
116
|
},
|
|
112
117
|
"devDependencies": {
|