nuxt-i18n-micro 1.6.0 → 1.6.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 +6 -6
- package/dist/client/404.html +6 -6
- package/dist/client/_nuxt/{DUtCg1fH.js → BOJGXfH_.js} +8 -8
- package/dist/client/_nuxt/{a39Im4hm.js → CG2qJMgW.js} +1 -1
- package/dist/client/_nuxt/{B5V5CGNX.js → DU08RbPQ.js} +1 -1
- package/dist/client/_nuxt/{C5CUDaeR.js → DyPhI3v_.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/3583a2c9-2645-4710-9180-da6d201fe3ee.json +1 -0
- package/dist/client/index.html +6 -6
- package/dist/module.json +1 -1
- package/dist/runtime/plugins/01.plugin.js +10 -6
- package/dist/runtime/translationHelper.js +4 -8
- package/package.json +7 -7
- package/dist/client/_nuxt/builds/meta/4583b4b6-b29c-448a-91a8-18c469a313df.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o}from"./
|
|
1
|
+
import{u as o}from"./DU08RbPQ.js";import{_ as a,o as s,c as i,a as e,t as r,p as u,f as c}from"./BOJGXfH_.js";const l=t=>(u("data-v-2c66185b"),t=t(),c(),t),d={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},p=l(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),h={class:"max-w-520px text-center"},b=["textContent"],g=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const n=t;return o({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[],style:[{children:'*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(m,x)=>(s(),i("div",d,[p,e("div",h,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:r(t.statusCode)},null,8,b),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:r(t.description)},null,8,g)])]))}},w=a(f,[["__scopeId","data-v-2c66185b"]]);export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as o,r as u,g as f,h as d,j as v,k as l,l as i,m as h,n as m}from"./
|
|
1
|
+
import{i as o,r as u,g as f,h as d,j as v,k as l,l as i,m as h,n as m}from"./BOJGXfH_.js";function U(t,a={}){const e=a.head||o();if(e)return e.ssr?e.push(t,a):p(e,t,a)}function p(t,a,e={}){const s=u(!1),n=u({});f(()=>{n.value=s.value?{}:d(a)});const r=t.push(n.value,e);return v(n,c=>{r.patch(c)}),m()&&(l(()=>{r.dispose()}),i(()=>{s.value=!0}),h(()=>{s.value=!1})),r}export{U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as a,o as s,c as i,a as e,t as o,b as u,w as c,d,e as l,p,f}from"./
|
|
1
|
+
import{_ as a,o as s,c as i,a as e,t as o,b as u,w as c,d,e as l,p,f}from"./BOJGXfH_.js";import{u as h}from"./DU08RbPQ.js";const g=t=>(p("data-v-c6c1efc1"),t=t(),f(),t),b={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},x=g(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),m={class:"max-w-520px text-center z-20"},y=["textContent"],_=["textContent"],k={class:"w-full flex items-center justify-center"},w={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const n=t;return h({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[],style:[{children:'*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}h1{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,p{margin:0}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(z,S)=>{const r=l;return s(),i("div",b,[x,e("div",m,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:o(t.statusCode)},null,8,y),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:o(t.description)},null,8,_),e("div",k,[u(r,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:c(()=>[d(o(t.backHome),1)]),_:1})])])])}}},N=a(w,[["__scopeId","data-v-c6c1efc1"]]);export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"3583a2c9-2645-4710-9180-da6d201fe3ee","timestamp":1724321138809}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"3583a2c9-2645-4710-9180-da6d201fe3ee","timestamp":1724321138809,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
3
|
<link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CF1WZhsD.css">
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BOJGXfH_.js">
|
|
5
5
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/B6E6ObS_.js">
|
|
6
6
|
<link rel="prefetch" as="style" href="/__nuxt-i18n-micro/_nuxt/error-404.CjTTbIxB.css">
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
8
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/DyPhI3v_.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/DU08RbPQ.js">
|
|
9
9
|
<link rel="prefetch" as="style" href="/__nuxt-i18n-micro/_nuxt/error-500.B4KzowuE.css">
|
|
10
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
11
|
-
<script type="module" src="/__nuxt-i18n-micro/_nuxt/
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CG2qJMgW.js">
|
|
11
|
+
<script type="module" src="/__nuxt-i18n-micro/_nuxt/BOJGXfH_.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>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"3583a2c9-2645-4710-9180-da6d201fe3ee",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
|
@@ -80,24 +80,28 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
80
80
|
routeName = i18nConfig.routesLocaleLinks[routeName];
|
|
81
81
|
}
|
|
82
82
|
if (!i18nHelper.hasPageTranslation(locale, initialRouteName2)) {
|
|
83
|
-
const
|
|
84
|
-
await i18nHelper.loadPageTranslations(locale, initialRouteName2,
|
|
83
|
+
const data = await $fetch(`/_locales/${routeName}/${locale}/data.json?v=${i18nConfig.dateBuild}`, { baseURL: i18nConfig.baseURL });
|
|
84
|
+
await i18nHelper.loadPageTranslations(locale, initialRouteName2, data ?? {});
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
next();
|
|
88
88
|
});
|
|
89
89
|
const initialLocale = (route.params?.locale ?? i18nConfig.defaultLocale).toString();
|
|
90
90
|
const initialRouteName = route.name.replace(`localized-`, "");
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
if (!i18nHelper.hasGeneralTranslation(initialLocale)) {
|
|
92
|
+
const data = await $fetch(`/_locales/general/${initialLocale}/data.json?v=${i18nConfig.dateBuild}`, { baseURL: i18nConfig.baseURL });
|
|
93
|
+
await i18nHelper.loadTranslations(initialLocale, data ?? {});
|
|
94
|
+
}
|
|
93
95
|
if (import.meta.server) {
|
|
94
96
|
const locale = (route.params?.locale ?? i18nConfig.defaultLocale).toString();
|
|
95
97
|
let routeName = initialRouteName;
|
|
96
98
|
if (i18nConfig.routesLocaleLinks && i18nConfig.routesLocaleLinks[routeName]) {
|
|
97
99
|
routeName = i18nConfig.routesLocaleLinks[routeName];
|
|
98
100
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
if (!i18nHelper.hasPageTranslation(initialLocale, routeName)) {
|
|
102
|
+
const pageData = await $fetch(`/_locales/${routeName}/${locale}/data.json?v=${i18nConfig.dateBuild}`, { baseURL: i18nConfig.baseURL });
|
|
103
|
+
await i18nHelper.loadPageTranslations(initialLocale, initialRouteName, pageData ?? {});
|
|
104
|
+
}
|
|
101
105
|
}
|
|
102
106
|
return {
|
|
103
107
|
provide: {
|
|
@@ -102,20 +102,16 @@ export function useTranslationHelper() {
|
|
|
102
102
|
},
|
|
103
103
|
loadPageTranslations: async (locale, routeName, translations) => {
|
|
104
104
|
try {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
serverTranslationInit[`${locale}:${routeName}`] = true;
|
|
108
|
-
}
|
|
105
|
+
routeLocaleCache[`${locale}:${routeName}`] = { ...translations };
|
|
106
|
+
serverTranslationInit[`${locale}:${routeName}`] = true;
|
|
109
107
|
} catch (error) {
|
|
110
108
|
console.error(`Error loading translations for ${locale} and ${routeName}:`, error);
|
|
111
109
|
}
|
|
112
110
|
},
|
|
113
111
|
loadTranslations: async (locale, translations) => {
|
|
114
112
|
try {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
serverTranslationInit[`${locale}:index`] = true;
|
|
118
|
-
}
|
|
113
|
+
generalLocaleCache[locale] = { ...translations };
|
|
114
|
+
serverTranslationInit[`${locale}:index`] = true;
|
|
119
115
|
} catch (error) {
|
|
120
116
|
console.error(`Error loading translations for general ${locale}:`, error);
|
|
121
117
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.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",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"sirv": "^2.0.4"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@nuxt/devtools": "^1.3.
|
|
70
|
-
"@nuxt/devtools-kit": "^1.3.
|
|
71
|
-
"@nuxt/devtools-ui-kit": "^1.3.
|
|
72
|
-
"@nuxt/eslint-config": "^0.5.
|
|
69
|
+
"@nuxt/devtools": "^1.3.14",
|
|
70
|
+
"@nuxt/devtools-kit": "^1.3.14",
|
|
71
|
+
"@nuxt/devtools-ui-kit": "^1.3.14",
|
|
72
|
+
"@nuxt/eslint-config": "^0.5.1",
|
|
73
73
|
"@nuxt/module-builder": "^0.8.3",
|
|
74
74
|
"@nuxt/schema": "^3.12.4",
|
|
75
75
|
"@nuxt/test-utils": "^3.14.1",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"@types/node": "^20.14.11",
|
|
78
78
|
"changelogen": "^0.5.5",
|
|
79
79
|
"eslint": "^8.56.0",
|
|
80
|
-
"execa": "^9.3.
|
|
80
|
+
"execa": "^9.3.1",
|
|
81
81
|
"nuxt": "^3.12.4",
|
|
82
82
|
"typescript": "latest",
|
|
83
83
|
"vitepress": "^1.3.3",
|
|
84
|
-
"vitest": "^2.0.
|
|
84
|
+
"vitest": "^2.0.5",
|
|
85
85
|
"vue-tsc": "2.0.22"
|
|
86
86
|
},
|
|
87
87
|
"workspaces": [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"4583b4b6-b29c-448a-91a8-18c469a313df","timestamp":1724248922955,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|