@intlayer/vue-i18n 9.5.11 → 9.5.12

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.
@@ -76,7 +76,7 @@ const warnDeprecatedRuntimeMessages = (location) => {
76
76
  };
77
77
  const createI18n = ((options = {}) => {
78
78
  const fallbackMessages = options.messages;
79
- if (options.messages !== void 0 && true) getAppLogger({ log })(`${colorize("createI18n", ANSIColors.CYAN)}: the ${colorize("`messages`", ANSIColors.CYAN)} option is used as a fallback. For optimal bundle size, remove the locale JSON imports and use ${colorize("useDictionary", ANSIColors.CYAN)} or compile your intlayer dictionaries instead:\n ${colorize("Before:", ANSIColors.GREY)} createI18n({ messages: { en, fr, … } })\n ${colorize("After: ", ANSIColors.GREY)} createI18n({})`);
79
+ if (options.messages !== void 0 && process.env.NODE_ENV === "development") getAppLogger({ log })(`${colorize("createI18n", ANSIColors.CYAN)}: the ${colorize("`messages`", ANSIColors.CYAN)} option is used as a fallback. For optimal bundle size, remove the locale JSON imports and use ${colorize("useDictionary", ANSIColors.CYAN)} or compile your intlayer dictionaries instead:\n ${colorize("Before:", ANSIColors.GREY)} createI18n({ messages: { en, fr, … } })\n ${colorize("After: ", ANSIColors.GREY)} createI18n({})`);
80
80
  const client = createIntlayerClient(options.locale);
81
81
  const datetimeFormats = options.datetimeFormats;
82
82
  const numberFormats = options.numberFormats;
@@ -1 +1 @@
1
- {"version":3,"file":"createI18n.mjs","names":[],"sources":["../../src/createI18n.ts"],"sourcesContent":["import { internationalization, log } from '@intlayer/config/built';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getIntlayer } from '@intlayer/core/interpreter';\nimport { navigatePath } from '@intlayer/core/messageFormat';\nimport type {\n DictionaryKeys,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type {\n App,\n DirectiveBinding,\n InjectionKey,\n WritableComputedRef,\n} from 'vue';\nimport { computed, inject } from 'vue';\nimport type { createI18n as _createI18n, I18n } from 'vue-i18n';\nimport {\n createIntlayerClient,\n INTLAYER_SYMBOL,\n installIntlayer,\n useLocale,\n} from 'vue-intlayer';\nimport {\n type DateTimeFormatsConfig,\n formatDateValue,\n formatNumberValue,\n type NumberFormatsConfig,\n} from './formats';\nimport {\n parseTranslateArguments,\n resolveVueMessage,\n} from './resolveVueMessage';\nimport type { LooseComposer, TypedComposer } from './typedComposer';\n\nexport const VERSION = '9.13.1';\nexport const I18nInjectionKey: InjectionKey<I18n> = Symbol('global-i18n');\n\n/**\n * Dictionary key used for keys that carry no explicit namespace and are not\n * dot-namespaced (i18next-style flat keys, e.g. `t('greeting')`).\n */\nconst DEFAULT_NAMESPACE = 'translation';\n\n/**\n * Looks up a raw value for a vue-i18n key against intlayer dictionaries.\n *\n * Resolution order:\n * 1. `ns:key` prefix → dictionary `ns`\n * 2. The default namespace dictionary with the full dot-path\n * 3. The first key segment as the dictionary key (`'home.title'` →\n * dictionary `home`, path `title`)\n */\n/** Resolves a single dictionary by key and navigates to the given path. */\nconst lookupInDictionary = (\n locale: string,\n dictionaryKey: string,\n path: string\n): unknown => {\n try {\n const dictionary = getIntlayer(\n dictionaryKey as DictionaryKeys,\n locale as LocalesValues\n );\n const value = navigatePath(dictionary, path);\n if (value !== undefined && value !== null) return value;\n } catch {}\n return undefined;\n};\n\nconst lookupRaw = (\n locale: string,\n namespace: string | undefined,\n key: string\n): unknown => {\n let targetNamespace = namespace;\n let path = key;\n\n if (key.includes(':')) {\n const separatorIndex = key.indexOf(':');\n targetNamespace = key.slice(0, separatorIndex);\n path = key.slice(separatorIndex + 1);\n }\n\n // 1. Explicit namespace (from `useI18n({ namespace })` or a `ns:key` prefix)\n if (targetNamespace) {\n const value = lookupInDictionary(locale, targetNamespace, path);\n if (value !== undefined) return value;\n }\n\n // 2. First key segment as the dictionary key (`'home.title'` →\n // dictionary `home`, path `title`). This makes the global `t()` work\n // without a namespace, matching how intlayer splits dictionaries by key.\n if (path.includes('.')) {\n const separatorIndex = path.indexOf('.');\n const value = lookupInDictionary(\n locale,\n path.slice(0, separatorIndex),\n path.slice(separatorIndex + 1)\n );\n if (value !== undefined) return value;\n }\n\n // 3. Default `translation` bucket for flat, namespace-less keys.\n if (!targetNamespace) {\n const value = lookupInDictionary(locale, DEFAULT_NAMESPACE, path);\n if (value !== undefined) return value;\n }\n\n return undefined;\n};\n\n/** Translates a key with vue-i18n's polymorphic argument list. */\nconst translateKey = (\n locale: string,\n namespace: string | undefined,\n key: string,\n args: unknown[],\n fallbackMessages?: Record<string, unknown>\n): string => {\n const { values, count, defaultMessage } = parseTranslateArguments(args);\n\n const rawValue = lookupRaw(locale, namespace, key);\n\n if (rawValue === undefined) {\n if (fallbackMessages?.[locale]) {\n // Defer to the user's provided messages if not found in dictionaries\n const targetPath = namespace ? `${namespace}.${key}` : key;\n const fallbackValue = navigatePath(fallbackMessages[locale], targetPath);\n if (fallbackValue !== undefined) {\n return resolveVueMessage(\n fallbackValue,\n values,\n count,\n locale as LocalesValues\n );\n }\n }\n if (defaultMessage !== undefined) {\n return resolveVueMessage(\n defaultMessage,\n values,\n count,\n locale as LocalesValues\n );\n }\n return key;\n }\n\n return resolveVueMessage(rawValue, values, count, locale as LocalesValues);\n};\n\nconst getAvailableLocales = (): string[] =>\n internationalization?.locales?.map(String) ?? [];\n\nconst warnDeprecatedRuntimeMessages = (location: string) => {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize(location, ANSIColors.CYAN)} has no effect with ${colorize('@intlayer/vue-i18n', ANSIColors.MAGENTA)} — translations are managed by the compiled intlayer dictionaries.`\n );\n};\n\n/** Value accepted by the `v-t` directive. */\ntype TranslateDirectiveValue =\n | string\n | { path: string; args?: Record<string, unknown>; choice?: number };\n\nexport const createI18n: typeof _createI18n = ((\n options: Record<string, unknown> = {}\n) => {\n const fallbackMessages = options.messages as\n | Record<string, unknown>\n | undefined;\n\n if (\n options.messages !== undefined &&\n process.env.NODE_ENV === 'development'\n ) {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('createI18n', ANSIColors.CYAN)}: the ${colorize('`messages`', ANSIColors.CYAN)} option is used as a fallback. For optimal bundle size, remove the locale JSON imports and use ${colorize('useDictionary', ANSIColors.CYAN)} or compile your intlayer dictionaries instead:\\n ${colorize('Before:', ANSIColors.GREY)} createI18n({ messages: { en, fr, … } })\\n ${colorize('After: ', ANSIColors.GREY)} createI18n({})`\n );\n }\n\n const client = createIntlayerClient(options.locale as LocalesValues);\n\n const datetimeFormats = options.datetimeFormats as\n | DateTimeFormatsConfig\n | undefined;\n const numberFormats = options.numberFormats as\n | NumberFormatsConfig\n | undefined;\n\n const currentLocale = (): string => String(client.locale.value);\n\n /** Writable ref matching vue-i18n's composition-mode `global.locale`. */\n const localeRef: WritableComputedRef<string> = computed({\n get: () => currentLocale(),\n set: (newLocale: string) => {\n client.setLocale(newLocale as LocalesValues);\n },\n });\n\n const globalTranslate = (key: string, ...args: unknown[]): string =>\n translateKey(currentLocale(), undefined, key, args, fallbackMessages);\n\n const globalDate = (\n value: Date | number | string,\n formatOrOptions?: string | Intl.DateTimeFormatOptions\n ): string =>\n formatDateValue(value, formatOrOptions, currentLocale(), datetimeFormats);\n\n const globalNumber = (\n value: number,\n formatOrOptions?: string | Intl.NumberFormatOptions\n ): string =>\n formatNumberValue(value, formatOrOptions, currentLocale(), numberFormats);\n\n const global = {\n locale: localeRef,\n availableLocales: getAvailableLocales(),\n fallbackLocale: (options.fallbackLocale ??\n internationalization?.defaultLocale) as string,\n t: globalTranslate,\n tc: globalTranslate,\n te: (key: string): boolean =>\n lookupRaw(currentLocale(), undefined, key) !== undefined,\n tm: (key: string): unknown =>\n lookupRaw(currentLocale(), undefined, key) ?? {},\n rt: (message: unknown, ...args: unknown[]): string => {\n const { values, count } = parseTranslateArguments(args);\n return resolveVueMessage(\n message,\n values,\n count,\n currentLocale() as LocalesValues\n );\n },\n d: globalDate,\n n: globalNumber,\n setLocaleMessage: (_locale: string, _messages: unknown) => {\n warnDeprecatedRuntimeMessages('setLocaleMessage');\n },\n mergeLocaleMessage: (_locale: string, _messages: unknown) => {\n warnDeprecatedRuntimeMessages('mergeLocaleMessage');\n },\n getLocaleMessage: (_locale: string): Record<string, unknown> => {\n warnDeprecatedRuntimeMessages('getLocaleMessage');\n // We do not load global dictionaries anymore for bundle optimization.\n // The user should use useDictionary or rely on manually provided messages.\n return {};\n },\n };\n\n /** Legacy Options-API facade (`this.$i18n`) with a string `locale`. */\n const legacyI18n = {\n get locale(): string {\n return currentLocale();\n },\n set locale(newLocale: string) {\n client.setLocale(newLocale as LocalesValues);\n },\n get availableLocales(): string[] {\n return getAvailableLocales();\n },\n t: globalTranslate,\n tc: globalTranslate,\n te: global.te,\n tm: global.tm,\n rt: global.rt,\n d: globalDate,\n n: globalNumber,\n };\n\n const applyTranslateDirective = (\n element: HTMLElement,\n binding: DirectiveBinding<TranslateDirectiveValue>\n ) => {\n const bindingValue = binding.value;\n if (typeof bindingValue === 'string') {\n element.textContent = globalTranslate(bindingValue);\n } else if (bindingValue && typeof bindingValue === 'object') {\n const directiveArgs: unknown[] = [];\n if (bindingValue.args) directiveArgs.push(bindingValue.args);\n if (typeof bindingValue.choice === 'number')\n directiveArgs.push(bindingValue.choice);\n element.textContent = globalTranslate(\n bindingValue.path,\n ...directiveArgs\n );\n }\n };\n\n const i18nInstance = {\n global,\n mode: options.legacy === true ? 'legacy' : 'composition',\n __optionsMessages: fallbackMessages,\n install(app: App) {\n // A framework integration (nuxt-intlayer) may have installed it already.\n const isIntlayerInstalled = INTLAYER_SYMBOL in app._context.provides;\n\n if (!isIntlayerInstalled) {\n installIntlayer(app, {\n locale: options.locale as LocalesValues,\n });\n }\n\n // Provide under I18nInjectionKey to satisfy inject(I18nInjectionKey) calls\n app.provide(I18nInjectionKey, i18nInstance as unknown as I18n);\n\n // Legacy API support ($t / $tc / $te / $tm / $rt / $d / $n / $i18n)\n app.config.globalProperties.$t = globalTranslate;\n (app.config.globalProperties as Record<string, unknown>).$tc =\n globalTranslate;\n (app.config.globalProperties as Record<string, unknown>).$te = global.te;\n (app.config.globalProperties as Record<string, unknown>).$tm = global.tm;\n (app.config.globalProperties as Record<string, unknown>).$rt = global.rt;\n (app.config.globalProperties as Record<string, unknown>).$d = globalDate;\n (app.config.globalProperties as Record<string, unknown>).$n =\n globalNumber;\n (app.config.globalProperties as Record<string, unknown>).$i18n =\n legacyI18n;\n\n // `v-t` directive support\n app.directive('t', {\n beforeMount: applyTranslateDirective,\n updated: applyTranslateDirective,\n });\n },\n };\n\n return i18nInstance as unknown as I18n;\n}) as typeof _createI18n;\n\n/**\n * Overload set for {@link useI18n}: with a `namespace` option the composer is\n * fully typed against that dictionary (keys and return values); without one\n * the root scope applies — the first segment of each key designates the\n * dictionary (`t('about.title')`).\n */\ntype UseI18n = {\n <N extends DictionaryKeys>(\n options: Record<string, unknown> & { namespace: N }\n ): TypedComposer<N>;\n (\n options?: Record<string, unknown> & { namespace?: undefined }\n ): LooseComposer;\n};\n\n/**\n * Composable providing a typed `t()` function scoped to a dictionary namespace.\n * Pass `{ namespace: 'myDict' }` to restrict keys to valid dot-notation paths\n * within that intlayer dictionary (autocompleted and validated at compile\n * time) and resolve return types from the content at each path.\n *\n * Supports vue-i18n's full message syntax: named (`{name}`) and list (`{0}`)\n * interpolation, pipe choice messages (`'car | cars'` with a count argument),\n * plus `te`/`tm`/`rt` and `Intl`-backed `d()`/`n()` formatters.\n *\n * @example\n * ```ts\n * const { t } = useI18n({ namespace: 'about' });\n * t('counter.label'); // ✓ typed key and return value\n * t('apples', 5); // pipe plural choice\n * ```\n */\nexport const useI18n = ((\n options?: Record<string, unknown> & { namespace?: string }\n) => {\n const { locale: currentLocale, setLocale, availableLocales } = useLocale();\n const instance = inject(I18nInjectionKey) as unknown as\n | Record<string, unknown>\n | undefined;\n const fallbackMessages = instance?.__optionsMessages as\n | Record<string, unknown>\n | undefined;\n\n const namespace = options?.namespace as string | undefined;\n\n const datetimeFormats = options?.datetimeFormats as\n | DateTimeFormatsConfig\n | undefined;\n const numberFormats = options?.numberFormats as\n | NumberFormatsConfig\n | undefined;\n\n const localeRef = computed({\n get: () => currentLocale.value as string,\n set: (newLocale: string) => {\n setLocale(newLocale as LocalesValues);\n },\n });\n\n const translate = (key: string, ...args: unknown[]): string =>\n translateKey(currentLocale.value, namespace, key, args, fallbackMessages);\n\n return {\n locale: localeRef,\n availableLocales: availableLocales as string[],\n t: translate,\n tc: translate,\n te: (key: string): boolean =>\n lookupRaw(currentLocale.value, namespace, key) !== undefined,\n tm: (key: string): unknown =>\n lookupRaw(currentLocale.value, namespace, key) ?? {},\n rt: (message: unknown, ...args: unknown[]): string => {\n const { values, count } = parseTranslateArguments(args);\n return resolveVueMessage(\n message,\n values,\n count,\n currentLocale.value as LocalesValues\n );\n },\n d: (\n value: Date | number | string,\n formatOrOptions?: string | Intl.DateTimeFormatOptions\n ): string =>\n formatDateValue(\n value,\n formatOrOptions,\n currentLocale.value,\n datetimeFormats\n ),\n n: (\n value: number,\n formatOrOptions?: string | Intl.NumberFormatOptions\n ): string =>\n formatNumberValue(\n value,\n formatOrOptions,\n currentLocale.value,\n numberFormats\n ),\n };\n}) as UseI18n;\n"],"mappings":";;;;;;;;;;;AAmCA,MAAa,UAAU;AACvB,MAAa,mBAAuC,OAAO,aAAa;;;;;AAMxE,MAAM,oBAAoB;;;;;;;;;;;AAY1B,MAAM,sBACJ,QACA,eACA,SACY;CACZ,IAAI;EACF,MAAM,aAAa,YACjB,eACA,MACF;EACA,MAAM,QAAQ,aAAa,YAAY,IAAI;EAC3C,IAAI,UAAU,UAAa,UAAU,MAAM,OAAO;CACpD,QAAQ,CAAC;AAEX;AAEA,MAAM,aACJ,QACA,WACA,QACY;CACZ,IAAI,kBAAkB;CACtB,IAAI,OAAO;CAEX,IAAI,IAAI,SAAS,GAAG,GAAG;EACrB,MAAM,iBAAiB,IAAI,QAAQ,GAAG;EACtC,kBAAkB,IAAI,MAAM,GAAG,cAAc;EAC7C,OAA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,AAAC,IAAI,OAAO,iBAA6C,QACvD;GAGF,IAAI,UAAU,KAAK;IACjB,aAAa;IACb,SAAS;GACX,CAAC;EACH;CACF;CAEA,OAAO;AACT;;;;;;;;;;;;;;;;;;AAkCA,MAAa,YACX,YACG;CACH,MAAM,EAAE,QAAQ,eAAe,WAAW,qBAAqB,UAAU;CAIzE,MAAM,mBAHW,OAAO,gBAGQ,CAAC,EAAE;CAInC,MAAM,YAAY,SAAS;CAE3B,MAAM,kBAAkB,SAAS;CAGjC,MAAM,gBAAgB,SAAS;CAI/B,MAAM,YAAY,SAAS;EACzB,WAAW,cAAc;EACzB,MAAM,cAAsB;GAC1B,UAAU,SAA0B;EACtC;CACF,CAAC;CAED,MAAM,aAAa,KAAa,GAAG,SACjC,aAAa,cAAc,OAAO,WAAW,KAAK,MAAM,gBAAgB;CAE1E,OAAO;EACL,QAAQ;EACU;EAClB,GAAG;EACH,IAAI;EACJ,KAAK,QACH,UAAU,cAAc,OAAO,WAAW,GAAG,MAAM;EACrD,KAAK,QACH,UAAU,cAAc,OAAO,WAAW,GAAG,KAAK,CAAC;EACrD,KAAK,SAAkB,GAAG,SAA4B;GACpD,MAAM,EAAE,QAAQ,UAAU,wBAAwB,IAAI;GACtD,OAAO,kBACL,SACA,QACA,OACA,cAAc,KAChB;EACF;EACA,IACE,OACA,oBAEA,gBACE,OACA,iBACA,cAAc,OACd,eACF;EACF,IACE,OACA,oBAEA,kBACE,OACA,iBACA,cAAc,OACd,aACF;CACJ;AACF"}
1
+ {"version":3,"file":"createI18n.mjs","names":[],"sources":["../../src/createI18n.ts"],"sourcesContent":["import { internationalization, log } from '@intlayer/config/built';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getIntlayer } from '@intlayer/core/interpreter';\nimport { navigatePath } from '@intlayer/core/messageFormat';\nimport type {\n DictionaryKeys,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type {\n App,\n DirectiveBinding,\n InjectionKey,\n WritableComputedRef,\n} from 'vue';\nimport { computed, inject } from 'vue';\nimport type { createI18n as _createI18n, I18n } from 'vue-i18n';\nimport {\n createIntlayerClient,\n INTLAYER_SYMBOL,\n installIntlayer,\n useLocale,\n} from 'vue-intlayer';\nimport {\n type DateTimeFormatsConfig,\n formatDateValue,\n formatNumberValue,\n type NumberFormatsConfig,\n} from './formats';\nimport {\n parseTranslateArguments,\n resolveVueMessage,\n} from './resolveVueMessage';\nimport type { LooseComposer, TypedComposer } from './typedComposer';\n\nexport const VERSION = '9.13.1';\nexport const I18nInjectionKey: InjectionKey<I18n> = Symbol('global-i18n');\n\n/**\n * Dictionary key used for keys that carry no explicit namespace and are not\n * dot-namespaced (i18next-style flat keys, e.g. `t('greeting')`).\n */\nconst DEFAULT_NAMESPACE = 'translation';\n\n/**\n * Looks up a raw value for a vue-i18n key against intlayer dictionaries.\n *\n * Resolution order:\n * 1. `ns:key` prefix → dictionary `ns`\n * 2. The default namespace dictionary with the full dot-path\n * 3. The first key segment as the dictionary key (`'home.title'` →\n * dictionary `home`, path `title`)\n */\n/** Resolves a single dictionary by key and navigates to the given path. */\nconst lookupInDictionary = (\n locale: string,\n dictionaryKey: string,\n path: string\n): unknown => {\n try {\n const dictionary = getIntlayer(\n dictionaryKey as DictionaryKeys,\n locale as LocalesValues\n );\n const value = navigatePath(dictionary, path);\n if (value !== undefined && value !== null) return value;\n } catch {}\n return undefined;\n};\n\nconst lookupRaw = (\n locale: string,\n namespace: string | undefined,\n key: string\n): unknown => {\n let targetNamespace = namespace;\n let path = key;\n\n if (key.includes(':')) {\n const separatorIndex = key.indexOf(':');\n targetNamespace = key.slice(0, separatorIndex);\n path = key.slice(separatorIndex + 1);\n }\n\n // 1. Explicit namespace (from `useI18n({ namespace })` or a `ns:key` prefix)\n if (targetNamespace) {\n const value = lookupInDictionary(locale, targetNamespace, path);\n if (value !== undefined) return value;\n }\n\n // 2. First key segment as the dictionary key (`'home.title'` →\n // dictionary `home`, path `title`). This makes the global `t()` work\n // without a namespace, matching how intlayer splits dictionaries by key.\n if (path.includes('.')) {\n const separatorIndex = path.indexOf('.');\n const value = lookupInDictionary(\n locale,\n path.slice(0, separatorIndex),\n path.slice(separatorIndex + 1)\n );\n if (value !== undefined) return value;\n }\n\n // 3. Default `translation` bucket for flat, namespace-less keys.\n if (!targetNamespace) {\n const value = lookupInDictionary(locale, DEFAULT_NAMESPACE, path);\n if (value !== undefined) return value;\n }\n\n return undefined;\n};\n\n/** Translates a key with vue-i18n's polymorphic argument list. */\nconst translateKey = (\n locale: string,\n namespace: string | undefined,\n key: string,\n args: unknown[],\n fallbackMessages?: Record<string, unknown>\n): string => {\n const { values, count, defaultMessage } = parseTranslateArguments(args);\n\n const rawValue = lookupRaw(locale, namespace, key);\n\n if (rawValue === undefined) {\n if (fallbackMessages?.[locale]) {\n // Defer to the user's provided messages if not found in dictionaries\n const targetPath = namespace ? `${namespace}.${key}` : key;\n const fallbackValue = navigatePath(fallbackMessages[locale], targetPath);\n if (fallbackValue !== undefined) {\n return resolveVueMessage(\n fallbackValue,\n values,\n count,\n locale as LocalesValues\n );\n }\n }\n if (defaultMessage !== undefined) {\n return resolveVueMessage(\n defaultMessage,\n values,\n count,\n locale as LocalesValues\n );\n }\n return key;\n }\n\n return resolveVueMessage(rawValue, values, count, locale as LocalesValues);\n};\n\nconst getAvailableLocales = (): string[] =>\n internationalization?.locales?.map(String) ?? [];\n\nconst warnDeprecatedRuntimeMessages = (location: string) => {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize(location, ANSIColors.CYAN)} has no effect with ${colorize('@intlayer/vue-i18n', ANSIColors.MAGENTA)} — translations are managed by the compiled intlayer dictionaries.`\n );\n};\n\n/** Value accepted by the `v-t` directive. */\ntype TranslateDirectiveValue =\n | string\n | { path: string; args?: Record<string, unknown>; choice?: number };\n\nexport const createI18n: typeof _createI18n = ((\n options: Record<string, unknown> = {}\n) => {\n const fallbackMessages = options.messages as\n | Record<string, unknown>\n | undefined;\n\n if (\n options.messages !== undefined &&\n process.env.NODE_ENV === 'development'\n ) {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('createI18n', ANSIColors.CYAN)}: the ${colorize('`messages`', ANSIColors.CYAN)} option is used as a fallback. For optimal bundle size, remove the locale JSON imports and use ${colorize('useDictionary', ANSIColors.CYAN)} or compile your intlayer dictionaries instead:\\n ${colorize('Before:', ANSIColors.GREY)} createI18n({ messages: { en, fr, … } })\\n ${colorize('After: ', ANSIColors.GREY)} createI18n({})`\n );\n }\n\n const client = createIntlayerClient(options.locale as LocalesValues);\n\n const datetimeFormats = options.datetimeFormats as\n | DateTimeFormatsConfig\n | undefined;\n const numberFormats = options.numberFormats as\n | NumberFormatsConfig\n | undefined;\n\n const currentLocale = (): string => String(client.locale.value);\n\n /** Writable ref matching vue-i18n's composition-mode `global.locale`. */\n const localeRef: WritableComputedRef<string> = computed({\n get: () => currentLocale(),\n set: (newLocale: string) => {\n client.setLocale(newLocale as LocalesValues);\n },\n });\n\n const globalTranslate = (key: string, ...args: unknown[]): string =>\n translateKey(currentLocale(), undefined, key, args, fallbackMessages);\n\n const globalDate = (\n value: Date | number | string,\n formatOrOptions?: string | Intl.DateTimeFormatOptions\n ): string =>\n formatDateValue(value, formatOrOptions, currentLocale(), datetimeFormats);\n\n const globalNumber = (\n value: number,\n formatOrOptions?: string | Intl.NumberFormatOptions\n ): string =>\n formatNumberValue(value, formatOrOptions, currentLocale(), numberFormats);\n\n const global = {\n locale: localeRef,\n availableLocales: getAvailableLocales(),\n fallbackLocale: (options.fallbackLocale ??\n internationalization?.defaultLocale) as string,\n t: globalTranslate,\n tc: globalTranslate,\n te: (key: string): boolean =>\n lookupRaw(currentLocale(), undefined, key) !== undefined,\n tm: (key: string): unknown =>\n lookupRaw(currentLocale(), undefined, key) ?? {},\n rt: (message: unknown, ...args: unknown[]): string => {\n const { values, count } = parseTranslateArguments(args);\n return resolveVueMessage(\n message,\n values,\n count,\n currentLocale() as LocalesValues\n );\n },\n d: globalDate,\n n: globalNumber,\n setLocaleMessage: (_locale: string, _messages: unknown) => {\n warnDeprecatedRuntimeMessages('setLocaleMessage');\n },\n mergeLocaleMessage: (_locale: string, _messages: unknown) => {\n warnDeprecatedRuntimeMessages('mergeLocaleMessage');\n },\n getLocaleMessage: (_locale: string): Record<string, unknown> => {\n warnDeprecatedRuntimeMessages('getLocaleMessage');\n // We do not load global dictionaries anymore for bundle optimization.\n // The user should use useDictionary or rely on manually provided messages.\n return {};\n },\n };\n\n /** Legacy Options-API facade (`this.$i18n`) with a string `locale`. */\n const legacyI18n = {\n get locale(): string {\n return currentLocale();\n },\n set locale(newLocale: string) {\n client.setLocale(newLocale as LocalesValues);\n },\n get availableLocales(): string[] {\n return getAvailableLocales();\n },\n t: globalTranslate,\n tc: globalTranslate,\n te: global.te,\n tm: global.tm,\n rt: global.rt,\n d: globalDate,\n n: globalNumber,\n };\n\n const applyTranslateDirective = (\n element: HTMLElement,\n binding: DirectiveBinding<TranslateDirectiveValue>\n ) => {\n const bindingValue = binding.value;\n if (typeof bindingValue === 'string') {\n element.textContent = globalTranslate(bindingValue);\n } else if (bindingValue && typeof bindingValue === 'object') {\n const directiveArgs: unknown[] = [];\n if (bindingValue.args) directiveArgs.push(bindingValue.args);\n if (typeof bindingValue.choice === 'number')\n directiveArgs.push(bindingValue.choice);\n element.textContent = globalTranslate(\n bindingValue.path,\n ...directiveArgs\n );\n }\n };\n\n const i18nInstance = {\n global,\n mode: options.legacy === true ? 'legacy' : 'composition',\n __optionsMessages: fallbackMessages,\n install(app: App) {\n // A framework integration (nuxt-intlayer) may have installed it already.\n const isIntlayerInstalled = INTLAYER_SYMBOL in app._context.provides;\n\n if (!isIntlayerInstalled) {\n installIntlayer(app, {\n locale: options.locale as LocalesValues,\n });\n }\n\n // Provide under I18nInjectionKey to satisfy inject(I18nInjectionKey) calls\n app.provide(I18nInjectionKey, i18nInstance as unknown as I18n);\n\n // Legacy API support ($t / $tc / $te / $tm / $rt / $d / $n / $i18n)\n app.config.globalProperties.$t = globalTranslate;\n (app.config.globalProperties as Record<string, unknown>).$tc =\n globalTranslate;\n (app.config.globalProperties as Record<string, unknown>).$te = global.te;\n (app.config.globalProperties as Record<string, unknown>).$tm = global.tm;\n (app.config.globalProperties as Record<string, unknown>).$rt = global.rt;\n (app.config.globalProperties as Record<string, unknown>).$d = globalDate;\n (app.config.globalProperties as Record<string, unknown>).$n =\n globalNumber;\n (app.config.globalProperties as Record<string, unknown>).$i18n =\n legacyI18n;\n\n // `v-t` directive support\n app.directive('t', {\n beforeMount: applyTranslateDirective,\n updated: applyTranslateDirective,\n });\n },\n };\n\n return i18nInstance as unknown as I18n;\n}) as typeof _createI18n;\n\n/**\n * Overload set for {@link useI18n}: with a `namespace` option the composer is\n * fully typed against that dictionary (keys and return values); without one\n * the root scope applies — the first segment of each key designates the\n * dictionary (`t('about.title')`).\n */\ntype UseI18n = {\n <N extends DictionaryKeys>(\n options: Record<string, unknown> & { namespace: N }\n ): TypedComposer<N>;\n (\n options?: Record<string, unknown> & { namespace?: undefined }\n ): LooseComposer;\n};\n\n/**\n * Composable providing a typed `t()` function scoped to a dictionary namespace.\n * Pass `{ namespace: 'myDict' }` to restrict keys to valid dot-notation paths\n * within that intlayer dictionary (autocompleted and validated at compile\n * time) and resolve return types from the content at each path.\n *\n * Supports vue-i18n's full message syntax: named (`{name}`) and list (`{0}`)\n * interpolation, pipe choice messages (`'car | cars'` with a count argument),\n * plus `te`/`tm`/`rt` and `Intl`-backed `d()`/`n()` formatters.\n *\n * @example\n * ```ts\n * const { t } = useI18n({ namespace: 'about' });\n * t('counter.label'); // ✓ typed key and return value\n * t('apples', 5); // pipe plural choice\n * ```\n */\nexport const useI18n = ((\n options?: Record<string, unknown> & { namespace?: string }\n) => {\n const { locale: currentLocale, setLocale, availableLocales } = useLocale();\n const instance = inject(I18nInjectionKey) as unknown as\n | Record<string, unknown>\n | undefined;\n const fallbackMessages = instance?.__optionsMessages as\n | Record<string, unknown>\n | undefined;\n\n const namespace = options?.namespace as string | undefined;\n\n const datetimeFormats = options?.datetimeFormats as\n | DateTimeFormatsConfig\n | undefined;\n const numberFormats = options?.numberFormats as\n | NumberFormatsConfig\n | undefined;\n\n const localeRef = computed({\n get: () => currentLocale.value as string,\n set: (newLocale: string) => {\n setLocale(newLocale as LocalesValues);\n },\n });\n\n const translate = (key: string, ...args: unknown[]): string =>\n translateKey(currentLocale.value, namespace, key, args, fallbackMessages);\n\n return {\n locale: localeRef,\n availableLocales: availableLocales as string[],\n t: translate,\n tc: translate,\n te: (key: string): boolean =>\n lookupRaw(currentLocale.value, namespace, key) !== undefined,\n tm: (key: string): unknown =>\n lookupRaw(currentLocale.value, namespace, key) ?? {},\n rt: (message: unknown, ...args: unknown[]): string => {\n const { values, count } = parseTranslateArguments(args);\n return resolveVueMessage(\n message,\n values,\n count,\n currentLocale.value as LocalesValues\n );\n },\n d: (\n value: Date | number | string,\n formatOrOptions?: string | Intl.DateTimeFormatOptions\n ): string =>\n formatDateValue(\n value,\n formatOrOptions,\n currentLocale.value,\n datetimeFormats\n ),\n n: (\n value: number,\n formatOrOptions?: string | Intl.NumberFormatOptions\n ): string =>\n formatNumberValue(\n value,\n formatOrOptions,\n currentLocale.value,\n numberFormats\n ),\n };\n}) as UseI18n;\n"],"mappings":";;;;;;;;;;;AAmCA,MAAa,UAAU;AACvB,MAAa,mBAAuC,OAAO,aAAa;;;;;AAMxE,MAAM,oBAAoB;;;;;;;;;;;AAY1B,MAAM,sBACJ,QACA,eACA,SACY;CACZ,IAAI;EACF,MAAM,aAAa,YACjB,eACA,MACF;EACA,MAAM,QAAQ,aAAa,YAAY,IAAI;EAC3C,IAAI,UAAU,UAAa,UAAU,MAAM,OAAO;CACpD,QAAQ,CAAC;AAEX;AAEA,MAAM,aACJ,QACA,WACA,QACY;CACZ,IAAI,kBAAkB;CACtB,IAAI,OAAO;CAEX,IAAI,IAAI,SAAS,GAAG,GAAG;EACrB,MAAM,iBAAiB,IAAI,QAAQ,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BAA6C,KAAK;GAC9D,AAAC,IAAI,OAAO,iBAA6C,KACvD;GACF,AAAC,IAAI,OAAO,iBAA6C,QACvD;GAGF,IAAI,UAAU,KAAK;IACjB,aAAa;IACb,SAAS;GACX,CAAC;EACH;CACF;CAEA,OAAO;AACT;;;;;;;;;;;;;;;;;;AAkCA,MAAa,YACX,YACG;CACH,MAAM,EAAE,QAAQ,eAAe,WAAW,qBAAqB,UAAU;CAIzE,MAAM,mBAHW,OAAO,gBAGQ,CAAC,EAAE;CAInC,MAAM,YAAY,SAAS;CAE3B,MAAM,kBAAkB,SAAS;CAGjC,MAAM,gBAAgB,SAAS;CAI/B,MAAM,YAAY,SAAS;EACzB,WAAW,cAAc;EACzB,MAAM,cAAsB;GAC1B,UAAU,SAA0B;EACtC;CACF,CAAC;CAED,MAAM,aAAa,KAAa,GAAG,SACjC,aAAa,cAAc,OAAO,WAAW,KAAK,MAAM,gBAAgB;CAE1E,OAAO;EACL,QAAQ;EACU;EAClB,GAAG;EACH,IAAI;EACJ,KAAK,QACH,UAAU,cAAc,OAAO,WAAW,GAAG,MAAM;EACrD,KAAK,QACH,UAAU,cAAc,OAAO,WAAW,GAAG,KAAK,CAAC;EACrD,KAAK,SAAkB,GAAG,SAA4B;GACpD,MAAM,EAAE,QAAQ,UAAU,wBAAwB,IAAI;GACtD,OAAO,kBACL,SACA,QACA,OACA,cAAc,KAChB;EACF;EACA,IACE,OACA,oBAEA,gBACE,OACA,iBACA,cAAc,OACd,eACF;EACF,IACE,OACA,oBAEA,kBACE,OACA,iBACA,cAAc,OACd,aACF;CACJ;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/vue-i18n",
3
- "version": "9.5.11",
3
+ "version": "9.5.12",
4
4
  "private": false,
5
5
  "description": "vue-i18n API adapter for intlayer — useI18n, createI18n, and installIntlayer backed by vue-intlayer",
6
6
  "keywords": [
@@ -76,13 +76,13 @@
76
76
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
77
77
  },
78
78
  "dependencies": {
79
- "@intlayer/config": "9.5.11",
80
- "@intlayer/core": "9.5.11",
81
- "@intlayer/dictionaries-entry": "9.5.11",
82
- "@intlayer/engine": "9.5.11",
83
- "@intlayer/types": "9.5.11",
84
- "vite-intlayer": "9.5.11",
85
- "vue-intlayer": "9.5.11"
79
+ "@intlayer/config": "9.5.12",
80
+ "@intlayer/core": "9.5.12",
81
+ "@intlayer/dictionaries-entry": "9.5.12",
82
+ "@intlayer/engine": "9.5.12",
83
+ "@intlayer/types": "9.5.12",
84
+ "vite-intlayer": "9.5.12",
85
+ "vue-intlayer": "9.5.12"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@types/node": "^22",