nuxt-i18n-micro 2.8.0 → 2.10.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/4d50402d-b49e-486b-8691-1920eff342d2.json +1 -0
- package/dist/client/index.html +2 -2
- package/dist/module.json +1 -1
- package/dist/runtime/composables/useLocaleHead.js +5 -1
- package/dist/runtime/plugins/01.plugin.js +9 -1
- package/package.json +2 -2
- package/dist/client/_nuxt/builds/meta/9a1fb0d2-6a76-47f9-959f-57ea625d621e.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/CBxwnKtU.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BqKd8Zt-.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BYEpoBUk.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/XZXfxmri.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/XZXfxmri.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},1763631493448,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"4d50402d-b49e-486b-8691-1920eff342d2",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/CBxwnKtU.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BqKd8Zt-.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BYEpoBUk.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/XZXfxmri.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/XZXfxmri.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},1763631493448,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"4d50402d-b49e-486b-8691-1920eff342d2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"4d50402d-b49e-486b-8691-1920eff342d2","timestamp":1763631487169}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"4d50402d-b49e-486b-8691-1920eff342d2","timestamp":1763631487169,"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/CBxwnKtU.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BqKd8Zt-.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BYEpoBUk.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/XZXfxmri.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/XZXfxmri.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},1763631493448,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"4d50402d-b49e-486b-8691-1920eff342d2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
|
@@ -21,10 +21,14 @@ export const useLocaleHead = ({ addDirAttribute = true, identifierAttribute = "i
|
|
|
21
21
|
return withQuery(pathname, filtered);
|
|
22
22
|
}
|
|
23
23
|
function updateMeta() {
|
|
24
|
+
const route = useRoute();
|
|
25
|
+
if (route.matched.length === 0 || route.matched.some((record) => record.name === "custom-fallback-route")) {
|
|
26
|
+
metaObject.value = { htmlAttrs: {}, link: [], meta: [] };
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
24
29
|
const { strategy, canonicalQueryWhitelist, routeLocales } = useRuntimeConfig().public.i18nConfig;
|
|
25
30
|
const { $getLocales, $getLocale, $switchLocalePath } = useNuxtApp();
|
|
26
31
|
if (!$getLocale || !$getLocales) return;
|
|
27
|
-
const route = useRoute();
|
|
28
32
|
const locale = unref($getLocale());
|
|
29
33
|
const allLocales = unref($getLocales());
|
|
30
34
|
const routeName = (route.name ?? "").toString();
|
|
@@ -24,12 +24,18 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
24
24
|
const i18nHelper = useTranslationHelper(translationCaches);
|
|
25
25
|
let hashLocaleDefault = null;
|
|
26
26
|
let noPrefixDefault = null;
|
|
27
|
+
let cookieLocaleDefault = null;
|
|
27
28
|
if (i18nConfig.hashMode) {
|
|
28
29
|
hashLocaleDefault = await nuxtApp.runWithContext(() => useCookie("hash-locale").value);
|
|
29
30
|
}
|
|
30
31
|
if (isNoPrefixStrategy(i18nConfig.strategy)) {
|
|
31
32
|
noPrefixDefault = await nuxtApp.runWithContext(() => useCookie("no-prefix-locale").value);
|
|
32
33
|
}
|
|
34
|
+
let cookieLocaleName = null;
|
|
35
|
+
if (!i18nConfig.hashMode && !isNoPrefixStrategy(i18nConfig.strategy)) {
|
|
36
|
+
cookieLocaleName = i18nConfig.localeCookie || "user-locale";
|
|
37
|
+
cookieLocaleDefault = await nuxtApp.runWithContext(() => useCookie(cookieLocaleName).value);
|
|
38
|
+
}
|
|
33
39
|
const routeService = new RouteService(
|
|
34
40
|
i18nConfig,
|
|
35
41
|
router,
|
|
@@ -40,7 +46,9 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
40
46
|
nuxtApp.runWithContext(() => {
|
|
41
47
|
return useCookie(name).value = value;
|
|
42
48
|
});
|
|
43
|
-
}
|
|
49
|
+
},
|
|
50
|
+
cookieLocaleDefault,
|
|
51
|
+
cookieLocaleName
|
|
44
52
|
);
|
|
45
53
|
const translationService = new FormatService();
|
|
46
54
|
const i18nRouteParams = useState("i18n-route-params", () => ({}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"globby": "^14.1.0",
|
|
62
62
|
"sirv": "^2.0.4",
|
|
63
63
|
"ufo": "^1.5.4",
|
|
64
|
-
"nuxt-i18n-micro-core": "1.0.
|
|
64
|
+
"nuxt-i18n-micro-core": "1.0.25",
|
|
65
65
|
"nuxt-i18n-micro-types": "1.0.14",
|
|
66
66
|
"nuxt-i18n-micro-test-utils": "1.0.7"
|
|
67
67
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"9a1fb0d2-6a76-47f9-959f-57ea625d621e","timestamp":1763453685364,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|