nuxt-i18n-micro 1.31.7 → 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/{znUex4pj.js → BJqhKqO8.js} +1 -1
- package/dist/client/_nuxt/{Djf-Negz.js → Cdhtwg8F.js} +1 -1
- package/dist/client/_nuxt/{DzG2mkrK.js → CtL0IzHt.js} +1 -1
- package/dist/client/_nuxt/DT6fB3yc.js +98 -0
- 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.json +1 -1
- package/dist/runtime/plugins/04.auto-detect.js +7 -2
- package/package.json +1 -1
- package/dist/client/_nuxt/B5AnYl2h.js +0 -98
- package/dist/client/_nuxt/builds/meta/56cae9f6-18a0-4405-a516-f2216f92cdbb.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.json
CHANGED
|
@@ -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) ?? [];
|
|
@@ -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",
|