nuxt-i18n-micro 1.59.0 → 1.60.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/client/200.html +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/1bc37d11-ac0a-4cf4-9f49-6f1123ca70df.json +1 -0
- package/dist/client/index.html +2 -2
- package/dist/module.d.mts +2 -2
- package/dist/module.d.ts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +20 -16
- package/dist/runtime/plugins/01.plugin.d.ts +4 -4
- package/dist/runtime/plugins/01.plugin.js +12 -6
- package/dist/shared/{nuxt-i18n-micro.4444721d.d.mts → nuxt-i18n-micro.4b19b717.d.mts} +1 -0
- package/dist/shared/{nuxt-i18n-micro.4444721d.d.ts → nuxt-i18n-micro.4b19b717.d.ts} +1 -0
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/client/_nuxt/builds/meta/cd075107-392f-495b-8345-ce296b14f76e.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/EwNUkbJF.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.C2JGrgZX.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DuZjM2Ym.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/C9njAg9E.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"
|
|
11
|
+
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/C9njAg9E.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1736853592172,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"1bc37d11-ac0a-4cf4-9f49-6f1123ca70df",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/EwNUkbJF.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.C2JGrgZX.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DuZjM2Ym.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/C9njAg9E.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"
|
|
11
|
+
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/C9njAg9E.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1736853592173,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"1bc37d11-ac0a-4cf4-9f49-6f1123ca70df",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"1bc37d11-ac0a-4cf4-9f49-6f1123ca70df","timestamp":1736853586767}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"1bc37d11-ac0a-4cf4-9f49-6f1123ca70df","timestamp":1736853586767,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/EwNUkbJF.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.C2JGrgZX.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DuZjM2Ym.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/C9njAg9E.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"
|
|
11
|
+
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/C9njAg9E.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1736853592173,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"1bc37d11-ac0a-4cf4-9f49-6f1123ca70df",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
import { HookResult } from '@nuxt/schema';
|
|
3
|
-
import { M as ModulePrivateOptionsExtend, b as ModuleOptionsExtend, c as ModuleOptions } from './shared/nuxt-i18n-micro.
|
|
4
|
-
export { d as Getter, G as GlobalLocaleRoutes, a as Locale, L as LocaleCode, P as PluralFunc } from './shared/nuxt-i18n-micro.
|
|
3
|
+
import { M as ModulePrivateOptionsExtend, b as ModuleOptionsExtend, c as ModuleOptions } from './shared/nuxt-i18n-micro.4b19b717.mjs';
|
|
4
|
+
export { d as Getter, G as GlobalLocaleRoutes, a as Locale, L as LocaleCode, P as PluralFunc } from './shared/nuxt-i18n-micro.4b19b717.mjs';
|
|
5
5
|
export { PluginsInjections } from '../dist/runtime/plugins/01.plugin.js';
|
|
6
6
|
|
|
7
7
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
package/dist/module.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
import { HookResult } from '@nuxt/schema';
|
|
3
|
-
import { M as ModulePrivateOptionsExtend, b as ModuleOptionsExtend, c as ModuleOptions } from './shared/nuxt-i18n-micro.
|
|
4
|
-
export { d as Getter, G as GlobalLocaleRoutes, a as Locale, L as LocaleCode, P as PluralFunc } from './shared/nuxt-i18n-micro.
|
|
3
|
+
import { M as ModulePrivateOptionsExtend, b as ModuleOptionsExtend, c as ModuleOptions } from './shared/nuxt-i18n-micro.4b19b717.js';
|
|
4
|
+
export { d as Getter, G as GlobalLocaleRoutes, a as Locale, L as LocaleCode, P as PluralFunc } from './shared/nuxt-i18n-micro.4b19b717.js';
|
|
5
5
|
export { PluginsInjections } from '../dist/runtime/plugins/01.plugin.js';
|
|
6
6
|
|
|
7
7
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -395,6 +395,7 @@ const module = defineNuxtModule({
|
|
|
395
395
|
autoDetectLanguage: true,
|
|
396
396
|
disablePageLocales: false,
|
|
397
397
|
disableWatcher: false,
|
|
398
|
+
disableUpdater: false,
|
|
398
399
|
includeDefaultLocaleRoute: void 0,
|
|
399
400
|
fallbackLocale: void 0,
|
|
400
401
|
localeCookie: "user-locale",
|
|
@@ -440,6 +441,7 @@ const module = defineNuxtModule({
|
|
|
440
441
|
metaBaseUrl: options.metaBaseUrl ?? void 0,
|
|
441
442
|
define: options.define ?? true,
|
|
442
443
|
disableWatcher: options.disableWatcher ?? false,
|
|
444
|
+
disableUpdater: options.disableUpdater ?? false,
|
|
443
445
|
defaultLocale: options.defaultLocale ?? "en",
|
|
444
446
|
translationDir: options.translationDir ?? "locales",
|
|
445
447
|
localeCookie: options.localeCookie ?? "user-locale",
|
|
@@ -615,22 +617,24 @@ const module = defineNuxtModule({
|
|
|
615
617
|
}
|
|
616
618
|
}
|
|
617
619
|
});
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
620
|
+
if (!options.disableUpdater) {
|
|
621
|
+
nuxt.hook("nitro:build:before", async (_nitro) => {
|
|
622
|
+
const isProd = nuxt.options.dev === false;
|
|
623
|
+
if (!isProd) {
|
|
624
|
+
const translationPath = path.resolve(nuxt.options.rootDir, options.translationDir);
|
|
625
|
+
logger.log("\u2139 add file watcher: " + translationPath);
|
|
626
|
+
const watcherEvent = async (path2) => {
|
|
627
|
+
watcher.close();
|
|
628
|
+
logger.log("\u21BB update store item: " + path2);
|
|
629
|
+
nuxt.callHook("restart");
|
|
630
|
+
};
|
|
631
|
+
const watcher = watch(translationPath, { depth: 2, persistent: true }).on("change", watcherEvent);
|
|
632
|
+
nuxt.hook("close", () => {
|
|
633
|
+
watcher.close();
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
}
|
|
634
638
|
nuxt.hook("prerender:routes", async (prerenderRoutes) => {
|
|
635
639
|
if (isNoPrefixStrategy(options.strategy)) {
|
|
636
640
|
return;
|
|
@@ -20,8 +20,8 @@ declare const _default: import("nuxt/app").Plugin<{
|
|
|
20
20
|
switchLocaleRoute: (toLocale: string) => string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
21
21
|
switchLocalePath: (toLocale: string) => string;
|
|
22
22
|
switchLocale: (toLocale: string) => void;
|
|
23
|
-
switchRoute: (
|
|
24
|
-
localeRoute: (to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath, locale?: string) => RouteLocationResolved;
|
|
23
|
+
switchRoute: (to: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric | string, toLocale?: string) => void;
|
|
24
|
+
localeRoute: (to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath | string, locale?: string) => RouteLocationResolved;
|
|
25
25
|
localePath: (to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath, locale?: string) => string;
|
|
26
26
|
setI18nRouteParams: (value: I18nRouteParams) => I18nRouteParams;
|
|
27
27
|
}> & import("nuxt/app").ObjectPlugin<{
|
|
@@ -43,8 +43,8 @@ declare const _default: import("nuxt/app").Plugin<{
|
|
|
43
43
|
switchLocaleRoute: (toLocale: string) => string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
44
44
|
switchLocalePath: (toLocale: string) => string;
|
|
45
45
|
switchLocale: (toLocale: string) => void;
|
|
46
|
-
switchRoute: (
|
|
47
|
-
localeRoute: (to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath, locale?: string) => RouteLocationResolved;
|
|
46
|
+
switchRoute: (to: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric | string, toLocale?: string) => void;
|
|
47
|
+
localeRoute: (to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath | string, locale?: string) => RouteLocationResolved;
|
|
48
48
|
localePath: (to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath, locale?: string) => string;
|
|
49
49
|
setI18nRouteParams: (value: I18nRouteParams) => I18nRouteParams;
|
|
50
50
|
}>;
|
|
@@ -374,22 +374,28 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
374
374
|
const route2 = router.currentRoute.value;
|
|
375
375
|
switchLocale(i18nHelper.getLocale(), toLocale, route2, router, i18nConfig, i18nRouteParams.value);
|
|
376
376
|
},
|
|
377
|
-
switchRoute: (
|
|
377
|
+
switchRoute: (to, toLocale) => {
|
|
378
378
|
const currentRoute = router.currentRoute.value;
|
|
379
379
|
const fromLocale = (currentRoute.params?.locale ?? i18nConfig.defaultLocale).toString();
|
|
380
380
|
const currentLocale2 = toLocale ?? fromLocale;
|
|
381
|
-
|
|
382
|
-
if (typeof route2 === "string" && !isNoPrefixStrategy(i18nConfig.strategy)) {
|
|
381
|
+
if (typeof to === "string" && !isNoPrefixStrategy(i18nConfig.strategy)) {
|
|
383
382
|
if (currentLocale2 !== i18nConfig.defaultLocale || withPrefixStrategy(i18nConfig.strategy)) {
|
|
384
|
-
to = router.resolve("/" + fromLocale +
|
|
383
|
+
to = router.resolve("/" + fromLocale + to);
|
|
385
384
|
} else {
|
|
386
|
-
to = router.resolve(
|
|
385
|
+
to = router.resolve(route);
|
|
387
386
|
}
|
|
388
387
|
}
|
|
389
388
|
if (!to) {
|
|
390
389
|
return;
|
|
391
390
|
}
|
|
392
|
-
switchLocale(
|
|
391
|
+
switchLocale(
|
|
392
|
+
i18nHelper.getLocale(),
|
|
393
|
+
toLocale ?? fromLocale,
|
|
394
|
+
to,
|
|
395
|
+
router,
|
|
396
|
+
i18nConfig,
|
|
397
|
+
i18nRouteParams.value
|
|
398
|
+
);
|
|
393
399
|
},
|
|
394
400
|
localeRoute: (to, locale) => {
|
|
395
401
|
const fromLocale = i18nHelper.getLocale();
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NuxtPage } from '@nuxt/schema';
|
|
2
|
-
import { L as LocaleCode, a as Locale } from './shared/nuxt-i18n-micro.
|
|
2
|
+
import { L as LocaleCode, a as Locale } from './shared/nuxt-i18n-micro.4b19b717.mjs';
|
|
3
3
|
|
|
4
4
|
declare function extractLocaleRoutes(content: string, filePath: string): Record<string, string> | null;
|
|
5
5
|
declare function validateDefineI18nRouteConfig(obj: Record<LocaleCode, Record<string, string>>): boolean;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NuxtPage } from '@nuxt/schema';
|
|
2
|
-
import { L as LocaleCode, a as Locale } from './shared/nuxt-i18n-micro.
|
|
2
|
+
import { L as LocaleCode, a as Locale } from './shared/nuxt-i18n-micro.4b19b717.js';
|
|
3
3
|
|
|
4
4
|
declare function extractLocaleRoutes(content: string, filePath: string): Record<string, string> | null;
|
|
5
5
|
declare function validateDefineI18nRouteConfig(obj: Record<LocaleCode, Record<string, string>>): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.60.0",
|
|
4
4
|
"description": "Nuxt I18n Micro is a lightweight, high-performance internationalization module for Nuxt, designed to handle multi-language support with minimal overhead, fast build times, and efficient runtime performance.",
|
|
5
5
|
"repository": "s00d/nuxt-i18n-micro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"cd075107-392f-495b-8345-ce296b14f76e","timestamp":1736500534009,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|