nuxt-i18n-micro 1.32.1 → 1.32.3

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.
@@ -1 +1 @@
1
- import{i as f,r as u,f as o,g as d,h as v,j as l,k as i,l as h,m}from"./CTiMIQCz.js";function U(t,a={}){const e=a.head||f();if(e)return e.ssr?e.push(t,a):p(e,t,a)}function p(t,a,e={}){const s=u(!1),n=u({});o(()=>{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
+ import{i as f,r as u,f as o,g as d,h as v,j as l,k as i,l as h,m}from"./BqvPetMk.js";function U(t,a={}){const e=a.head||f();if(e)return e.ssr?e.push(t,a):p(e,t,a)}function p(t,a,e={}){const s=u(!1),n=u({});o(()=>{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 i,c as u,a as e,t as r,b as c,w as l,d,e as p}from"./CTiMIQCz.js";import{u as f}from"./C4eGGOXV.js";const m={class:"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"},g={class:"max-w-520px text-center z-20"},h=["textContent"],b=["textContent"],x={class:"flex items-center justify-center w-full"},y={__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 f({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[{children:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{children:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;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;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,p{margin:0}*,:after,:before{--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 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(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: }'}]}),(k,o)=>{const s=p;return i(),u("div",m,[o[0]||(o[0]=e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),e("div",g,[e("h1",{class:"font-medium mb-8 sm:text-10xl text-8xl",textContent:r(t.statusCode)},null,8,h),e("p",{class:"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl",textContent:r(t.description)},null,8,b),e("div",x,[c(s,{to:"/",class:"cursor-pointer gradient-border px-4 py-2 sm:px-6 sm:py-3 sm:text-xl text-md"},{default:l(()=>[d(r(t.backHome),1)]),_:1})])])])}}},v=a(y,[["__scopeId","data-v-28c488d2"]]);export{v as default};
1
+ import{_ as a,o as i,c as u,a as e,t as r,b as c,w as l,d,e as p}from"./BqvPetMk.js";import{u as f}from"./DKpok9-G.js";const m={class:"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"},g={class:"max-w-520px text-center z-20"},h=["textContent"],b=["textContent"],x={class:"flex items-center justify-center w-full"},y={__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 f({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[{children:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{children:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;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;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,p{margin:0}*,:after,:before{--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 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(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: }'}]}),(k,o)=>{const s=p;return i(),u("div",m,[o[0]||(o[0]=e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),e("div",g,[e("h1",{class:"font-medium mb-8 sm:text-10xl text-8xl",textContent:r(t.statusCode)},null,8,h),e("p",{class:"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl",textContent:r(t.description)},null,8,b),e("div",x,[c(s,{to:"/",class:"cursor-pointer gradient-border px-4 py-2 sm:px-6 sm:py-3 sm:text-xl text-md"},{default:l(()=>[d(r(t.backHome),1)]),_:1})])])])}}},v=a(y,[["__scopeId","data-v-28c488d2"]]);export{v as default};
@@ -1 +1 @@
1
- import{_ as s,o as a,c as i,a as e,t as o}from"./CTiMIQCz.js";import{u}from"./C4eGGOXV.js";const l={class:"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"},c={class:"max-w-520px text-center"},d=["textContent"],p=["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 r=t;return u({title:`${r.statusCode} - ${r.statusMessage} | ${r.appName}`,script:[{children:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{children:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;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;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:after,:before{--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 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(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: }'}]}),(g,n)=>(a(),i("div",l,[n[0]||(n[0]=e("div",{class:"-bottom-1/2 fixed h-1/2 left-0 right-0 spotlight"},null,-1)),e("div",c,[e("h1",{class:"font-medium mb-8 sm:text-10xl text-8xl",textContent:o(t.statusCode)},null,8,d),e("p",{class:"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl",textContent:o(t.description)},null,8,p)])]))}},b=s(f,[["__scopeId","data-v-d6cbdfc0"]]);export{b as default};
1
+ import{_ as s,o as a,c as i,a as e,t as o}from"./BqvPetMk.js";import{u}from"./DKpok9-G.js";const l={class:"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"},c={class:"max-w-520px text-center"},d=["textContent"],p=["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 r=t;return u({title:`${r.statusCode} - ${r.statusMessage} | ${r.appName}`,script:[{children:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{children:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;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;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:after,:before{--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 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(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: }'}]}),(g,n)=>(a(),i("div",l,[n[0]||(n[0]=e("div",{class:"-bottom-1/2 fixed h-1/2 left-0 right-0 spotlight"},null,-1)),e("div",c,[e("h1",{class:"font-medium mb-8 sm:text-10xl text-8xl",textContent:o(t.statusCode)},null,8,d),e("p",{class:"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl",textContent:o(t.description)},null,8,p)])]))}},b=s(f,[["__scopeId","data-v-d6cbdfc0"]]);export{b as default};
@@ -1 +1 @@
1
- {"id":"f1354573-fd79-4f4c-9c07-5367d8c22fba","timestamp":1731159691759}
1
+ {"id":"97407185-9c30-415a-a770-7c7fbf00a393","timestamp":1731570644540}
@@ -0,0 +1 @@
1
+ {"id":"97407185-9c30-415a-a770-7c7fbf00a393","timestamp":1731570644540,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -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.BqOlM4b6.css">
4
- <link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CTiMIQCz.js">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BqvPetMk.js">
5
5
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/B6E6ObS_.js">
6
6
  <link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.C_4C5G96.css">
7
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/DwKyf7FR.js">
8
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/C4eGGOXV.js">
7
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Dh7ThpBa.js">
8
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/DKpok9-G.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.CBAEdpZV.css">
10
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BARbCa2g.js">
11
- <script type="module" src="/__nuxt-i18n-micro/_nuxt/CTiMIQCz.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},1731159703713,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"f1354573-fd79-4f4c-9c07-5367d8c22fba",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
10
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/DyPN9pGe.js">
11
+ <script type="module" src="/__nuxt-i18n-micro/_nuxt/BqvPetMk.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},1731570657853,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"97407185-9c30-415a-a770-7c7fbf00a393",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
3
  "configKey": "i18n",
4
- "version": "1.32.1",
4
+ "version": "1.32.3",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -495,17 +495,20 @@ const module = defineNuxtModule({
495
495
  };
496
496
  addPlugin({
497
497
  src: resolver.resolve("./runtime/plugins/01.plugin"),
498
+ name: "i18n-plugin-loader",
498
499
  order: 0
499
500
  });
500
501
  if (options.meta) {
501
502
  addPlugin({
502
503
  src: resolver.resolve("./runtime/plugins/02.meta"),
504
+ name: "i18n-plugin-meta",
503
505
  order: 2
504
506
  });
505
507
  }
506
508
  if (options.define) {
507
509
  addPlugin({
508
510
  src: resolver.resolve("./runtime/plugins/03.define"),
511
+ name: "i18n-plugin-define",
509
512
  order: 3
510
513
  });
511
514
  }
@@ -513,6 +516,7 @@ const module = defineNuxtModule({
513
516
  addPlugin({
514
517
  src: resolver.resolve("./runtime/plugins/04.auto-detect"),
515
518
  mode: "server",
519
+ name: "i18n-plugin-auto-detect",
516
520
  order: 4
517
521
  });
518
522
  }
@@ -204,14 +204,14 @@ export default defineNuxtPlugin(async (nuxtApp) => {
204
204
  console.warn(`[nuxt-i18n-next] The page name is missing in the path: ${path}. Please ensure that definePageMeta({ name: 'pageName' }) is set.`);
205
205
  return;
206
206
  }
207
- const route = `/${apiBaseUrl}/${fRouteName}/${locale}/data.json?v=${i18nConfig.dateBuild}`.replace(/\/{2,}/g, "/");
208
- const data = await $fetch(route, { baseURL: runtimeConfig.app.baseURL });
207
+ const route2 = `/${apiBaseUrl}/${fRouteName}/${locale}/data.json?v=${i18nConfig.dateBuild}`.replace(/\/{2,}/g, "/");
208
+ const data = await $fetch(route2, { baseURL: runtimeConfig.app.baseURL });
209
209
  await i18nHelper.loadPageTranslations(locale, routeName, data ?? {});
210
210
  }
211
211
  } catch (_error) {
212
212
  }
213
213
  };
214
- useRouter().beforeEach(async (to, from, next) => {
214
+ async function loadTranslationsForRoute(to) {
215
215
  const hashLocale2 = i18nConfig.hashMode ? nuxtApp.runWithContext(() => (useCookie("hash-locale").value ?? i18nConfig.defaultLocale).toString()).toString() : null;
216
216
  const locale = getCurrentLocale(to, i18nConfig, hashLocale2);
217
217
  if (!i18nHelper.hasGeneralTranslation(locale)) {
@@ -226,15 +226,23 @@ export default defineNuxtPlugin(async (nuxtApp) => {
226
226
  const routeName = getRouteName(to, locale);
227
227
  i18nHelper.mergeTranslation(selectedLocale ?? locale, routeName, translations, true);
228
228
  }, locale);
229
+ }
230
+ useRouter().beforeEach(async (to, from, next) => {
231
+ if (to.path !== from.path) {
232
+ await loadTranslationsForRoute(to);
233
+ }
229
234
  if (next) {
230
235
  next();
231
236
  }
232
237
  });
238
+ const route = useRoute();
239
+ await loadTranslationsForRoute(route);
233
240
  const getTranslation = (key, params, defaultValue) => {
234
241
  if (!key) return "";
242
+ const route2 = useRoute();
235
243
  const hashLocale2 = i18nConfig.hashMode ? (useCookie("hash-locale").value ?? i18nConfig.defaultLocale).toString() : null;
236
- const locale = getCurrentLocale(useRoute(), i18nConfig, hashLocale2);
237
- const routeName = getRouteName(useRoute(), locale);
244
+ const locale = getCurrentLocale(route2, i18nConfig, hashLocale2);
245
+ const routeName = getRouteName(route2, locale);
238
246
  let value = i18nHelper.getTranslation(locale, routeName, key);
239
247
  if (!value) {
240
248
  if (isDev && import.meta.client) {
@@ -259,9 +267,9 @@ export default defineNuxtPlugin(async (nuxtApp) => {
259
267
  getLocaleName: () => getCurrentName(useRoute(), i18nConfig, hashLocale),
260
268
  defaultLocale: () => i18nConfig.defaultLocale,
261
269
  getLocales: () => i18nConfig.locales || [],
262
- getRouteName: (route, locale) => {
270
+ getRouteName: (route2, locale) => {
263
271
  const selectedLocale = locale ?? getCurrentLocale(useRoute(), i18nConfig, hashLocale);
264
- const selectedRoute = route ?? useRoute();
272
+ const selectedRoute = route2 ?? useRoute();
265
273
  return getRouteName(selectedRoute, selectedLocale);
266
274
  },
267
275
  t: getTranslation,
@@ -270,43 +278,46 @@ export default defineNuxtPlugin(async (nuxtApp) => {
270
278
  return value?.toString() ?? defaultValue ?? key;
271
279
  },
272
280
  tc: (key, count, defaultValue) => {
273
- const currentLocale = getCurrentLocale(useRoute(), i18nConfig, hashLocale);
281
+ const route2 = useRoute();
282
+ const currentLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
274
283
  return plural(key, count, currentLocale, getTranslation) ?? defaultValue ?? key;
275
284
  },
276
285
  tn: (value, options) => {
277
- const locale = getCurrentLocale(useRoute(), i18nConfig, hashLocale);
286
+ const route2 = useRoute();
287
+ const locale = getCurrentLocale(route2, i18nConfig, hashLocale);
278
288
  return formatNumber(value, locale, options);
279
289
  },
280
290
  td: (value, options) => {
281
- const locale = getCurrentLocale(useRoute(), i18nConfig, hashLocale);
291
+ const route2 = useRoute();
292
+ const locale = getCurrentLocale(route2, i18nConfig, hashLocale);
282
293
  return formatDate(value, locale, options);
283
294
  },
284
295
  has: (key) => {
285
296
  return !!getTranslation(key);
286
297
  },
287
298
  mergeTranslations: (newTranslations) => {
288
- const route = useRoute();
289
- const locale = getCurrentLocale(route, i18nConfig, hashLocale);
290
- const routeName = getRouteName(route, locale);
299
+ const route2 = useRoute();
300
+ const locale = getCurrentLocale(route2, i18nConfig, hashLocale);
301
+ const routeName = getRouteName(route2, locale);
291
302
  i18nHelper.mergeTranslation(locale, routeName, newTranslations);
292
303
  },
293
304
  switchLocaleRoute: (toLocale) => {
294
305
  const router = useRouter();
295
- const route = useRoute();
296
- const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
306
+ const route2 = useRoute();
307
+ const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
297
308
  if (i18nConfig.hashMode) {
298
309
  hashLocale = toLocale;
299
310
  }
300
- return switchLocaleRoute(fromLocale, toLocale, route, router, i18nConfig, i18nRouteParams.value);
311
+ return switchLocaleRoute(fromLocale, toLocale, route2, router, i18nConfig, i18nRouteParams.value);
301
312
  },
302
313
  switchLocalePath: (toLocale) => {
303
314
  const router = useRouter();
304
- const route = useRoute();
305
- const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
315
+ const route2 = useRoute();
316
+ const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
306
317
  if (i18nConfig.hashMode) {
307
318
  hashLocale = toLocale;
308
319
  }
309
- const localeRoute = switchLocaleRoute(fromLocale, toLocale, route, router, i18nConfig, i18nRouteParams.value);
320
+ const localeRoute = switchLocaleRoute(fromLocale, toLocale, route2, router, i18nConfig, i18nRouteParams.value);
310
321
  if (typeof localeRoute === "string") {
311
322
  return localeRoute;
312
323
  }
@@ -317,33 +328,33 @@ export default defineNuxtPlugin(async (nuxtApp) => {
317
328
  },
318
329
  switchLocale: (toLocale) => {
319
330
  const router = useRouter();
320
- const route = useRoute();
321
- const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
331
+ const route2 = useRoute();
332
+ const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
322
333
  if (i18nConfig.hashMode) {
323
334
  hashLocale = toLocale;
324
335
  }
325
- switchLocale(fromLocale, toLocale, route, router, i18nConfig, i18nRouteParams.value);
336
+ switchLocale(fromLocale, toLocale, route2, router, i18nConfig, i18nRouteParams.value);
326
337
  },
327
- switchRoute: (route, toLocale) => {
338
+ switchRoute: (route2, toLocale) => {
328
339
  const router = useRouter();
329
- if (typeof route === "string") {
330
- route = router.resolve(route);
340
+ if (typeof route2 === "string") {
341
+ route2 = router.resolve(route2);
331
342
  }
332
- const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
343
+ const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
333
344
  if (i18nConfig.hashMode) {
334
345
  hashLocale = toLocale ?? fromLocale;
335
346
  }
336
- switchLocale(fromLocale, toLocale ?? fromLocale, route, router, i18nConfig, i18nRouteParams.value);
347
+ switchLocale(fromLocale, toLocale ?? fromLocale, route2, router, i18nConfig, i18nRouteParams.value);
337
348
  },
338
349
  localeRoute: (to, locale) => {
339
350
  const router = useRouter();
340
- const route = useRoute();
341
- return getLocalizedRoute(to, router, route, i18nConfig, locale, hashLocale);
351
+ const route2 = useRoute();
352
+ return getLocalizedRoute(to, router, route2, i18nConfig, locale, hashLocale);
342
353
  },
343
354
  localePath: (to, locale) => {
344
355
  const router = useRouter();
345
- const route = useRoute();
346
- const localeRoute = getLocalizedRoute(to, router, route, i18nConfig, locale, hashLocale);
356
+ const route2 = useRoute();
357
+ const localeRoute = getLocalizedRoute(to, router, route2, i18nConfig, locale, hashLocale);
347
358
  if (typeof localeRoute === "string") {
348
359
  return localeRoute;
349
360
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
- "version": "1.32.1",
3
+ "version": "1.32.3",
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":"f1354573-fd79-4f4c-9c07-5367d8c22fba","timestamp":1731159691759,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}