nuxt-i18n-micro 1.32.2 → 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"./De2IYGEm.js";import{u as f}from"./CL71IQiy.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"./De2IYGEm.js";import{u}from"./CL71IQiy.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"./De2IYGEm.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":"e22a2afa-23e9-4d8d-9d9a-796ce96339fd","timestamp":1731570174097}
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/De2IYGEm.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/DDIvEkjZ.js">
8
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CL71IQiy.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/Cwq8qovn.js">
11
- <script type="module" src="/__nuxt-i18n-micro/_nuxt/De2IYGEm.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},1731570187038,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"e22a2afa-23e9-4d8d-9d9a-796ce96339fd",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.2",
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,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 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) {
212
212
  }
213
213
  };
214
- async function loadTranslationsForRoute(to, 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,24 +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
- if (next) {
230
- next();
231
- }
232
229
  }
233
- useRouter().beforeEach(async (to, from, next) => {
230
+ const router = useRouter();
231
+ router.beforeEach(async (to, from, next) => {
234
232
  if (to.path !== from.path) {
235
- await loadTranslationsForRoute(to, next);
233
+ await loadTranslationsForRoute(to);
234
+ }
235
+ if (next) {
236
+ next();
236
237
  }
237
- next();
238
238
  });
239
- const route = useRoute();
240
- await loadTranslationsForRoute(route);
239
+ await loadTranslationsForRoute(router.currentRoute.value);
241
240
  const getTranslation = (key, params, defaultValue) => {
242
241
  if (!key) return "";
243
- const route2 = useRoute();
242
+ const route = router.currentRoute.value;
244
243
  const hashLocale2 = i18nConfig.hashMode ? (useCookie("hash-locale").value ?? i18nConfig.defaultLocale).toString() : null;
245
- const locale = getCurrentLocale(route2, i18nConfig, hashLocale2);
246
- const routeName = getRouteName(route2, locale);
244
+ const locale = getCurrentLocale(route, i18nConfig, hashLocale2);
245
+ const routeName = getRouteName(route, locale);
247
246
  let value = i18nHelper.getTranslation(locale, routeName, key);
248
247
  if (!value) {
249
248
  if (isDev && import.meta.client) {
@@ -264,13 +263,13 @@ export default defineNuxtPlugin(async (nuxtApp) => {
264
263
  const provideData = {
265
264
  i18n: void 0,
266
265
  __micro: true,
267
- getLocale: () => getCurrentLocale(useRoute(), i18nConfig, hashLocale),
268
- getLocaleName: () => getCurrentName(useRoute(), i18nConfig, hashLocale),
266
+ getLocale: () => getCurrentLocale(router.currentRoute.value, i18nConfig, hashLocale),
267
+ getLocaleName: () => getCurrentName(router.currentRoute.value, i18nConfig, hashLocale),
269
268
  defaultLocale: () => i18nConfig.defaultLocale,
270
269
  getLocales: () => i18nConfig.locales || [],
271
- getRouteName: (route2, locale) => {
272
- const selectedLocale = locale ?? getCurrentLocale(useRoute(), i18nConfig, hashLocale);
273
- 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;
274
273
  return getRouteName(selectedRoute, selectedLocale);
275
274
  },
276
275
  t: getTranslation,
@@ -279,46 +278,44 @@ export default defineNuxtPlugin(async (nuxtApp) => {
279
278
  return value?.toString() ?? defaultValue ?? key;
280
279
  },
281
280
  tc: (key, count, defaultValue) => {
282
- const route2 = useRoute();
283
- const currentLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
281
+ const route = router.currentRoute.value;
282
+ const currentLocale = getCurrentLocale(route, i18nConfig, hashLocale);
284
283
  return plural(key, count, currentLocale, getTranslation) ?? defaultValue ?? key;
285
284
  },
286
285
  tn: (value, options) => {
287
- const route2 = useRoute();
288
- const locale = getCurrentLocale(route2, i18nConfig, hashLocale);
286
+ const route = router.currentRoute.value;
287
+ const locale = getCurrentLocale(route, i18nConfig, hashLocale);
289
288
  return formatNumber(value, locale, options);
290
289
  },
291
290
  td: (value, options) => {
292
- const route2 = useRoute();
293
- const locale = getCurrentLocale(route2, i18nConfig, hashLocale);
291
+ const route = router.currentRoute.value;
292
+ const locale = getCurrentLocale(route, i18nConfig, hashLocale);
294
293
  return formatDate(value, locale, options);
295
294
  },
296
295
  has: (key) => {
297
296
  return !!getTranslation(key);
298
297
  },
299
298
  mergeTranslations: (newTranslations) => {
300
- const route2 = useRoute();
301
- const locale = getCurrentLocale(route2, i18nConfig, hashLocale);
302
- const routeName = getRouteName(route2, locale);
299
+ const route = router.currentRoute.value;
300
+ const locale = getCurrentLocale(route, i18nConfig, hashLocale);
301
+ const routeName = getRouteName(route, locale);
303
302
  i18nHelper.mergeTranslation(locale, routeName, newTranslations);
304
303
  },
305
304
  switchLocaleRoute: (toLocale) => {
306
- const router = useRouter();
307
- const route2 = useRoute();
308
- const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
305
+ const route = router.currentRoute.value;
306
+ const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
309
307
  if (i18nConfig.hashMode) {
310
308
  hashLocale = toLocale;
311
309
  }
312
- return switchLocaleRoute(fromLocale, toLocale, route2, router, i18nConfig, i18nRouteParams.value);
310
+ return switchLocaleRoute(fromLocale, toLocale, route, router, i18nConfig, i18nRouteParams.value);
313
311
  },
314
312
  switchLocalePath: (toLocale) => {
315
- const router = useRouter();
316
- const route2 = useRoute();
317
- const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
313
+ const route = router.currentRoute.value;
314
+ const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
318
315
  if (i18nConfig.hashMode) {
319
316
  hashLocale = toLocale;
320
317
  }
321
- const localeRoute = switchLocaleRoute(fromLocale, toLocale, route2, router, i18nConfig, i18nRouteParams.value);
318
+ const localeRoute = switchLocaleRoute(fromLocale, toLocale, route, router, i18nConfig, i18nRouteParams.value);
322
319
  if (typeof localeRoute === "string") {
323
320
  return localeRoute;
324
321
  }
@@ -328,34 +325,30 @@ export default defineNuxtPlugin(async (nuxtApp) => {
328
325
  return "";
329
326
  },
330
327
  switchLocale: (toLocale) => {
331
- const router = useRouter();
332
- const route2 = useRoute();
333
- const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
328
+ const route = router.currentRoute.value;
329
+ const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
334
330
  if (i18nConfig.hashMode) {
335
331
  hashLocale = toLocale;
336
332
  }
337
- switchLocale(fromLocale, toLocale, route2, router, i18nConfig, i18nRouteParams.value);
333
+ switchLocale(fromLocale, toLocale, route, router, i18nConfig, i18nRouteParams.value);
338
334
  },
339
- switchRoute: (route2, toLocale) => {
340
- const router = useRouter();
341
- if (typeof route2 === "string") {
342
- route2 = router.resolve(route2);
335
+ switchRoute: (route, toLocale) => {
336
+ if (typeof route === "string") {
337
+ route = router.resolve(route);
343
338
  }
344
- const fromLocale = getCurrentLocale(route2, i18nConfig, hashLocale);
339
+ const fromLocale = getCurrentLocale(route, i18nConfig, hashLocale);
345
340
  if (i18nConfig.hashMode) {
346
341
  hashLocale = toLocale ?? fromLocale;
347
342
  }
348
- switchLocale(fromLocale, toLocale ?? fromLocale, route2, router, i18nConfig, i18nRouteParams.value);
343
+ switchLocale(fromLocale, toLocale ?? fromLocale, route, router, i18nConfig, i18nRouteParams.value);
349
344
  },
350
345
  localeRoute: (to, locale) => {
351
- const router = useRouter();
352
- const route2 = useRoute();
353
- return getLocalizedRoute(to, router, route2, i18nConfig, locale, hashLocale);
346
+ const route = router.currentRoute.value;
347
+ return getLocalizedRoute(to, router, route, i18nConfig, locale, hashLocale);
354
348
  },
355
349
  localePath: (to, locale) => {
356
- const router = useRouter();
357
- const route2 = useRoute();
358
- 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);
359
352
  if (typeof localeRoute === "string") {
360
353
  return localeRoute;
361
354
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
- "version": "1.32.2",
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",