nuxt-i18n-micro 1.56.0 → 1.56.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BzXxbhIZ.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.DWqKq_Wn.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/B85fdbn4.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BhDLGWZB.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},1736233159796,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"2fa0562a-08ef-4fca-a540-4d449101e99b",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BhDLGWZB.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},1736261599038,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"133771c3-8571-4ce6-941a-4aebd70294a2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BzXxbhIZ.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.DWqKq_Wn.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/B85fdbn4.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BhDLGWZB.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},1736233159796,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"2fa0562a-08ef-4fca-a540-4d449101e99b",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BhDLGWZB.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},1736261599038,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"133771c3-8571-4ce6-941a-4aebd70294a2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -1 +1 @@
1
- {"id":"2fa0562a-08ef-4fca-a540-4d449101e99b","timestamp":1736233154031}
1
+ {"id":"133771c3-8571-4ce6-941a-4aebd70294a2","timestamp":1736261594319}
@@ -0,0 +1 @@
1
+ {"id":"133771c3-8571-4ce6-941a-4aebd70294a2","timestamp":1736261594319,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BzXxbhIZ.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.DWqKq_Wn.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/B85fdbn4.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BhDLGWZB.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},1736233159797,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"2fa0562a-08ef-4fca-a540-4d449101e99b",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BhDLGWZB.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},1736261599038,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"133771c3-8571-4ce6-941a-4aebd70294a2",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.56.0",
4
+ "version": "1.56.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -354,25 +354,29 @@ export default defineNuxtPlugin(async (nuxtApp) => {
354
354
  const currentRoute = router.currentRoute.value;
355
355
  const fromLocale = getCurrentLocale(currentRoute, i18nConfig, hashLocale, noPrefixDefault);
356
356
  const currentLocale = toLocale ?? fromLocale;
357
- if (typeof route === "string") {
357
+ let to = null;
358
+ if (typeof route === "string" && !isNoPrefixStrategy(i18nConfig.strategy)) {
358
359
  if (currentLocale !== i18nConfig.defaultLocale || withPrefixStrategy(i18nConfig.strategy)) {
359
360
  const currentRoute2 = router.currentRoute.value;
360
361
  const fromLocale2 = getCurrentLocale(currentRoute2, i18nConfig, hashLocale, noPrefixDefault);
361
- route = router.resolve("/" + fromLocale2 + route);
362
+ to = router.resolve("/" + fromLocale2 + route);
362
363
  } else {
363
- route = router.resolve(route);
364
+ to = router.resolve(route);
364
365
  }
365
366
  }
366
367
  if (i18nConfig.hashMode) {
367
368
  hashLocale = toLocale ?? fromLocale;
368
369
  }
369
- switchLocale(fromLocale, toLocale ?? fromLocale, route, router, i18nConfig, i18nRouteParams.value);
370
+ if (!to) {
371
+ return;
372
+ }
373
+ switchLocale(fromLocale, toLocale ?? fromLocale, to, router, i18nConfig, i18nRouteParams.value);
370
374
  },
371
375
  localeRoute: (to, locale) => {
372
376
  const currentRoute = router.currentRoute.value;
373
377
  const fromLocale = getCurrentLocale(currentRoute, i18nConfig, hashLocale, noPrefixDefault);
374
378
  const currentLocale = locale ?? fromLocale;
375
- if (typeof to === "string") {
379
+ if (typeof to === "string" && !isNoPrefixStrategy(i18nConfig.strategy)) {
376
380
  if (currentLocale !== i18nConfig.defaultLocale || withPrefixStrategy(i18nConfig.strategy)) {
377
381
  const currentRoute2 = router.currentRoute.value;
378
382
  const fromLocale2 = getCurrentLocale(currentRoute2, i18nConfig, hashLocale, noPrefixDefault);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
- "version": "1.56.0",
3
+ "version": "1.56.1",
4
4
  "description": "Nuxt I18n Micro is a lightweight, high-performance internationalization module for Nuxt, designed to handle multi-language support with minimal overhead, fast build times, and efficient runtime performance.",
5
5
  "repository": "s00d/nuxt-i18n-micro",
6
6
  "license": "MIT",
@@ -52,8 +52,8 @@
52
52
  "chokidar": "^3.6.0",
53
53
  "sirv": "^2.0.4",
54
54
  "ufo": "^1.5.4",
55
- "nuxt-i18n-micro-core": "1.0.10",
56
- "nuxt-i18n-micro-test-utils": "1.0.3"
55
+ "nuxt-i18n-micro-test-utils": "1.0.3",
56
+ "nuxt-i18n-micro-core": "1.0.10"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/jest": "^29.5.14",
@@ -1 +0,0 @@
1
- {"id":"2fa0562a-08ef-4fca-a540-4d449101e99b","timestamp":1736233154031,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}