nuxt-i18n-micro 1.1.0 → 1.1.1
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/c53d284f-1ca1-4e93-bf70-990155baabf5.json +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/01.plugin.js +9 -11
- package/package.json +1 -1
- package/dist/client/_nuxt/builds/meta/edb9253f-37c1-4eb5-8989-26e4e090a752.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
<link rel="prefetch" as="style" href="/__nuxt-i18n-micro/_nuxt/error-500.B4KzowuE.css">
|
|
9
9
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/HZLiFEh-.js">
|
|
10
10
|
<script type="module" src="/__nuxt-i18n-micro/_nuxt/6EJ4fAZ2.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"serverRendered":1},false]</script>
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"c53d284f-1ca1-4e93-bf70-990155baabf5",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
<link rel="prefetch" as="style" href="/__nuxt-i18n-micro/_nuxt/error-500.B4KzowuE.css">
|
|
9
9
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/HZLiFEh-.js">
|
|
10
10
|
<script type="module" src="/__nuxt-i18n-micro/_nuxt/6EJ4fAZ2.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"serverRendered":1},false]</script>
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"c53d284f-1ca1-4e93-bf70-990155baabf5",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"c53d284f-1ca1-4e93-bf70-990155baabf5","timestamp":1723869304838}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"c53d284f-1ca1-4e93-bf70-990155baabf5","timestamp":1723869304838,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
<link rel="prefetch" as="style" href="/__nuxt-i18n-micro/_nuxt/error-500.B4KzowuE.css">
|
|
9
9
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/HZLiFEh-.js">
|
|
10
10
|
<script type="module" src="/__nuxt-i18n-micro/_nuxt/6EJ4fAZ2.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"serverRendered":1},false]</script>
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"c53d284f-1ca1-4e93-bf70-990155baabf5",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRuntimeConfig } from "#app";
|
|
2
|
-
import { useRoute, useRouter
|
|
2
|
+
import { useRoute, useRouter } from "#imports";
|
|
3
3
|
const generalLocaleCache = {};
|
|
4
4
|
const routeLocaleCache = {};
|
|
5
5
|
const dynamicTranslationsCaches = [];
|
|
@@ -92,17 +92,15 @@ export default defineNuxtPlugin(async (_nuxtApp) => {
|
|
|
92
92
|
const initialLocale = (route.params?.locale ?? i18nConfig.defaultLocale).toString();
|
|
93
93
|
const initialRouteName = route.name.replace(`localized-`, "");
|
|
94
94
|
const plural = new Function("return " + i18nConfig.plural)();
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (!
|
|
99
|
-
|
|
100
|
-
return;
|
|
95
|
+
router.beforeEach(async (to, from, next) => {
|
|
96
|
+
const locale = (to.params?.locale ?? i18nConfig.defaultLocale).toString();
|
|
97
|
+
const routeName = to.name.replace(`localized-`, "");
|
|
98
|
+
if (!routeLocaleCache[`${locale}:${routeName}`]) {
|
|
99
|
+
await loadTranslations(locale, routeName, i18nConfig.translationDir);
|
|
101
100
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}, { immediate: true });
|
|
101
|
+
next();
|
|
102
|
+
});
|
|
103
|
+
await loadTranslations(initialLocale, initialRouteName, i18nConfig.translationDir);
|
|
106
104
|
return {
|
|
107
105
|
provide: {
|
|
108
106
|
getLocale: () => (route.params?.locale ?? i18nConfig.defaultLocale).toString(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
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":"edb9253f-37c1-4eb5-8989-26e4e090a752","timestamp":1723868299886,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|