nuxt-i18n-micro 2.5.0 → 2.6.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/119cca13-ae84-4b8a-b244-c16eb4a6ed9f.json +1 -0
- package/dist/client/index.html +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -1
- package/dist/runtime/plugins/01.plugin.js +5 -5
- package/dist/runtime/translation-server-middleware.js +2 -1
- package/package.json +3 -3
- package/dist/client/_nuxt/builds/meta/dc8ec25f-2f2b-41cd-9ff1-ce2de81f36ea.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},1762414713405,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"119cca13-ae84-4b8a-b244-c16eb4a6ed9f",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},1762414713405,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"119cca13-ae84-4b8a-b244-c16eb4a6ed9f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"119cca13-ae84-4b8a-b244-c16eb4a6ed9f","timestamp":1762414707440}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"119cca13-ae84-4b8a-b244-c16eb4a6ed9f","timestamp":1762414707440,"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},1762414713405,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"119cca13-ae84-4b8a-b244-c16eb4a6ed9f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -946,7 +946,8 @@ const module = defineNuxtModule({
|
|
|
946
946
|
customRegexMatcher: options.customRegexMatcher,
|
|
947
947
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
948
948
|
// @ts-ignore
|
|
949
|
-
routesLocaleLinks: options.routesLocaleLinks ?? {}
|
|
949
|
+
routesLocaleLinks: options.routesLocaleLinks ?? {},
|
|
950
|
+
apiBaseUrl
|
|
950
951
|
};
|
|
951
952
|
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
952
953
|
if (process.env && process.env.TEST) {
|
|
@@ -58,7 +58,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
58
58
|
if (isNoPrefixStrategy(i18nConfig.strategy)) {
|
|
59
59
|
locale = await nuxtApp.runWithContext(() => useCookie("no-prefix-locale", { default: () => locale }).value);
|
|
60
60
|
}
|
|
61
|
-
const routeName = routeService.
|
|
61
|
+
const routeName = routeService.getPluginRouteName(to, locale);
|
|
62
62
|
if (!routeName) {
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
@@ -92,7 +92,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
92
92
|
}
|
|
93
93
|
if (import.meta.client && enablePreviousPageFallback) {
|
|
94
94
|
const fromLocale = routeService.getCurrentLocale(from);
|
|
95
|
-
const fromRouteName = routeService.
|
|
95
|
+
const fromRouteName = routeService.getPluginRouteName(from, fromLocale);
|
|
96
96
|
previousPageInfo.value = { locale: fromLocale, routeName: fromRouteName };
|
|
97
97
|
}
|
|
98
98
|
try {
|
|
@@ -119,7 +119,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
119
119
|
if (!key) return "";
|
|
120
120
|
route = route ?? routeService.getCurrentRoute();
|
|
121
121
|
const locale = routeService.getCurrentLocale();
|
|
122
|
-
const routeName = routeService.
|
|
122
|
+
const routeName = routeService.getPluginRouteName(route, locale);
|
|
123
123
|
let value = i18nHelper.getTranslation(locale, routeName, key);
|
|
124
124
|
if (!value && previousPageInfo.value && enablePreviousPageFallback) {
|
|
125
125
|
const prev = previousPageInfo.value;
|
|
@@ -172,13 +172,13 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
172
172
|
has: (key, route) => {
|
|
173
173
|
route = route ?? routeService.getCurrentRoute();
|
|
174
174
|
const locale = routeService.getCurrentLocale();
|
|
175
|
-
const routeName = routeService.
|
|
175
|
+
const routeName = routeService.getPluginRouteName(route, locale);
|
|
176
176
|
return !!i18nHelper.getTranslation(locale, routeName, key);
|
|
177
177
|
},
|
|
178
178
|
mergeTranslations: (newTranslations) => {
|
|
179
179
|
const route = routeService.getCurrentRoute();
|
|
180
180
|
const locale = routeService.getCurrentLocale(route);
|
|
181
|
-
const routeName = routeService.
|
|
181
|
+
const routeName = routeService.getPluginRouteName(route, locale);
|
|
182
182
|
i18nHelper.mergeTranslation(locale, routeName, newTranslations);
|
|
183
183
|
},
|
|
184
184
|
mergeGlobalTranslations: (newTranslations) => {
|
|
@@ -5,7 +5,8 @@ const I18N_CONTEXT_KEY = "__i18n_cache__";
|
|
|
5
5
|
async function fetchTranslations(locale) {
|
|
6
6
|
try {
|
|
7
7
|
const config = useRuntimeConfig();
|
|
8
|
-
const
|
|
8
|
+
const i18nConfig = config.i18nConfig;
|
|
9
|
+
const apiBaseUrl = i18nConfig?.apiBaseUrl ?? "/_locales";
|
|
9
10
|
const translations = await $fetch(`${apiBaseUrl}/general/${locale}/data.json`);
|
|
10
11
|
return translations;
|
|
11
12
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.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,9 +61,9 @@
|
|
|
61
61
|
"globby": "^14.1.0",
|
|
62
62
|
"sirv": "^2.0.4",
|
|
63
63
|
"ufo": "^1.5.4",
|
|
64
|
-
"nuxt-i18n-micro-types": "1.0.12",
|
|
65
64
|
"nuxt-i18n-micro-test-utils": "1.0.7",
|
|
66
|
-
"nuxt-i18n-micro-
|
|
65
|
+
"nuxt-i18n-micro-types": "1.0.13",
|
|
66
|
+
"nuxt-i18n-micro-core": "1.0.24"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@nuxt/devtools": "^2.6.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"dc8ec25f-2f2b-41cd-9ff1-ce2de81f36ea","timestamp":1762356596622,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|