nuxt-i18n-micro 2.5.0 → 2.6.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.
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CBxwnKtU.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BqKd8Zt-.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BYEpoBUk.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/XZXfxmri.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},1762356606888,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"dc8ec25f-2f2b-41cd-9ff1-ce2de81f36ea",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/XZXfxmri.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},1762414713405,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"119cca13-ae84-4b8a-b244-c16eb4a6ed9f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CBxwnKtU.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BqKd8Zt-.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BYEpoBUk.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/XZXfxmri.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},1762356606889,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"dc8ec25f-2f2b-41cd-9ff1-ce2de81f36ea",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/XZXfxmri.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},1762414713405,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"119cca13-ae84-4b8a-b244-c16eb4a6ed9f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -1 +1 @@
1
- {"id":"dc8ec25f-2f2b-41cd-9ff1-ce2de81f36ea","timestamp":1762356596622}
1
+ {"id":"119cca13-ae84-4b8a-b244-c16eb4a6ed9f","timestamp":1762414707440}
@@ -0,0 +1 @@
1
+ {"id":"119cca13-ae84-4b8a-b244-c16eb4a6ed9f","timestamp":1762414707440,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CBxwnKtU.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BqKd8Zt-.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/BYEpoBUk.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/XZXfxmri.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},1762356606889,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"dc8ec25f-2f2b-41cd-9ff1-ce2de81f36ea",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/XZXfxmri.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},1762414713405,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"119cca13-ae84-4b8a-b244-c16eb4a6ed9f",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": "2.5.0",
4
+ "version": "2.6.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -946,7 +946,8 @@ const module = defineNuxtModule({
946
946
  customRegexMatcher: options.customRegexMatcher,
947
947
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
948
948
  // @ts-ignore
949
- routesLocaleLinks: options.routesLocaleLinks ?? {}
949
+ routesLocaleLinks: options.routesLocaleLinks ?? {},
950
+ apiBaseUrl
950
951
  };
951
952
  addImportsDir(resolver.resolve("./runtime/composables"));
952
953
  if (process.env && process.env.TEST) {
@@ -58,7 +58,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
58
58
  if (isNoPrefixStrategy(i18nConfig.strategy)) {
59
59
  locale = await nuxtApp.runWithContext(() => useCookie("no-prefix-locale", { default: () => locale }).value);
60
60
  }
61
- const routeName = routeService.getRouteName(to, locale);
61
+ const routeName = routeService.getPluginRouteName(to, locale);
62
62
  if (!routeName) {
63
63
  return;
64
64
  }
@@ -92,7 +92,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
92
92
  }
93
93
  if (import.meta.client && enablePreviousPageFallback) {
94
94
  const fromLocale = routeService.getCurrentLocale(from);
95
- const fromRouteName = routeService.getRouteName(from, fromLocale);
95
+ const fromRouteName = routeService.getPluginRouteName(from, fromLocale);
96
96
  previousPageInfo.value = { locale: fromLocale, routeName: fromRouteName };
97
97
  }
98
98
  try {
@@ -119,7 +119,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
119
119
  if (!key) return "";
120
120
  route = route ?? routeService.getCurrentRoute();
121
121
  const locale = routeService.getCurrentLocale();
122
- const routeName = routeService.getRouteName(route, locale);
122
+ const routeName = routeService.getPluginRouteName(route, locale);
123
123
  let value = i18nHelper.getTranslation(locale, routeName, key);
124
124
  if (!value && previousPageInfo.value && enablePreviousPageFallback) {
125
125
  const prev = previousPageInfo.value;
@@ -172,13 +172,13 @@ export default defineNuxtPlugin(async (nuxtApp) => {
172
172
  has: (key, route) => {
173
173
  route = route ?? routeService.getCurrentRoute();
174
174
  const locale = routeService.getCurrentLocale();
175
- const routeName = routeService.getRouteName(route, locale);
175
+ const routeName = routeService.getPluginRouteName(route, locale);
176
176
  return !!i18nHelper.getTranslation(locale, routeName, key);
177
177
  },
178
178
  mergeTranslations: (newTranslations) => {
179
179
  const route = routeService.getCurrentRoute();
180
180
  const locale = routeService.getCurrentLocale(route);
181
- const routeName = routeService.getRouteName(route, locale);
181
+ const routeName = routeService.getPluginRouteName(route, locale);
182
182
  i18nHelper.mergeTranslation(locale, routeName, newTranslations);
183
183
  },
184
184
  mergeGlobalTranslations: (newTranslations) => {
@@ -5,7 +5,8 @@ const I18N_CONTEXT_KEY = "__i18n_cache__";
5
5
  async function fetchTranslations(locale) {
6
6
  try {
7
7
  const config = useRuntimeConfig();
8
- const apiBaseUrl = config.public.i18nConfig?.apiBaseUrl ?? "/_locales";
8
+ const i18nConfig = config.i18nConfig;
9
+ const apiBaseUrl = i18nConfig?.apiBaseUrl ?? "/_locales";
9
10
  const translations = await $fetch(`${apiBaseUrl}/general/${locale}/data.json`);
10
11
  return translations;
11
12
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
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",
@@ -61,9 +61,9 @@
61
61
  "globby": "^14.1.0",
62
62
  "sirv": "^2.0.4",
63
63
  "ufo": "^1.5.4",
64
- "nuxt-i18n-micro-types": "1.0.12",
65
64
  "nuxt-i18n-micro-test-utils": "1.0.7",
66
- "nuxt-i18n-micro-core": "1.0.23"
65
+ "nuxt-i18n-micro-types": "1.0.13",
66
+ "nuxt-i18n-micro-core": "1.0.24"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@nuxt/devtools": "^2.6.3",
@@ -1 +0,0 @@
1
- {"id":"dc8ec25f-2f2b-41cd-9ff1-ce2de81f36ea","timestamp":1762356596622,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}