nuxt-i18n-micro 1.65.2 → 1.66.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/CcDaBmcC.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.D1x2GrnM.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/rqhqIC0Q.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/ClTsZsex.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},1737366464003,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"7c39f1aa-be74-4ec0-9bb5-f41b62da6a20",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/ClTsZsex.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},1737380798793,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"bc049cd9-4687-453a-a24c-fd55385e6fd1",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CcDaBmcC.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.D1x2GrnM.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/rqhqIC0Q.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/ClTsZsex.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},1737366464003,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"7c39f1aa-be74-4ec0-9bb5-f41b62da6a20",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/ClTsZsex.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},1737380798794,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"bc049cd9-4687-453a-a24c-fd55385e6fd1",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -1 +1 @@
1
- {"id":"7c39f1aa-be74-4ec0-9bb5-f41b62da6a20","timestamp":1737366458763}
1
+ {"id":"bc049cd9-4687-453a-a24c-fd55385e6fd1","timestamp":1737380794260}
@@ -0,0 +1 @@
1
+ {"id":"bc049cd9-4687-453a-a24c-fd55385e6fd1","timestamp":1737380794260,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CcDaBmcC.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.D1x2GrnM.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/rqhqIC0Q.js">
11
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/ClTsZsex.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},1737366464004,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"7c39f1aa-be74-4ec0-9bb5-f41b62da6a20",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/ClTsZsex.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},1737380798794,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"bc049cd9-4687-453a-a24c-fd55385e6fd1",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.65.2",
4
+ "version": "1.66.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -468,7 +468,8 @@ const module = defineNuxtModule({
468
468
  async setup(options, nuxt) {
469
469
  const defaultLocale = process.env.DEFAULT_LOCALE ?? options.defaultLocale ?? "en";
470
470
  const isSSG = nuxt.options._generate;
471
- const isCloudflarePages = nuxt.options.nitro.preset === "cloudflare_pages" || process.env.NITRO_PRESET === "cloudflare-pages";
471
+ const isCloudflarePages = nuxt.options.nitro.preset?.startsWith("cloudflare");
472
+ const isVercelPages = nuxt.options.nitro.preset?.startsWith("vercel");
472
473
  const logger = useLogger("nuxt-i18n-micro");
473
474
  if (options.includeDefaultLocaleRoute !== void 0) {
474
475
  logger.debug("The 'includeDefaultLocaleRoute' option is deprecated. Use 'strategy' instead.");
@@ -639,7 +640,7 @@ const module = defineNuxtModule({
639
640
  nitroConfig.bundledStorage.push("i18n-locales");
640
641
  nitroConfig.devStorage = nitroConfig.devStorage || {};
641
642
  nitroConfig.devStorage["i18n-locales"] = {
642
- driver: "fs",
643
+ driver: isVercelPages ? "vercelKV" : "fs",
643
644
  base: path.join(nuxt.options.rootDir, "server/assets/i18n-locales")
644
645
  };
645
646
  if (nitroConfig.imports) {
@@ -8,7 +8,7 @@ declare const _default: import("nuxt/app").Plugin<{
8
8
  defaultLocale: () => string | undefined;
9
9
  getLocales: () => Locale[];
10
10
  getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
11
- t: (key: string, params?: Params, defaultValue?: string) => Translation;
11
+ t: (key: string, params?: Params, defaultValue?: string | null) => Translation;
12
12
  ts: (key: string, params?: Params, defaultValue?: string) => string;
13
13
  tc: (key: string, params: number | Params, defaultValue?: string) => string;
14
14
  tn: (value: number, options?: Intl.NumberFormatOptions) => string;
@@ -32,7 +32,7 @@ declare const _default: import("nuxt/app").Plugin<{
32
32
  defaultLocale: () => string | undefined;
33
33
  getLocales: () => Locale[];
34
34
  getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
35
- t: (key: string, params?: Params, defaultValue?: string) => Translation;
35
+ t: (key: string, params?: Params, defaultValue?: string | null) => Translation;
36
36
  ts: (key: string, params?: Params, defaultValue?: string) => string;
37
37
  tc: (key: string, params: number | Params, defaultValue?: string) => string;
38
38
  tn: (value: number, options?: Intl.NumberFormatOptions) => string;
@@ -56,7 +56,7 @@ export interface PluginsInjections {
56
56
  $getLocales: () => Locale[];
57
57
  $defaultLocale: () => string | undefined;
58
58
  $getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
59
- $t: (key: string, params?: Params, defaultValue?: string) => Translation;
59
+ $t: (key: string, params?: Params, defaultValue?: string | null) => Translation;
60
60
  $ts: (key: string, params?: Params, defaultValue?: string) => string;
61
61
  $tc: (key: string, params: number | Params, defaultValue?: string) => string;
62
62
  $tn: (value: number, options?: Intl.NumberFormatOptions) => string;
@@ -122,7 +122,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
122
122
  if (isDev && import.meta.client) {
123
123
  console.warn(`Not found '${key}' key in '${locale}' locale messages.`);
124
124
  }
125
- value = defaultValue || key;
125
+ value = defaultValue === void 0 ? key : defaultValue;
126
126
  }
127
127
  return typeof value === "string" && params ? interpolate(value, params) : value;
128
128
  },
@@ -148,7 +148,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
148
148
  return translationService.formatRelativeTime(value, currentLocale, options);
149
149
  },
150
150
  has: (key) => {
151
- return !!provideData.t(key);
151
+ return !!provideData.t(key, {}, null);
152
152
  },
153
153
  mergeTranslations: (newTranslations) => {
154
154
  const route = routeService.getCurrentRoute();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
- "version": "1.65.2",
3
+ "version": "1.66.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",
@@ -1 +0,0 @@
1
- {"id":"7c39f1aa-be74-4ec0-9bb5-f41b62da6a20","timestamp":1737366458763,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}