nuxt-i18n-micro 1.35.2 → 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/{DNen4El9.js → B-rdPz5C.js} +1 -1
- package/dist/client/_nuxt/{Ltm7XuUs.js → BSIK_tlD.js} +1 -1
- package/dist/client/_nuxt/{CBccCxXK.js → Bg-EgkMt.js} +1 -1
- package/dist/client/_nuxt/Bi0F1qle.js +3822 -0
- 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 +0 -5
- package/dist/runtime/translation-server-middleware.d.ts +1 -1
- package/dist/runtime/translation-server-middleware.js +2 -4
- package/internals.d.ts +0 -4
- package/package.json +1 -1
- package/dist/client/_nuxt/builds/meta/361690fb-dda2-4625-ada4-56dce4fbda5a.json +0 -1
- package/dist/client/_nuxt/n4MbYZHF.js +0 -3822
|
@@ -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
|
@@ -453,11 +453,6 @@ const module = defineNuxtModule({
|
|
|
453
453
|
write: true,
|
|
454
454
|
getContents: () => `export const plural = ${options.plural.toString()};`
|
|
455
455
|
});
|
|
456
|
-
addTemplate({
|
|
457
|
-
filename: "i18n.config.mjs",
|
|
458
|
-
write: true,
|
|
459
|
-
getContents: () => `export const defaultLocale = "${options.defaultLocale}";`
|
|
460
|
-
});
|
|
461
456
|
const apiBaseUrl = (process.env.NUXT_I18N_APP_BASE_URL ?? options.apiBaseUrl ?? "_locales").replace(/^\/+|\/+$|\/{2,}/, "");
|
|
462
457
|
nuxt.options.runtimeConfig.public.i18nConfig = {
|
|
463
458
|
plural: void 0,
|
|
@@ -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 { useRuntimeConfig } from "#imports";
|
|
4
3
|
async function fetchTranslations(locale) {
|
|
5
4
|
try {
|
|
6
5
|
const translations = await $fetch(`/_locales/general/${locale}/data.json`);
|
|
@@ -10,10 +9,9 @@ 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
|
-
const
|
|
16
|
-
const locale = (currentLocale || event.context.params?.locale || getQuery(event)?.locale || getCookie(event, "user-locale") || event.headers.get("accept-language")?.split(",")[0] || runtimeI18n.defaultLocale || "en").toString();
|
|
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();
|
|
17
15
|
if (!hasGeneralTranslation(locale)) {
|
|
18
16
|
const translations = await fetchTranslations(locale);
|
|
19
17
|
await loadTranslations(locale, translations);
|
package/internals.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
declare module '#build/i18n.plural.mjs' {
|
|
2
2
|
export function plural(key: string, count: number, params: Params, locale: string, getter: Getter): string | null
|
|
3
3
|
}
|
|
4
|
-
|
|
5
|
-
declare module '#internal/i18n/options.mjs' {
|
|
6
|
-
export function plural(key: string, count: number, params: Params, locale: string, getter: Getter): string | null
|
|
7
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.
|
|
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":"361690fb-dda2-4625-ada4-56dce4fbda5a","timestamp":1733170495986,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|