nuxt-i18n-micro 1.93.0 → 1.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/client/200.html +8 -8
  2. package/dist/client/404.html +8 -8
  3. package/dist/client/_nuxt/builds/latest.json +1 -1
  4. package/dist/client/_nuxt/builds/meta/8fbea335-44f1-4fd8-b7cd-6d710a51cf44.json +1 -0
  5. package/dist/client/_nuxt/error-404.B2VbLYbY.css +1 -0
  6. package/dist/client/_nuxt/error-500.DGwSTbEi.css +1 -0
  7. package/dist/client/_nuxt/{BTINn22q.js → ln-kJldz.js} +1 -1
  8. package/dist/client/_nuxt/{Bjm5k_ND.js → ub4zB43c.js} +71 -71
  9. package/dist/client/_nuxt/{DvIeOzfB.js → vPnhRBON.js} +1 -1
  10. package/dist/client/_nuxt/{DFBiwLO-.js → vj59o92Y.js} +1 -1
  11. package/dist/client/index.html +8 -8
  12. package/dist/module.d.mts +2 -1
  13. package/dist/module.json +3 -3
  14. package/dist/module.mjs +86 -35
  15. package/dist/runtime/components/i18n-group.vue +7 -10
  16. package/dist/runtime/components/i18n-group.vue.d.ts +19 -0
  17. package/dist/runtime/components/i18n-link.vue +26 -43
  18. package/dist/runtime/components/i18n-link.vue.d.ts +19 -0
  19. package/dist/runtime/components/i18n-switcher.vue +93 -143
  20. package/dist/runtime/components/i18n-switcher.vue.d.ts +62 -0
  21. package/dist/runtime/components/i18n-t.vue.d.ts +1 -304
  22. package/dist/runtime/components/locale-redirect.vue +32 -50
  23. package/dist/runtime/components/locale-redirect.vue.d.ts +2 -0
  24. package/dist/runtime/composables/useLocaleHead.d.ts +2 -2
  25. package/dist/runtime/plugins/01.plugin.js +6 -2
  26. package/dist/runtime/plugins/04.auto-detect.js +4 -1
  27. package/dist/types.d.mts +8 -2
  28. package/package.json +26 -29
  29. package/dist/client/_nuxt/builds/meta/66d92d10-1ef4-46a8-88af-62abfdb758c6.json +0 -1
  30. package/dist/client/_nuxt/error-404.CbefIQ4Z.css +0 -1
  31. package/dist/client/_nuxt/error-500.Bpd-7vXd.css +0 -1
  32. package/dist/module.cjs +0 -5
  33. package/dist/module.d.ts +0 -31
  34. package/dist/types.d.ts +0 -7
  35. package/dist/utils.d.mts +0 -17
  36. package/dist/utils.d.ts +0 -17
  37. package/dist/utils.mjs +0 -64
  38. /package/{internals.d.ts → internals.d.mts} +0 -0
@@ -1 +1 @@
1
- import{_ as a,c as i,o as u,a as e,t as r,b as c,w as l,d,e as p}from"./Bjm5k_ND.js";import{u as f}from"./BTINn22q.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:[{innerHTML:`!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:[{innerHTML:'*,: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 u(),i("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-e84c2fd2"]]);export{v as default};
1
+ import{_ as a,c as i,o as u,a as e,t as r,b as c,w as l,d,e as p}from"./ub4zB43c.js";import{u as f}from"./ln-kJldz.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:[{innerHTML:`!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:[{innerHTML:'*,: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 u(),i("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-ed876d78"]]);export{v as default};
@@ -1 +1 @@
1
- import{_ as s,c as a,o as i,a as e,t as o}from"./Bjm5k_ND.js";import{u}from"./BTINn22q.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:[{innerHTML:`!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:[{innerHTML:'*,: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)=>(i(),a("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-3e7cfec8"]]);export{b as default};
1
+ import{_ as s,c as a,o as i,a as e,t as o}from"./ub4zB43c.js";import{u}from"./ln-kJldz.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:[{innerHTML:`!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:[{innerHTML:'*,: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)=>(i(),a("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)])]))}},h=s(f,[["__scopeId","data-v-09b9ec2d"]]);export{h as default};
@@ -1,12 +1,12 @@
1
1
  <!DOCTYPE html><html><head><meta charset="utf-8">
2
2
  <meta name="viewport" content="width=device-width, initial-scale=1">
3
3
  <link rel="stylesheet" href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/entry.BVfqTszp.css" crossorigin>
4
- <link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/Bjm5k_ND.js">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/ub4zB43c.js">
5
5
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/l5rcX3cq.js">
6
- <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-404.CbefIQ4Z.css">
7
- <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DvIeOzfB.js">
8
- <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BTINn22q.js">
9
- <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.Bpd-7vXd.css">
10
- <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DFBiwLO-.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/Bjm5k_ND.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},1755983427839,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"66d92d10-1ef4-46a8-88af-62abfdb758c6",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
6
+ <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-404.B2VbLYbY.css">
7
+ <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/vPnhRBON.js">
8
+ <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/ln-kJldz.js">
9
+ <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.DGwSTbEi.css">
10
+ <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/vj59o92Y.js">
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/ub4zB43c.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},1757064792248,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"8fbea335-44f1-4fd8-b7cd-6d710a51cf44",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.d.mts CHANGED
@@ -28,4 +28,5 @@ declare module '@nuxt/schema' {
28
28
  }
29
29
  }
30
30
 
31
- export { type ModuleHooks, _default as default };
31
+ export { _default as default };
32
+ export type { ModuleHooks };
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
3
  "configKey": "i18n",
4
- "version": "1.93.0",
4
+ "version": "1.95.0",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.4",
7
- "unbuild": "2.0.0"
6
+ "@nuxt/module-builder": "1.0.2",
7
+ "unbuild": "3.6.1"
8
8
  }
9
9
  }
package/dist/module.mjs CHANGED
@@ -7,7 +7,6 @@ import { isPrefixAndDefaultStrategy, isPrefixStrategy, isNoPrefixStrategy, isPre
7
7
  import { fileURLToPath } from 'node:url';
8
8
  import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
9
9
  import sirv from 'sirv';
10
- import { isInternalPath, extractLocaleRoutes, normalizePath, isLocaleDefault, cloneArray, isPageRedirectOnly, removeLeadingSlash, shouldAddLocalePrefix, buildFullPath, buildRouteName, buildFullPathNoPrefix } from './utils.mjs';
11
10
 
12
11
  const DEVTOOLS_UI_PORT = 3030;
13
12
  const DEVTOOLS_UI_ROUTE = "/__nuxt-i18n-micro";
@@ -74,8 +73,7 @@ function setupDevToolsUI(options, resolve2) {
74
73
  const localesDir = path.join(rootDir, options.translationDir || "locales");
75
74
  const pagesDir = path.join(localesDir, "pages");
76
75
  const processDirectory = (dir) => {
77
- if (!fs.existsSync(dir))
78
- return;
76
+ if (!fs.existsSync(dir)) return;
79
77
  fs.readdirSync(dir).forEach((file) => {
80
78
  const filePath = path.join(dir, file);
81
79
  const stat = fs.lstatSync(filePath);
@@ -110,6 +108,64 @@ function setupDevToolsUI(options, resolve2) {
110
108
  });
111
109
  }
112
110
 
111
+ const isInternalPath = (p) => /(?:^|\/)__[^/]+/.test(p);
112
+ function extractLocaleRoutes(content, filePath) {
113
+ const defineMatch = content.match(/\$?\bdefineI18nRoute\s*\(\s*\{[\s\S]*?\}\s*\)/);
114
+ if (defineMatch) {
115
+ const localeRoutesMatch = defineMatch[0].match(/localeRoutes:\s*(\{[\s\S]*?\})/);
116
+ if (localeRoutesMatch && localeRoutesMatch[1]) {
117
+ try {
118
+ const parsedLocaleRoutes = Function('"use strict";return (' + localeRoutesMatch[1] + ")")();
119
+ if (typeof parsedLocaleRoutes === "object" && parsedLocaleRoutes !== null) {
120
+ if (validateDefineI18nRouteConfig(parsedLocaleRoutes)) {
121
+ return parsedLocaleRoutes;
122
+ }
123
+ } else {
124
+ console.error("localeRoutes found but it is not a valid object in file:", filePath);
125
+ }
126
+ } catch (error) {
127
+ console.error("Failed to parse localeRoutes:", error, "in file:", filePath);
128
+ }
129
+ }
130
+ }
131
+ return null;
132
+ }
133
+ function validateDefineI18nRouteConfig(obj) {
134
+ if (typeof obj !== "object") return false;
135
+ for (const routeKey in obj.localeRoutes) {
136
+ if (typeof obj.localeRoutes[routeKey] !== "string") return false;
137
+ }
138
+ return true;
139
+ }
140
+ const normalizePath = (routePath) => {
141
+ if (!routePath) {
142
+ return "";
143
+ }
144
+ const normalized = path.posix.normalize(routePath).replace(/\/+$/, "");
145
+ return normalized === "." ? "" : normalized;
146
+ };
147
+ const cloneArray = (array) => array.map((item) => ({ ...item }));
148
+ const isPageRedirectOnly = (page) => !!(page.redirect && !page.file);
149
+ const removeLeadingSlash = (routePath) => routePath.startsWith("/") ? routePath.slice(1) : routePath;
150
+ const buildRouteName = (baseName, localeCode, isCustom) => isCustom ? `localized-${baseName}-${localeCode}` : `localized-${baseName}`;
151
+ const shouldAddLocalePrefix = (locale, defaultLocale, addLocalePrefix, includeDefaultLocaleRoute) => addLocalePrefix && !(locale === defaultLocale.code && !includeDefaultLocaleRoute);
152
+ const isLocaleDefault = (locale, defaultLocale, includeDefaultLocaleRoute) => {
153
+ const localeCode = typeof locale === "string" ? locale : locale.code;
154
+ return localeCode === defaultLocale.code && !includeDefaultLocaleRoute;
155
+ };
156
+ const buildFullPath = (locale, basePath, customRegex) => {
157
+ const regexString = normalizeRegex(customRegex?.toString());
158
+ const localeParam = regexString ? regexString : Array.isArray(locale) ? locale.join("|") : locale;
159
+ return normalizePath(path.posix.join("/", `:locale(${localeParam})`, basePath));
160
+ };
161
+ const buildFullPathNoPrefix = (basePath) => {
162
+ return normalizePath(basePath);
163
+ };
164
+ const normalizeRegex = (toNorm) => {
165
+ if (typeof toNorm === "undefined") return void 0;
166
+ return toNorm.startsWith("/") && toNorm.endsWith("/") ? toNorm?.slice(1, -1) : toNorm;
167
+ };
168
+
113
169
  const buildRouteNameFromRoute = (name, path2) => {
114
170
  return name ?? (path2 ?? "").replace(/[^a-z0-9]/gi, "-").replace(/^-+|-+$/g, "");
115
171
  };
@@ -163,12 +219,11 @@ class PageManager {
163
219
  if (isPrefixStrategy(this.strategy) && !isCloudflarePages) {
164
220
  for (let i = pages.length - 1; i >= 0; i--) {
165
221
  const page = pages[i];
222
+ if (!page) continue;
166
223
  const pagePath = page.path ?? "";
167
224
  const pageName = page.name ?? "";
168
- if (isInternalPath(pagePath))
169
- continue;
170
- if (this.globalLocaleRoutes[pageName] === false)
171
- continue;
225
+ if (isInternalPath(pagePath)) continue;
226
+ if (this.globalLocaleRoutes[pageName] === false) continue;
172
227
  if (!/^\/:locale/.test(pagePath) && pagePath !== "/") {
173
228
  pages.splice(i, 1);
174
229
  }
@@ -210,16 +265,14 @@ class PageManager {
210
265
  const newRoute = this.createLocalizedRoute(page, [locale.code], page.children ?? [], true, customPath, customRegex, false, locale.code);
211
266
  if (newRoute) {
212
267
  additionalRoutes.push(newRoute);
213
- if (this.noPrefixRedirect)
214
- page.redirect = newRoute.path;
268
+ if (this.noPrefixRedirect) page.redirect = newRoute.path;
215
269
  }
216
270
  } else {
217
271
  if (isDefaultLocale) {
218
272
  page.path = normalizePath(customPath);
219
273
  } else {
220
274
  const newRoute = this.createLocalizedRoute(page, [locale.code], page.children ?? [], true, customPath, customRegex, false, locale.code);
221
- if (newRoute)
222
- additionalRoutes.push(newRoute);
275
+ if (newRoute) additionalRoutes.push(newRoute);
223
276
  }
224
277
  }
225
278
  } else {
@@ -233,15 +286,13 @@ class PageManager {
233
286
  });
234
287
  }
235
288
  localizePage(page, additionalRoutes, customRegex) {
236
- if (isPageRedirectOnly(page))
237
- return;
289
+ if (isPageRedirectOnly(page)) return;
238
290
  const originalChildren = cloneArray(page.children ?? []);
239
291
  const normalizedFullPath = normalizePath(page.path);
240
292
  const localeCodesWithoutCustomPaths = this.filterLocaleCodesWithoutCustomPaths(normalizedFullPath);
241
293
  if (localeCodesWithoutCustomPaths.length) {
242
294
  const newRoute = this.createLocalizedRoute(page, localeCodesWithoutCustomPaths, originalChildren, false, "", customRegex, false, true);
243
- if (newRoute)
244
- additionalRoutes.push(newRoute);
295
+ if (newRoute) additionalRoutes.push(newRoute);
245
296
  }
246
297
  this.addCustomLocalizedRoutes(page, normalizedFullPath, originalChildren, additionalRoutes);
247
298
  this.adjustRouteForDefaultLocale(page, originalChildren);
@@ -285,20 +336,17 @@ class PageManager {
285
336
  addCustomLocalizedRoutes(page, fullPath, originalChildren, additionalRoutes, customRegex) {
286
337
  this.locales.forEach((locale) => {
287
338
  const customPath = this.localizedPaths[fullPath]?.[locale.code];
288
- if (!customPath)
289
- return;
339
+ if (!customPath) return;
290
340
  const isDefaultLocale = isLocaleDefault(locale, this.defaultLocale, isPrefixStrategy(this.strategy) || isNoPrefixStrategy(this.strategy));
291
341
  if (isDefaultLocale) {
292
342
  page.children = this.createLocalizedChildren(originalChildren, "", [locale.code], false);
293
343
  } else {
294
344
  const newRoute = this.createLocalizedRoute(page, [locale.code], originalChildren, true, customPath, customRegex, false, locale.code);
295
- if (newRoute)
296
- additionalRoutes.push(newRoute);
345
+ if (newRoute) additionalRoutes.push(newRoute);
297
346
  }
298
347
  if (isPrefixAndDefaultStrategy(this.strategy) && locale === this.defaultLocale) {
299
348
  const newRoute = this.createLocalizedRoute(page, [locale.code], originalChildren, true, customPath, customRegex, true, locale.code);
300
- if (newRoute)
301
- additionalRoutes.push(newRoute);
349
+ if (newRoute) additionalRoutes.push(newRoute);
302
350
  }
303
351
  });
304
352
  }
@@ -393,9 +441,11 @@ class PageManager {
393
441
  }
394
442
  createLocalizedRoute(page, localeCodes, originalChildren, isCustom, customPath = "", customRegex, force = false, parentLocale = false) {
395
443
  const routePath = this.buildRoutePath(localeCodes, page.path, encodeURI(customPath), isCustom, customRegex, force);
396
- if (!routePath || routePath == page.path)
397
- return null;
398
- const routeName = buildRouteName(buildRouteNameFromRoute(page.name, page.path), localeCodes[0], isCustom);
444
+ if (!routePath || routePath == page.path) return null;
445
+ if (localeCodes.length === 0) return null;
446
+ const firstLocale = localeCodes[0];
447
+ if (!firstLocale) return null;
448
+ const routeName = buildRouteName(buildRouteNameFromRoute(page.name ?? "", page.path ?? ""), firstLocale, isCustom);
399
449
  return {
400
450
  ...page,
401
451
  children: this.createLocalizedChildren(originalChildren, page.path, localeCodes, true, false, parentLocale),
@@ -404,8 +454,7 @@ class PageManager {
404
454
  };
405
455
  }
406
456
  buildLocalizedRouteName(baseName, locale, modifyName, forceLocaleSuffixOrCustom = false) {
407
- if (!modifyName)
408
- return baseName;
457
+ if (!modifyName) return baseName;
409
458
  if (forceLocaleSuffixOrCustom) {
410
459
  return `localized-${baseName}-${locale}`;
411
460
  }
@@ -524,13 +573,16 @@ const module = defineNuxtModule({
524
573
  return null;
525
574
  }
526
575
  const forms = translation.toString().split("|");
527
- return (count < forms.length ? forms[count].trim() : forms[forms.length - 1].trim()).replace("{count}", count.toString());
576
+ if (forms.length === 0) return null;
577
+ const selectedForm = count < forms.length ? forms[count] : forms[forms.length - 1];
578
+ if (!selectedForm) return null;
579
+ return selectedForm.trim().replace("{count}", count.toString());
528
580
  },
529
581
  customRegexMatcher: void 0
530
582
  },
531
583
  async setup(options, nuxt) {
532
584
  const defaultLocale = process.env.DEFAULT_LOCALE ?? options.defaultLocale ?? "en";
533
- const isSSG = nuxt.options.nitro.static ?? nuxt.options._generate;
585
+ const isSSG = nuxt.options.nitro.static ?? nuxt.options._generate ?? false;
534
586
  const isCloudflarePages = nuxt.options.nitro.preset?.startsWith("cloudflare");
535
587
  const logger = useLogger("nuxt-i18n-micro");
536
588
  if (options.includeDefaultLocaleRoute !== void 0) {
@@ -678,11 +730,9 @@ const module = defineNuxtModule({
678
730
  pages.push(fallbackRoute);
679
731
  }
680
732
  if (!isNoPrefixStrategy(options.strategy)) {
681
- nuxt.options.generate.routes = Array.isArray(nuxt.options.generate.routes) ? nuxt.options.generate.routes : [];
682
733
  if (isCloudflarePages) {
683
734
  const processPageWithChildren = (page, parentPath = "") => {
684
- if (!page.path)
685
- return;
735
+ if (!page.path) return;
686
736
  const fullPath = path.posix.normalize(`${parentPath}/${page.path}`);
687
737
  if (isInternalPath(fullPath)) {
688
738
  return;
@@ -692,7 +742,7 @@ const module = defineNuxtModule({
692
742
  return;
693
743
  }
694
744
  const localeSegmentMatch = fullPath.match(/:locale\(([^)]+)\)/);
695
- if (localeSegmentMatch) {
745
+ if (localeSegmentMatch && localeSegmentMatch[1]) {
696
746
  const availableLocales = localeSegmentMatch[1].split("|");
697
747
  localeManager.locales.forEach((locale) => {
698
748
  const localeCode = locale.code;
@@ -770,13 +820,14 @@ const module = defineNuxtModule({
770
820
  return;
771
821
  }
772
822
  const routes = nitroConfig.prerender?.routes || [];
773
- nuxt.options.generate.routes = Array.isArray(nuxt.options.generate.routes) ? nuxt.options.generate.routes : [];
774
- const pages = nuxt.options.generate.routes || [];
823
+ nitroConfig.prerender = nitroConfig.prerender || {};
824
+ nitroConfig.prerender.routes = Array.isArray(nitroConfig.prerender.routes) ? nitroConfig.prerender.routes : [];
825
+ const pages = nitroConfig.prerender.routes || [];
775
826
  localeManager.locales.forEach((locale) => {
776
827
  const shouldGenerate = locale.code !== defaultLocale || withPrefixStrategy(options.strategy);
777
828
  if (shouldGenerate) {
778
829
  pages.forEach((page) => {
779
- if (!/\.[a-z0-9]+$/i.test(page) && !isInternalPath(page)) {
830
+ if (page && !/\.[a-z0-9]+$/i.test(page) && !isInternalPath(page)) {
780
831
  const localizedPage = `/${locale.code}${page}`;
781
832
  const routeRule = routeRules[page];
782
833
  if (routeRule && routeRule.prerender === false) {
@@ -8,16 +8,13 @@
8
8
  </template>
9
9
 
10
10
  <script setup>
11
- import { useNuxtApp, useRoute } from '#imports'
12
-
11
+ import { useNuxtApp, useRoute } from "#imports";
13
12
  const props = defineProps({
14
13
  prefix: { type: String, required: true },
15
- groupClass: { type: String, default: '' },
16
- })
17
-
18
- const { $_t } = useNuxtApp()
19
- const route = useRoute()
20
- const $t = $_t(route)
21
-
22
- const translate = (key, params = {}) => $t(`${props.prefix}.${key}`, params)
14
+ groupClass: { type: String, default: "" }
15
+ });
16
+ const { $_t } = useNuxtApp();
17
+ const route = useRoute();
18
+ const $t = $_t(route);
19
+ const translate = (key, params = {}) => $t(`${props.prefix}.${key}`, params);
23
20
  </script>
@@ -0,0 +1,19 @@
1
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
2
+ export default _default;
3
+ type __VLS_WithSlots<T, S> = T & (new () => {
4
+ $slots: S;
5
+ });
6
+ declare const __VLS_component: import("vue").DefineComponent<{}, {
7
+ prefix: string;
8
+ groupClass: string;
9
+ $props: {
10
+ readonly prefix?: string | undefined;
11
+ readonly groupClass?: string | undefined;
12
+ };
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
+ type __VLS_Slots = {
15
+ default?: ((props: {
16
+ prefix: string;
17
+ t: (key: any, params?: {}) => any;
18
+ }) => any) | undefined;
19
+ };
@@ -18,57 +18,40 @@
18
18
  </NuxtLink>
19
19
  </template>
20
20
 
21
- <script lang="ts" setup>
22
- import type { RouteLocationNamedRaw, RouteLocationResolvedGeneric } from 'vue-router'
23
- import { useNuxtApp, computed, useRoute, useRouter } from '#imports'
24
-
25
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
26
- // @ts-ignore
27
- const { $localeRoute } = useNuxtApp()
28
-
29
- interface Props {
30
- to: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string
31
- activeStyle?: Partial<CSSStyleValue>
32
- }
33
-
34
- const props = defineProps<Props>()
35
- const route = useRoute()
36
-
21
+ <script setup>
22
+ import { useNuxtApp, computed, useRoute, useRouter } from "#imports";
23
+ const { $localeRoute } = useNuxtApp();
24
+ const props = defineProps({
25
+ to: { type: [Object, String], required: true },
26
+ activeStyle: { type: Object, required: false }
27
+ });
28
+ const route = useRoute();
37
29
  const isExternalLink = computed(() => {
38
- if (typeof props.to === 'string') {
39
- return /^(?:https?:\/\/|\/\/|[a-zA-Z0-9-]+\.[a-zA-Z]{2,})|tel:|mailto:/.test(props.to)
30
+ if (typeof props.to === "string") {
31
+ return /^(?:https?:\/\/|\/\/|[a-zA-Z0-9-]+\.[a-zA-Z]{2,})|tel:|mailto:/.test(props.to);
40
32
  }
41
- return false
42
- })
43
-
33
+ return false;
34
+ });
44
35
  const externalHref = computed(() => {
45
- if (isExternalLink.value && typeof props.to === 'string') {
36
+ if (isExternalLink.value && typeof props.to === "string") {
46
37
  if (!/^https?:\/\//.test(props.to)) {
47
- return `https://${props.to}`
38
+ return `https://${props.to}`;
48
39
  }
49
- return props.to
40
+ return props.to;
50
41
  }
51
- return undefined
52
- })
53
-
42
+ return void 0;
43
+ });
54
44
  const isActive = computed(() => {
55
45
  if (isExternalLink.value) {
56
- return false
46
+ return false;
57
47
  }
58
- // If `to` is a string, compare it directly to the route path
59
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
60
- // @ts-ignore
61
- const newPath = $localeRoute(props.to)
62
- if (typeof newPath === 'string') {
63
- return route.path === useRouter().resolve(newPath).path
48
+ const newPath = $localeRoute(props.to);
49
+ if (typeof newPath === "string") {
50
+ return route.path === useRouter().resolve(newPath).path;
64
51
  }
65
-
66
- return route.path === newPath.path
67
- })
68
-
69
- const computedStyle = computed((): Partial<CSSStyleValue> => {
70
- return isActive.value
71
- ? { ...props.activeStyle }
72
- : {}
73
- })
52
+ return route.path === newPath.path;
53
+ });
54
+ const computedStyle = computed(() => {
55
+ return isActive.value ? { ...props.activeStyle } : {};
56
+ });
74
57
  </script>
@@ -0,0 +1,19 @@
1
+ import type { RouteLocationNamedRaw, RouteLocationResolvedGeneric } from 'vue-router';
2
+ interface Props {
3
+ to: RouteLocationNamedRaw | RouteLocationResolvedGeneric | string;
4
+ activeStyle?: Partial<CSSStyleValue>;
5
+ }
6
+ declare var __VLS_1: {}, __VLS_8: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_1) => any;
9
+ } & {
10
+ default?: (props: typeof __VLS_8) => any;
11
+ };
12
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };