nuxt-i18n-micro 1.36.0 → 1.36.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.
- package/dist/client/200.html +6 -6
- package/dist/client/404.html +6 -6
- package/dist/client/_nuxt/{CzPI1GQJ.js → B-rdPz5C.js} +1 -1
- package/dist/client/_nuxt/{DsNZE4Dc.js → BSIK_tlD.js} +1 -1
- package/dist/client/_nuxt/{B1xCwjDF.js → Bg-EgkMt.js} +1 -1
- package/dist/client/_nuxt/{fYVA_EiS.js → Bi0F1qle.js} +100 -100
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c0d0f579-bc8e-401c-b344-5ab0f1c7c077.json +1 -0
- package/dist/client/index.html +6 -6
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -7
- package/dist/runtime/translation-server-middleware.d.ts +1 -1
- package/dist/runtime/translation-server-middleware.js +1 -2
- package/internals.d.ts +0 -4
- package/package.json +1 -1
- package/dist/client/_nuxt/builds/meta/166e9332-75a4-41da-96ec-b2e17e8c07d9.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"c0d0f579-bc8e-401c-b344-5ab0f1c7c077","timestamp":1733172226991}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"c0d0f579-bc8e-401c-b344-5ab0f1c7c077","timestamp":1733172226991,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -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.BWujgj23.css" crossorigin>
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bi0F1qle.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.SWzu_puR.css">
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
8
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BSIK_tlD.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bg-EgkMt.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.Bkv_zTjr.css">
|
|
10
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
11
|
-
<script type="module" src="/__nuxt-i18n-micro/_nuxt/
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/B-rdPz5C.js">
|
|
11
|
+
<script type="module" src="/__nuxt-i18n-micro/_nuxt/Bi0F1qle.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},1733172240437,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"c0d0f579-bc8e-401c-b344-5ab0f1c7c077",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -451,9 +451,7 @@ const module = defineNuxtModule({
|
|
|
451
451
|
addTemplate({
|
|
452
452
|
filename: "i18n.plural.mjs",
|
|
453
453
|
write: true,
|
|
454
|
-
getContents: () => `
|
|
455
|
-
export const plural = ${options.plural.toString()};
|
|
456
|
-
`
|
|
454
|
+
getContents: () => `export const plural = ${options.plural.toString()};`
|
|
457
455
|
});
|
|
458
456
|
const apiBaseUrl = (process.env.NUXT_I18N_APP_BASE_URL ?? options.apiBaseUrl ?? "_locales").replace(/^\/+|\/+$|\/{2,}/, "");
|
|
459
457
|
nuxt.options.runtimeConfig.public.i18nConfig = {
|
|
@@ -598,10 +596,6 @@ const module = defineNuxtModule({
|
|
|
598
596
|
imports: ["useTranslationServerMiddleware"]
|
|
599
597
|
});
|
|
600
598
|
}
|
|
601
|
-
nitroConfig.virtual = nitroConfig.virtual || {};
|
|
602
|
-
nitroConfig.virtual["#internal/i18n/options.mjs"] = () => `
|
|
603
|
-
export const defaultLocale = "${options.defaultLocale}";
|
|
604
|
-
`;
|
|
605
599
|
const routes = nitroConfig.prerender?.routes || [];
|
|
606
600
|
nuxt.options.generate.routes = Array.isArray(nuxt.options.generate.routes) ? nuxt.options.generate.routes : [];
|
|
607
601
|
const pages = nuxt.options.generate.routes || [];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { H3Event } from 'h3';
|
|
2
|
-
export declare const useTranslationServerMiddleware: (event: H3Event, currentLocale?: string) => Promise<(key: string) => string>;
|
|
2
|
+
export declare const useTranslationServerMiddleware: (event: H3Event, defaultLocale?: string, currentLocale?: string) => Promise<(key: string) => string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getQuery, getCookie } from "h3";
|
|
2
2
|
import { useTranslationHelper } from "./translationHelper.js";
|
|
3
|
-
import { defaultLocale } from "#internal/i18n/options.mjs";
|
|
4
3
|
async function fetchTranslations(locale) {
|
|
5
4
|
try {
|
|
6
5
|
const translations = await $fetch(`/_locales/general/${locale}/data.json`);
|
|
@@ -10,7 +9,7 @@ async function fetchTranslations(locale) {
|
|
|
10
9
|
return {};
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
|
-
export const useTranslationServerMiddleware = async (event, currentLocale) => {
|
|
12
|
+
export const useTranslationServerMiddleware = async (event, defaultLocale, currentLocale) => {
|
|
14
13
|
const { getTranslation, loadTranslations, hasGeneralTranslation } = useTranslationHelper();
|
|
15
14
|
const locale = (currentLocale || event.context.params?.locale || getQuery(event)?.locale || getCookie(event, "user-locale") || event.headers.get("accept-language")?.split(",")[0] || defaultLocale || "en").toString();
|
|
16
15
|
if (!hasGeneralTranslation(locale)) {
|
package/internals.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.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",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"166e9332-75a4-41da-96ec-b2e17e8c07d9","timestamp":1733171878036,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|