nuxt-i18n-micro 3.29.1 → 3.29.3
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/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/652a5b66-66b7-45f2-a0fb-ea5f21477cbe.json +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +6 -0
- package/dist/runtime/components/i18n-t.d.vue.ts +1 -1
- package/dist/runtime/components/i18n-t.vue.d.ts +1 -1
- package/dist/runtime/composables/useI18nHead.d.ts +1 -1
- package/dist/runtime/composables/useI18nLocale.d.ts +7 -3
- package/dist/runtime/middleware/i18n-redirect.global.d.ts +1 -1
- package/dist/runtime/plugins/01.plugin.d.ts +88 -2
- package/dist/runtime/plugins/02.meta.d.ts +1 -1
- package/dist/runtime/plugins/03.define.d.ts +6 -1
- package/dist/runtime/plugins/04.vue-devtools.d.ts +1 -1
- package/dist/runtime/plugins/05.hooks.d.ts +1 -1
- package/dist/runtime/plugins/06.redirect.d.ts +1 -1
- package/package.json +5 -5
- package/dist/client/_nuxt/builds/meta/8104ebd3-b80c-4fad-8f1f-06608ed82759.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"652a5b66-66b7-45f2-a0fb-ea5f21477cbe",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789144005641,false]</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"652a5b66-66b7-45f2-a0fb-ea5f21477cbe",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789144005641,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"652a5b66-66b7-45f2-a0fb-ea5f21477cbe","timestamp":1789144002062}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"652a5b66-66b7-45f2-a0fb-ea5f21477cbe","timestamp":1789144002062,"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"652a5b66-66b7-45f2-a0fb-ea5f21477cbe",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789144005641,false]</script></body></html>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -704,6 +704,12 @@ const module$1 = defineNuxtModule({
|
|
|
704
704
|
const defaultLocale = process.env.DEFAULT_LOCALE ?? options.defaultLocale ?? "en";
|
|
705
705
|
const isSSG = Boolean(nuxt.options.nitro?.static);
|
|
706
706
|
const logger = useLogger("nuxt-i18n-micro");
|
|
707
|
+
nuxt.options.typescript.hoist ||= [];
|
|
708
|
+
for (const pkg of ["@i18n-micro/types", "@i18n-micro/path-strategy"]) {
|
|
709
|
+
if (!nuxt.options.typescript.hoist.includes(pkg)) {
|
|
710
|
+
nuxt.options.typescript.hoist.push(pkg);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
707
713
|
if (options.strategy === "no_prefix" && !options.localeCookie) {
|
|
708
714
|
options.localeCookie = "user-locale";
|
|
709
715
|
logger.info("Strategy 'no_prefix': localeCookie automatically set to 'user-locale' for locale persistence.");
|
|
@@ -119,9 +119,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
119
119
|
type: PropType<Date | string | number>;
|
|
120
120
|
};
|
|
121
121
|
}>> & Readonly<{}>, {
|
|
122
|
-
html: boolean;
|
|
123
122
|
params: Record<string, string | number | boolean>;
|
|
124
123
|
tag: string;
|
|
124
|
+
html: boolean;
|
|
125
125
|
defaultValue: string;
|
|
126
126
|
hideIfEmpty: boolean;
|
|
127
127
|
customPluralRule: PluralFunc;
|
|
@@ -119,9 +119,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
119
119
|
type: PropType<Date | string | number>;
|
|
120
120
|
};
|
|
121
121
|
}>> & Readonly<{}>, {
|
|
122
|
-
html: boolean;
|
|
123
122
|
params: Record<string, string | number | boolean>;
|
|
124
123
|
tag: string;
|
|
124
|
+
html: boolean;
|
|
125
125
|
defaultValue: string;
|
|
126
126
|
hideIfEmpty: boolean;
|
|
127
127
|
customPluralRule: PluralFunc;
|
|
@@ -8,6 +8,6 @@ import type { MaybeRefOrGetter } from 'vue';
|
|
|
8
8
|
* re-resolve on locale change. A plain object is evaluated once and stays frozen.
|
|
9
9
|
*/
|
|
10
10
|
export declare function useI18nHead(input?: MaybeRefOrGetter<I18nHeadInput | null>): {
|
|
11
|
-
pageHead:
|
|
11
|
+
pageHead: import("vue").Ref<I18nHeadInput | null, I18nHeadInput | null>;
|
|
12
12
|
resetPageHead: () => void;
|
|
13
13
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
type CookieRef = {
|
|
2
|
+
value: string | null;
|
|
3
|
+
};
|
|
1
4
|
/** Callback to get locale from route (RouteService.getCurrentLocale) */
|
|
2
5
|
export type GetLocaleFromRoute = (route?: unknown) => string;
|
|
3
6
|
export interface ResolveInitialLocaleOptions {
|
|
@@ -10,9 +13,9 @@ export interface ResolveInitialLocaleOptions {
|
|
|
10
13
|
* Combines useState('i18n-locale'), locale cookie, and sync utilities.
|
|
11
14
|
*/
|
|
12
15
|
export declare function useI18nLocale(): {
|
|
13
|
-
locale:
|
|
14
|
-
localeCookie:
|
|
15
|
-
hashCookie:
|
|
16
|
+
locale: import("vue").Ref<string | null, string | null>;
|
|
17
|
+
localeCookie: CookieRef;
|
|
18
|
+
hashCookie: CookieRef;
|
|
16
19
|
getPreferredLocale: () => string | null;
|
|
17
20
|
getLocale: () => string | null;
|
|
18
21
|
getLocaleWithServerFallback: (serverLocale?: string | null) => string | null;
|
|
@@ -23,3 +26,4 @@ export declare function useI18nLocale(): {
|
|
|
23
26
|
isValidLocale: (locale: string | null | undefined) => locale is string;
|
|
24
27
|
validLocales: string[];
|
|
25
28
|
};
|
|
29
|
+
export {};
|
|
@@ -1,7 +1,93 @@
|
|
|
1
1
|
import type { PathStrategy } from '@i18n-micro/path-strategy';
|
|
2
2
|
import type { CleanTranslation, DefineI18nRouteConfig, I18nRouteParams, Locale, MissingHandler, ModuleOptionsExtend, Params, Translations, TranslationKey } from '@i18n-micro/types';
|
|
3
3
|
import type { RouteLocationNamedRaw, RouteLocationNormalizedLoaded, RouteLocationRaw, RouteLocationResolved, RouteLocationResolvedGeneric } from 'vue-router';
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: import("nuxt/app").Plugin<{
|
|
5
|
+
getI18nConfig: () => ModuleOptionsExtend;
|
|
6
|
+
helper: {
|
|
7
|
+
mergeTranslation(locale: string, routeName: string, newTranslations: Translations, _force?: boolean): Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
i18n: unknown;
|
|
10
|
+
__micro: boolean;
|
|
11
|
+
i18nStrategy: PathStrategy;
|
|
12
|
+
getLocale: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric) => string;
|
|
13
|
+
getLocaleName: () => string | null;
|
|
14
|
+
defaultLocale: () => string | undefined;
|
|
15
|
+
getLocales: () => Locale[];
|
|
16
|
+
getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
|
|
17
|
+
t: (key: TranslationKey, params?: Params, defaultValue?: string | null, routeContext?: unknown) => CleanTranslation;
|
|
18
|
+
ts: (key: string, params?: Params, defaultValue?: string, route?: RouteLocationNormalizedLoaded) => string;
|
|
19
|
+
_t: (route: RouteLocationNormalizedLoaded) => (key: string, params?: Params, defaultValue?: string | null) => CleanTranslation;
|
|
20
|
+
_ts: (route: RouteLocationNormalizedLoaded) => (key: string, params?: Params, defaultValue?: string) => string;
|
|
21
|
+
tc: (key: TranslationKey, count: number | Params, defaultValue?: string) => string;
|
|
22
|
+
tn: {
|
|
23
|
+
(value: number, options?: Intl.NumberFormatOptions): string;
|
|
24
|
+
(value: number, key: string, overrides?: Intl.NumberFormatOptions): string;
|
|
25
|
+
(value: number, key: string, locale: string, overrides?: Intl.NumberFormatOptions): string;
|
|
26
|
+
};
|
|
27
|
+
td: {
|
|
28
|
+
(value: Date | number | string, options?: Intl.DateTimeFormatOptions): string;
|
|
29
|
+
(value: Date | number | string, key: string, overrides?: Intl.DateTimeFormatOptions): string;
|
|
30
|
+
(value: Date | number | string, key: string, locale: string, overrides?: Intl.DateTimeFormatOptions): string;
|
|
31
|
+
};
|
|
32
|
+
tdr: (value: Date | number | string, options?: Intl.RelativeTimeFormatOptions) => string;
|
|
33
|
+
has: (key: TranslationKey, routeContext?: unknown) => boolean;
|
|
34
|
+
resolveTranslations: (routeContext?: unknown) => Translations;
|
|
35
|
+
setTranslation: (key: TranslationKey, value: unknown) => void;
|
|
36
|
+
mergeTranslations: (newTranslations: Translations) => void;
|
|
37
|
+
switchLocaleRoute: (toLocale: string) => RouteLocationRaw;
|
|
38
|
+
clearCache: () => void;
|
|
39
|
+
switchLocalePath: (toLocale: string) => string;
|
|
40
|
+
switchLocale: (toLocale: string) => Promise<unknown>;
|
|
41
|
+
switchRoute: (route: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string, toLocale?: string) => unknown;
|
|
42
|
+
localeRoute(to: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string, locale?: string): RouteLocationResolved;
|
|
43
|
+
localePath(to: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string, locale?: string): string;
|
|
44
|
+
setI18nRouteParams: (value: I18nRouteParams) => I18nRouteParams;
|
|
45
|
+
loadPageTranslations: (locale: string, routeName: string, translations: Translations) => Promise<void>;
|
|
46
|
+
setMissingHandler: (handler: MissingHandler | null) => void;
|
|
47
|
+
}> & import("nuxt/app").ObjectPlugin<{
|
|
48
|
+
getI18nConfig: () => ModuleOptionsExtend;
|
|
49
|
+
helper: {
|
|
50
|
+
mergeTranslation(locale: string, routeName: string, newTranslations: Translations, _force?: boolean): Promise<void>;
|
|
51
|
+
};
|
|
52
|
+
i18n: unknown;
|
|
53
|
+
__micro: boolean;
|
|
54
|
+
i18nStrategy: PathStrategy;
|
|
55
|
+
getLocale: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric) => string;
|
|
56
|
+
getLocaleName: () => string | null;
|
|
57
|
+
defaultLocale: () => string | undefined;
|
|
58
|
+
getLocales: () => Locale[];
|
|
59
|
+
getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
|
|
60
|
+
t: (key: TranslationKey, params?: Params, defaultValue?: string | null, routeContext?: unknown) => CleanTranslation;
|
|
61
|
+
ts: (key: string, params?: Params, defaultValue?: string, route?: RouteLocationNormalizedLoaded) => string;
|
|
62
|
+
_t: (route: RouteLocationNormalizedLoaded) => (key: string, params?: Params, defaultValue?: string | null) => CleanTranslation;
|
|
63
|
+
_ts: (route: RouteLocationNormalizedLoaded) => (key: string, params?: Params, defaultValue?: string) => string;
|
|
64
|
+
tc: (key: TranslationKey, count: number | Params, defaultValue?: string) => string;
|
|
65
|
+
tn: {
|
|
66
|
+
(value: number, options?: Intl.NumberFormatOptions): string;
|
|
67
|
+
(value: number, key: string, overrides?: Intl.NumberFormatOptions): string;
|
|
68
|
+
(value: number, key: string, locale: string, overrides?: Intl.NumberFormatOptions): string;
|
|
69
|
+
};
|
|
70
|
+
td: {
|
|
71
|
+
(value: Date | number | string, options?: Intl.DateTimeFormatOptions): string;
|
|
72
|
+
(value: Date | number | string, key: string, overrides?: Intl.DateTimeFormatOptions): string;
|
|
73
|
+
(value: Date | number | string, key: string, locale: string, overrides?: Intl.DateTimeFormatOptions): string;
|
|
74
|
+
};
|
|
75
|
+
tdr: (value: Date | number | string, options?: Intl.RelativeTimeFormatOptions) => string;
|
|
76
|
+
has: (key: TranslationKey, routeContext?: unknown) => boolean;
|
|
77
|
+
resolveTranslations: (routeContext?: unknown) => Translations;
|
|
78
|
+
setTranslation: (key: TranslationKey, value: unknown) => void;
|
|
79
|
+
mergeTranslations: (newTranslations: Translations) => void;
|
|
80
|
+
switchLocaleRoute: (toLocale: string) => RouteLocationRaw;
|
|
81
|
+
clearCache: () => void;
|
|
82
|
+
switchLocalePath: (toLocale: string) => string;
|
|
83
|
+
switchLocale: (toLocale: string) => Promise<unknown>;
|
|
84
|
+
switchRoute: (route: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string, toLocale?: string) => unknown;
|
|
85
|
+
localeRoute(to: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string, locale?: string): RouteLocationResolved;
|
|
86
|
+
localePath(to: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string, locale?: string): string;
|
|
87
|
+
setI18nRouteParams: (value: I18nRouteParams) => I18nRouteParams;
|
|
88
|
+
loadPageTranslations: (locale: string, routeName: string, translations: Translations) => Promise<void>;
|
|
89
|
+
setMissingHandler: (handler: MissingHandler | null) => void;
|
|
90
|
+
}>;
|
|
5
91
|
export default _default;
|
|
6
92
|
export type TranslationFn<T extends CleanTranslation> = (key: TranslationKey, params?: Params, defaultValue?: string | null) => T;
|
|
7
93
|
export interface PluginsInjections {
|
|
@@ -18,7 +104,7 @@ export interface PluginsInjections {
|
|
|
18
104
|
/** Every configured locale, with its metadata. */
|
|
19
105
|
$getLocales: () => Locale[];
|
|
20
106
|
/** Route name with the locale prefix stripped — the name translations are keyed by. */
|
|
21
|
-
$getRouteName: (route?:
|
|
107
|
+
$getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
|
|
22
108
|
/**
|
|
23
109
|
* Translate a key, interpolating `params` into it. Returns `defaultValue` when the key is
|
|
24
110
|
* missing, or the key itself when no default is given.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DefineI18nRouteConfig } from '@i18n-micro/types';
|
|
2
|
+
declare const _default: import("nuxt/app").Plugin<{
|
|
3
|
+
defineI18nRoute: (routeDefinition: DefineI18nRouteConfig) => Promise<void>;
|
|
4
|
+
}> & import("nuxt/app").ObjectPlugin<{
|
|
5
|
+
defineI18nRoute: (routeDefinition: DefineI18nRouteConfig) => Promise<void>;
|
|
6
|
+
}>;
|
|
2
7
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Handles locale detection, 404 checks, and redirects.
|
|
4
4
|
* Client SPA redirects are handled by i18n-redirect route middleware.
|
|
5
5
|
*/
|
|
6
|
-
declare const _default:
|
|
6
|
+
declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
|
|
7
7
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "3.29.
|
|
3
|
+
"version": "3.29.3",
|
|
4
4
|
"description": "Fast, lightweight i18n for Nuxt with strategy-based routing and minimal overhead.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
"sirv": "^2.0.3",
|
|
83
83
|
"ufo": "^1.6.4",
|
|
84
84
|
"unplugin": "^1.16.1 || ^2.0.0 || ^3.3.0",
|
|
85
|
-
"@i18n-micro/path-strategy": "^1.3.16",
|
|
86
85
|
"@i18n-micro/core": "^1.3.17",
|
|
87
|
-
"@i18n-micro/hmr": "^1.0.14",
|
|
88
|
-
"@i18n-micro/route-strategy": "^1.1.24",
|
|
89
86
|
"@i18n-micro/test-utils": "^1.2.14",
|
|
87
|
+
"@i18n-micro/types": "^1.2.14",
|
|
88
|
+
"@i18n-micro/route-strategy": "^1.1.24",
|
|
90
89
|
"@i18n-micro/utils": "^1.0.22",
|
|
91
|
-
"@i18n-micro/
|
|
90
|
+
"@i18n-micro/path-strategy": "^1.3.16",
|
|
91
|
+
"@i18n-micro/hmr": "^1.0.14"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@nuxt/devtools": "^3.4.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"8104ebd3-b80c-4fad-8f1f-06608ed82759","timestamp":1789035651263,"prerendered":[]}
|