nuxt-i18n-micro 1.31.6 → 1.31.8
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 +6 -6
- package/dist/client/404.html +6 -6
- package/dist/client/_nuxt/{BARbCa2g.js → BJqhKqO8.js} +1 -1
- package/dist/client/_nuxt/{DwKyf7FR.js → Cdhtwg8F.js} +1 -1
- package/dist/client/_nuxt/{C4eGGOXV.js → CtL0IzHt.js} +1 -1
- package/dist/client/_nuxt/{CTiMIQCz.js → DT6fB3yc.js} +47 -47
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c80843ab-c12f-4236-a426-7df544319fb9.json +1 -0
- package/dist/client/index.html +6 -6
- package/dist/module.d.mts +1 -0
- package/dist/module.d.ts +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -0
- package/dist/runtime/plugins/04.auto-detect.js +8 -3
- package/package.json +1 -1
- package/dist/client/_nuxt/builds/meta/808a05a6-3a75-4640-8368-4ee1714a50e7.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"c80843ab-c12f-4236-a426-7df544319fb9","timestamp":1731047353542}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"c80843ab-c12f-4236-a426-7df544319fb9","timestamp":1731047353542,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
3
|
<link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.BqOlM4b6.css">
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/DT6fB3yc.js">
|
|
5
5
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/B6E6ObS_.js">
|
|
6
6
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.C_4C5G96.css">
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
8
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Cdhtwg8F.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CtL0IzHt.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.CBAEdpZV.css">
|
|
10
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
11
|
-
<script type="module" src="/__nuxt-i18n-micro/_nuxt/
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BJqhKqO8.js">
|
|
11
|
+
<script type="module" src="/__nuxt-i18n-micro/_nuxt/DT6fB3yc.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},1731047364611,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"c80843ab-c12f-4236-a426-7df544319fb9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.d.mts
CHANGED
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -438,6 +438,7 @@ const module = defineNuxtModule({
|
|
|
438
438
|
customRegexMatcher: void 0
|
|
439
439
|
},
|
|
440
440
|
async setup(options, nuxt) {
|
|
441
|
+
const isSSG = nuxt.options._generate;
|
|
441
442
|
const isCloudflarePages = nuxt.options.nitro.preset === "cloudflare_pages" || process.env.NITRO_PRESET === "cloudflare-pages";
|
|
442
443
|
if (isCloudflarePages && !options.includeDefaultLocaleRoute) {
|
|
443
444
|
throw new Error('Nuxt-i18n-micro: "includeDefaultLocaleRoute" must be set to true when using Cloudflare Pages.');
|
|
@@ -472,6 +473,7 @@ const module = defineNuxtModule({
|
|
|
472
473
|
hashMode: nuxt.options?.router?.options?.hashMode ?? false,
|
|
473
474
|
globalLocaleRoutes: void 0,
|
|
474
475
|
apiBaseUrl,
|
|
476
|
+
isSSG,
|
|
475
477
|
customRegexMatcher: options.customRegexMatcher
|
|
476
478
|
};
|
|
477
479
|
if (typeof options.customRegexMatcher !== "undefined") {
|
|
@@ -3,7 +3,11 @@ import { useRoute, useRouter } from "#imports";
|
|
|
3
3
|
const parseAcceptLanguage = (acceptLanguage) => acceptLanguage.split(",").map((entry) => entry.split(";")[0].trim());
|
|
4
4
|
export default defineNuxtPlugin(async (nuxtApp) => {
|
|
5
5
|
const i18nConfig = nuxtApp.$config.public.i18nConfig;
|
|
6
|
-
const
|
|
6
|
+
const date = /* @__PURE__ */ new Date();
|
|
7
|
+
const userLocaleCookie = useCookie(i18nConfig.localeCookie || "user-locale", {
|
|
8
|
+
watch: false,
|
|
9
|
+
expires: new Date(date.setDate(date.getDate() + 365))
|
|
10
|
+
});
|
|
7
11
|
const hashCookie = useCookie("hash-locale");
|
|
8
12
|
const headers = useRequestHeaders(["accept-language"]);
|
|
9
13
|
const supportedLocales = i18nConfig.locales?.map((locale) => locale.code) ?? [];
|
|
@@ -30,7 +34,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
30
34
|
external: true
|
|
31
35
|
});
|
|
32
36
|
}
|
|
33
|
-
if (userLocaleCookie.value) {
|
|
37
|
+
if (userLocaleCookie.value || i18nConfig.isSSG) {
|
|
34
38
|
return;
|
|
35
39
|
}
|
|
36
40
|
if (autoDetectPath !== "*" && route.path !== autoDetectPath) {
|
|
@@ -50,7 +54,8 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
50
54
|
if (i18nConfig.hashMode) {
|
|
51
55
|
hashCookie.value = detectedLocale;
|
|
52
56
|
}
|
|
53
|
-
|
|
57
|
+
const currentLocale = route.params.locale ?? defaultLocale;
|
|
58
|
+
if (detectedLocale !== currentLocale) {
|
|
54
59
|
await switchLocale(detectedLocale);
|
|
55
60
|
}
|
|
56
61
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.31.
|
|
3
|
+
"version": "1.31.8",
|
|
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":"808a05a6-3a75-4640-8368-4ee1714a50e7","timestamp":1730749951679,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|