nuxt-i18n-micro 1.79.0 → 1.81.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/README.md +1 -2
- 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/cb71af6c-35bf-4233-98f2-bda40f06f17a.json +1 -0
- package/dist/client/index.html +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -0
- package/dist/runtime/plugins/01.plugin.d.ts +2 -0
- package/dist/runtime/plugins/01.plugin.js +3 -0
- package/dist/runtime/server/routes/get.js +2 -0
- package/package.json +3 -3
- package/dist/client/_nuxt/builds/meta/cbf8b600-0d7e-4c79-8aba-29c2154860e8.json +0 -1
package/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/nuxt-i18n-micro)
|
|
2
2
|
[](https://www.npmjs.com/package/nuxt-i18n-micro)
|
|
3
3
|
[](https://www.npmjs.com/package/nuxt-i18n-micro)
|
|
4
|
-
[](https://www.donationalerts.com/r/s00d88)
|
|
4
|
+
[](https://www.donationalerts.com/r/s00d88)
|
|
6
5
|
|
|
7
6
|
<p align="center">
|
|
8
7
|
<img src="https://github.com/s00d/nuxt-i18n-micro/blob/main/logo.png?raw=true" alt="logo">
|
package/dist/client/200.html
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BBbCCCx2.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BRj5A2lo.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CfVvufsh.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/MjlAM4Ld.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/MjlAM4Ld.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},1742713447902,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"cb71af6c-35bf-4233-98f2-bda40f06f17a",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/BBbCCCx2.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BRj5A2lo.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CfVvufsh.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/MjlAM4Ld.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/MjlAM4Ld.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},1742713447902,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"cb71af6c-35bf-4233-98f2-bda40f06f17a",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"cb71af6c-35bf-4233-98f2-bda40f06f17a","timestamp":1742713441576}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"cb71af6c-35bf-4233-98f2-bda40f06f17a","timestamp":1742713441576,"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/BBbCCCx2.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BRj5A2lo.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CfVvufsh.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/MjlAM4Ld.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/MjlAM4Ld.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},1742713447902,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"cb71af6c-35bf-4233-98f2-bda40f06f17a",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -491,6 +491,8 @@ const module = defineNuxtModule({
|
|
|
491
491
|
rootDir: nuxt.options.rootDir,
|
|
492
492
|
rootDirs,
|
|
493
493
|
debug: options.debug ?? false,
|
|
494
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
495
|
+
// @ts-ignore
|
|
494
496
|
fallbackLocale: options.fallbackLocale ?? void 0,
|
|
495
497
|
translationDir: options.translationDir ?? "locales",
|
|
496
498
|
customRegexMatcher: options.customRegexMatcher
|
|
@@ -20,6 +20,7 @@ declare const _default: import("nuxt/app").Plugin<{
|
|
|
20
20
|
mergeTranslations: (newTranslations: Translations) => void;
|
|
21
21
|
mergeGlobalTranslations: (newTranslations: Translations) => void;
|
|
22
22
|
switchLocaleRoute: (toLocale: string) => string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
23
|
+
clearCache: () => void;
|
|
23
24
|
switchLocalePath: (toLocale: string) => string;
|
|
24
25
|
switchLocale: (toLocale: string) => string | false | void | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric | Promise<false | void | import("vue-router").NavigationFailure>;
|
|
25
26
|
switchRoute: (route: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string, toLocale?: string) => string | false | void | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric | Promise<false | void | import("vue-router").NavigationFailure>;
|
|
@@ -46,6 +47,7 @@ declare const _default: import("nuxt/app").Plugin<{
|
|
|
46
47
|
mergeTranslations: (newTranslations: Translations) => void;
|
|
47
48
|
mergeGlobalTranslations: (newTranslations: Translations) => void;
|
|
48
49
|
switchLocaleRoute: (toLocale: string) => string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
50
|
+
clearCache: () => void;
|
|
49
51
|
switchLocalePath: (toLocale: string) => string;
|
|
50
52
|
switchLocale: (toLocale: string) => string | false | void | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric | Promise<false | void | import("vue-router").NavigationFailure>;
|
|
51
53
|
switchRoute: (route: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string, toLocale?: string) => string | false | void | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric | Promise<false | void | import("vue-router").NavigationFailure>;
|
|
@@ -169,6 +169,9 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
169
169
|
const fromLocale = routeService.getCurrentLocale(route);
|
|
170
170
|
return routeService.switchLocaleRoute(fromLocale, toLocale, route, unref(i18nRouteParams.value));
|
|
171
171
|
},
|
|
172
|
+
clearCache: () => {
|
|
173
|
+
i18nHelper.clearCache();
|
|
174
|
+
},
|
|
172
175
|
switchLocalePath: (toLocale) => {
|
|
173
176
|
const route = routeService.getCurrentRoute();
|
|
174
177
|
const fromLocale = routeService.getCurrentLocale(route);
|
|
@@ -24,6 +24,7 @@ export default defineEventHandler(async (event) => {
|
|
|
24
24
|
if (customRegexMatcher && locales && !locales.map((l) => l.code).includes(locale)) {
|
|
25
25
|
throw createError({ statusCode: 404 });
|
|
26
26
|
}
|
|
27
|
+
const currentLocaleConfig = locales?.find((l) => l.code === locale) ?? null;
|
|
27
28
|
const getTranslationPath = (locale2, page2) => page2 === "general" ? `${locale2}.json` : `pages/${page2}/${locale2}.json`;
|
|
28
29
|
let translations = {};
|
|
29
30
|
const serverStorage = useStorage("assets:server");
|
|
@@ -44,6 +45,7 @@ export default defineEventHandler(async (event) => {
|
|
|
44
45
|
}));
|
|
45
46
|
const paths = [
|
|
46
47
|
...fallbackLocale && fallbackLocale !== locale ? createPaths(fallbackLocale) : [],
|
|
48
|
+
...currentLocaleConfig && currentLocaleConfig.fallbackLocale ? createPaths(currentLocaleConfig.fallbackLocale) : [],
|
|
47
49
|
...createPaths(locale)
|
|
48
50
|
];
|
|
49
51
|
for (const { translationPath, name } of paths) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.81.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",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"globby": "^14.1.0",
|
|
60
60
|
"sirv": "^2.0.4",
|
|
61
61
|
"ufo": "^1.5.4",
|
|
62
|
+
"nuxt-i18n-micro-core": "1.0.18",
|
|
62
63
|
"nuxt-i18n-micro-test-utils": "1.0.6",
|
|
63
|
-
"nuxt-i18n-micro-types": "1.0.
|
|
64
|
-
"nuxt-i18n-micro-core": "1.0.17"
|
|
64
|
+
"nuxt-i18n-micro-types": "1.0.3"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@nuxt/devtools": "^2.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"cbf8b600-0d7e-4c79-8aba-29c2154860e8","timestamp":1741817357743,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|