nuxt-i18n-micro 1.32.3 → 1.32.4

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{_ 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
+ 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"./4JH8UTMa.js";import{u as f}from"./aMbB5uuc.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"./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
+ import{_ as s,o as a,c as i,a as e,t as o}from"./4JH8UTMa.js";import{u}from"./aMbB5uuc.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
- 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
+ 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"./4JH8UTMa.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
- {"id":"97407185-9c30-415a-a770-7c7fbf00a393","timestamp":1731570644540}
1
+ {"id":"a1505046-64e8-434e-9b51-9b35d5ab1294","timestamp":1731590151884}
@@ -0,0 +1 @@
1
+ {"id":"a1505046-64e8-434e-9b51-9b35d5ab1294","timestamp":1731590151884,"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/BqvPetMk.js">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/4JH8UTMa.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/Dh7ThpBa.js">
8
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/DKpok9-G.js">
7
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BDOV1jAH.js">
8
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/aMbB5uuc.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/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>
10
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BPVvw6x6.js">
11
+ <script type="module" src="/__nuxt-i18n-micro/_nuxt/4JH8UTMa.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},1731590163334,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"a1505046-64e8-434e-9b51-9b35d5ab1294",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.3",
4
+ "version": "1.32.4",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -1,6 +1,6 @@
1
1
  import { useTranslationHelper } from "../translationHelper.js";
2
2
  import { defineNuxtPlugin, useRuntimeConfig } from "#app";
3
- import { useRoute, useRouter, useCookie, useState, navigateTo } from "#imports";
3
+ import { useRouter, useCookie, useState, navigateTo } from "#imports";
4
4
  import { plural } from "#build/i18n.plural.mjs";
5
5
  const i18nHelper = useTranslationHelper();
6
6
  const isDev = process.env.NODE_ENV !== "production";
@@ -204,8 +204,8 @@ 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 route2 = `/${apiBaseUrl}/${fRouteName}/${locale}/data.json?v=${i18nConfig.dateBuild}`.replace(/\/{2,}/g, "/");
208
- const data = await $fetch(route2, { baseURL: runtimeConfig.app.baseURL });
207
+ const route = `/${apiBaseUrl}/${fRouteName}/${locale}/data.json?v=${i18nConfig.dateBuild}`.replace(/\/{2,}/g, "/");
208
+ const data = await $fetch(route, { baseURL: runtimeConfig.app.baseURL });
209
209
  await i18nHelper.loadPageTranslations(locale, routeName, data ?? {});
210
210
  }
211
211
  } catch (_error) {
@@ -227,7 +227,8 @@ export default defineNuxtPlugin(async (nuxtApp) => {
227
227
  i18nHelper.mergeTranslation(selectedLocale ?? locale, routeName, translations, true);
228
228
  }, locale);
229
229
  }
230
- useRouter().beforeEach(async (to, from, next) => {
230
+ const router = useRouter();
231
+ router.beforeEach(async (to, from, next) => {
231
232
  if (to.path !== from.path) {
232
233
  await loadTranslationsForRoute(to);
233
234
  }
@@ -235,14 +236,13 @@ export default defineNuxtPlugin(async (nuxtApp) => {
235
236
  next();
236
237
  }
237
238
  });
238
- const route = useRoute();
239
- await loadTranslationsForRoute(route);
239
+ await loadTranslationsForRoute(router.currentRoute.value);
240
240
  const getTranslation = (key, params, defaultValue) => {
241
241
  if (!key) return "";
242
- const route2 = useRoute();
242
+ const route = router.currentRoute.value;
243
243
  const hashLocale2 = i18nConfig.hashMode ? (useCookie("hash-locale").value ?? i18nConfig.defaultLocale).toString() : null;
244
- const locale = getCurrentLocale(route2, i18nConfig, hashLocale2);
245
- const routeName = getRouteName(route2, locale);
244
+ const locale = getCurrentLocale(route, i18nConfig, hashLocale2);
245
+ const routeName = getRouteName(route, locale);
246
246
  let value = i18nHelper.getTranslation(locale, routeName, key);
247
247
  if (!value) {
248
248
  if (isDev && import.meta.client) {
@@ -263,13 +263,13 @@ export default defineNuxtPlugin(async (nuxtApp) => {
263
263
  const provideData = {
264
264
  i18n: void 0,
265
265
  __micro: true,
266
- getLocale: () => getCurrentLocale(useRoute(), i18nConfig, hashLocale),
267
- getLocaleName: () => getCurrentName(useRoute(), i18nConfig, hashLocale),
266
+ getLocale: () => getCurrentLocale(router.currentRoute.value, i18nConfig, hashLocale),
267
+ getLocaleName: () => getCurrentName(router.currentRoute.value, i18nConfig, hashLocale),
268
268
  defaultLocale: () => i18nConfig.defaultLocale,
269
269
  getLocales: () => i18nConfig.locales || [],
270
- getRouteName: (route2, locale) => {
271
- const selectedLocale = locale ?? getCurrentLocale(useRoute(), i18nConfig, hashLocale);
272
- const selectedRoute = route2 ?? useRoute();
270
+ getRouteName: (route, locale) => {
271
+ const selectedLocale = locale ?? getCurrentLocale(router.currentRoute.value, i18nConfig, hashLocale);
272
+ const selectedRoute = route ?? router.currentRoute.value;
273
273
  return getRouteName(selectedRoute, selectedLocale);
274
274
  },
275
275
  t: getTranslation,
@@ -278,46 +278,44 @@ export default defineNuxtPlugin(async (nuxtApp) => {
278
278
  return value?.toString() ?? defaultValue ?? key;
279
279
  },
280
280
  tc: (key, count, defaultValue) => {
281
- const route2 = useRoute();
282
- const currentLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
281
+ const route = router.currentRoute.value;
282
+ const currentLocale = getCurrentLocale(route, i18nConfig, hashLocale);
283
283
  return plural(key, count, currentLocale, getTranslation) ?? defaultValue ?? key;
284
284
  },
285
285
  tn: (value, options) => {
286
- const route2 = useRoute();
287
- const locale = getCurrentLocale(route2, i18nConfig, hashLocale);
286
+ const route = router.currentRoute.value;
287
+ const locale = getCurrentLocale(route, i18nConfig, hashLocale);
288
288
  return formatNumber(value, locale, options);
289
289
  },
290
290
  td: (value, options) => {
291
- const route2 = useRoute();
292
- const locale = getCurrentLocale(route2, i18nConfig, hashLocale);
291
+ const route = router.currentRoute.value;
292
+ const locale = getCurrentLocale(route, i18nConfig, hashLocale);
293
293
  return formatDate(value, locale, options);
294
294
  },
295
295
  has: (key) => {
296
296
  return !!getTranslation(key);
297
297
  },
298
298
  mergeTranslations: (newTranslations) => {
299
- const route2 = useRoute();
300
- const locale = getCurrentLocale(route2, i18nConfig, hashLocale);
301
- const routeName = getRouteName(route2, locale);
299
+ const route = router.currentRoute.value;
300
+ const locale = getCurrentLocale(route, i18nConfig, hashLocale);
301
+ const routeName = getRouteName(route, locale);
302
302
  i18nHelper.mergeTranslation(locale, routeName, newTranslations);
303
303
  },
304
304
  switchLocaleRoute: (toLocale) => {
305
- const router = useRouter();
306
- const route2 = useRoute();
307
- const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
305
+ const route = router.currentRoute.value;
306
+ const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
308
307
  if (i18nConfig.hashMode) {
309
308
  hashLocale = toLocale;
310
309
  }
311
- return switchLocaleRoute(fromLocale, toLocale, route2, router, i18nConfig, i18nRouteParams.value);
310
+ return switchLocaleRoute(fromLocale, toLocale, route, router, i18nConfig, i18nRouteParams.value);
312
311
  },
313
312
  switchLocalePath: (toLocale) => {
314
- const router = useRouter();
315
- const route2 = useRoute();
316
- const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
313
+ const route = router.currentRoute.value;
314
+ const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
317
315
  if (i18nConfig.hashMode) {
318
316
  hashLocale = toLocale;
319
317
  }
320
- const localeRoute = switchLocaleRoute(fromLocale, toLocale, route2, router, i18nConfig, i18nRouteParams.value);
318
+ const localeRoute = switchLocaleRoute(fromLocale, toLocale, route, router, i18nConfig, i18nRouteParams.value);
321
319
  if (typeof localeRoute === "string") {
322
320
  return localeRoute;
323
321
  }
@@ -327,34 +325,30 @@ export default defineNuxtPlugin(async (nuxtApp) => {
327
325
  return "";
328
326
  },
329
327
  switchLocale: (toLocale) => {
330
- const router = useRouter();
331
- const route2 = useRoute();
332
- const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
328
+ const route = router.currentRoute.value;
329
+ const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
333
330
  if (i18nConfig.hashMode) {
334
331
  hashLocale = toLocale;
335
332
  }
336
- switchLocale(fromLocale, toLocale, route2, router, i18nConfig, i18nRouteParams.value);
333
+ switchLocale(fromLocale, toLocale, route, router, i18nConfig, i18nRouteParams.value);
337
334
  },
338
- switchRoute: (route2, toLocale) => {
339
- const router = useRouter();
340
- if (typeof route2 === "string") {
341
- route2 = router.resolve(route2);
335
+ switchRoute: (route, toLocale) => {
336
+ if (typeof route === "string") {
337
+ route = router.resolve(route);
342
338
  }
343
- const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
339
+ const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
344
340
  if (i18nConfig.hashMode) {
345
341
  hashLocale = toLocale ?? fromLocale;
346
342
  }
347
- switchLocale(fromLocale, toLocale ?? fromLocale, route2, router, i18nConfig, i18nRouteParams.value);
343
+ switchLocale(fromLocale, toLocale ?? fromLocale, route, router, i18nConfig, i18nRouteParams.value);
348
344
  },
349
345
  localeRoute: (to, locale) => {
350
- const router = useRouter();
351
- const route2 = useRoute();
352
- return getLocalizedRoute(to, router, route2, i18nConfig, locale, hashLocale);
346
+ const route = router.currentRoute.value;
347
+ return getLocalizedRoute(to, router, route, i18nConfig, locale, hashLocale);
353
348
  },
354
349
  localePath: (to, locale) => {
355
- const router = useRouter();
356
- const route2 = useRoute();
357
- const localeRoute = getLocalizedRoute(to, router, route2, i18nConfig, locale, hashLocale);
350
+ const route = router.currentRoute.value;
351
+ const localeRoute = getLocalizedRoute(to, router, route, i18nConfig, locale, hashLocale);
358
352
  if (typeof localeRoute === "string") {
359
353
  return localeRoute;
360
354
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
- "version": "1.32.3",
3
+ "version": "1.32.4",
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":"97407185-9c30-415a-a770-7c7fbf00a393","timestamp":1731570644540,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}