nuxt-i18n-micro 1.29.3 → 1.29.5
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/dd852be5-e5b6-4c76-85b7-ce1af545045f.json +1 -0
- package/dist/client/index.html +2 -2
- package/dist/module.d.mts +1 -0
- package/dist/module.d.ts +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +7 -4
- package/dist/runtime/plugins/01.plugin.js +8 -3
- package/package.json +1 -1
- package/dist/client/_nuxt/builds/meta/efe8653b-e25e-4eb9-99b4-1b76c53051da.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/0GmYR_kR.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.CBAEdpZV.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/2C6ahHCU.js">
|
|
11
|
-
<script type="module" src="/__nuxt-i18n-micro/_nuxt/Czi4MokJ.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-i18n-micro",buildId:"
|
|
11
|
+
<script type="module" src="/__nuxt-i18n-micro/_nuxt/Czi4MokJ.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},1729589548775,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"dd852be5-e5b6-4c76-85b7-ce1af545045f",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-i18n-micro/_nuxt/0GmYR_kR.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.CBAEdpZV.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/2C6ahHCU.js">
|
|
11
|
-
<script type="module" src="/__nuxt-i18n-micro/_nuxt/Czi4MokJ.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-i18n-micro",buildId:"
|
|
11
|
+
<script type="module" src="/__nuxt-i18n-micro/_nuxt/Czi4MokJ.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},1729589548776,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"dd852be5-e5b6-4c76-85b7-ce1af545045f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"dd852be5-e5b6-4c76-85b7-ce1af545045f","timestamp":1729589538009}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"dd852be5-e5b6-4c76-85b7-ce1af545045f","timestamp":1729589538009,"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-i18n-micro/_nuxt/0GmYR_kR.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.CBAEdpZV.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/2C6ahHCU.js">
|
|
11
|
-
<script type="module" src="/__nuxt-i18n-micro/_nuxt/Czi4MokJ.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-i18n-micro",buildId:"
|
|
11
|
+
<script type="module" src="/__nuxt-i18n-micro/_nuxt/Czi4MokJ.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},1729589548776,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"dd852be5-e5b6-4c76-85b7-ce1af545045f",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
|
@@ -394,6 +394,7 @@ const module = defineNuxtModule({
|
|
|
394
394
|
meta: true,
|
|
395
395
|
debug: false,
|
|
396
396
|
define: true,
|
|
397
|
+
types: true,
|
|
397
398
|
defaultLocale: "en",
|
|
398
399
|
translationDir: "locales",
|
|
399
400
|
autoDetectPath: "*",
|
|
@@ -498,10 +499,12 @@ const module = defineNuxtModule({
|
|
|
498
499
|
pathPrefix: false,
|
|
499
500
|
extensions: ["vue"]
|
|
500
501
|
});
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
502
|
+
if (options.types) {
|
|
503
|
+
addTypeTemplate({
|
|
504
|
+
filename: "types/i18n-plugin.d.ts",
|
|
505
|
+
getContents: () => generateI18nTypes()
|
|
506
|
+
});
|
|
507
|
+
}
|
|
505
508
|
extendPages((pages) => {
|
|
506
509
|
const pagesNames = pages.map((page) => page.name).filter((name) => name !== void 0 && (!options.routesLocaleLinks || !options.routesLocaleLinks[name]));
|
|
507
510
|
if (!options.disableWatcher) {
|
|
@@ -131,14 +131,19 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
131
131
|
const plural = new Function("return " + i18nConfig.plural.toString())();
|
|
132
132
|
const apiBaseUrl = i18nConfig.apiBaseUrl ?? "_locales";
|
|
133
133
|
const runtimeConfig = useRuntimeConfig();
|
|
134
|
-
const loadTranslationsIfNeeded = async (locale, routeName) => {
|
|
134
|
+
const loadTranslationsIfNeeded = async (locale, routeName, path) => {
|
|
135
135
|
try {
|
|
136
136
|
if (!i18nHelper.hasPageTranslation(locale, routeName)) {
|
|
137
137
|
let fRouteName = routeName;
|
|
138
138
|
if (i18nConfig.routesLocaleLinks && i18nConfig.routesLocaleLinks[fRouteName]) {
|
|
139
139
|
fRouteName = i18nConfig.routesLocaleLinks[fRouteName];
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
if (!fRouteName || fRouteName === "") {
|
|
142
|
+
console.warn(`[nuxt-i18n-next] The page name is missing in the path: ${path}. Please ensure that definePageMeta({ name: 'pageName' }) is set.`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const route = `/${apiBaseUrl}/${fRouteName}/${locale}/data.json?v=${i18nConfig.dateBuild}`.replace(/\/{2,}/g, "/");
|
|
146
|
+
const data = await $fetch(route, { baseURL: runtimeConfig.app.baseURL });
|
|
142
147
|
await i18nHelper.loadPageTranslations(locale, routeName, data ?? {});
|
|
143
148
|
}
|
|
144
149
|
} catch (_error) {
|
|
@@ -153,7 +158,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
153
158
|
}
|
|
154
159
|
if (!i18nConfig.disablePageLocales) {
|
|
155
160
|
const routeName = getRouteName(to, locale);
|
|
156
|
-
await loadTranslationsIfNeeded(locale, routeName);
|
|
161
|
+
await loadTranslationsIfNeeded(locale, routeName, to.fullPath);
|
|
157
162
|
}
|
|
158
163
|
await nuxtApp.callHook("i18n:register", (translations, selectedLocale) => {
|
|
159
164
|
const routeName = getRouteName(to, locale);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.5",
|
|
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":"efe8653b-e25e-4eb9-99b4-1b76c53051da","timestamp":1729514500710,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|