nuxt-i18n-micro 1.55.0 → 1.56.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.
- package/dist/client/200.html +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/2fa0562a-08ef-4fca-a540-4d449101e99b.json +1 -0
- package/dist/client/index.html +2 -2
- package/dist/module.json +1 -1
- package/dist/runtime/translation-server-middleware.d.ts +2 -1
- package/dist/runtime/translation-server-middleware.js +7 -4
- package/package.json +3 -3
- package/dist/client/_nuxt/builds/meta/af1dab1c-c3cf-4127-b3f8-8cfc1bb495ea.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -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},
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"
|
|
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>
|
package/dist/client/404.html
CHANGED
|
@@ -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},
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"
|
|
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>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"2fa0562a-08ef-4fca-a540-4d449101e99b","timestamp":1736233154031}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"2fa0562a-08ef-4fca-a540-4d449101e99b","timestamp":1736233154031,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -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},
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"
|
|
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>
|
package/dist/module.json
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { H3Event } from 'h3';
|
|
2
|
-
|
|
2
|
+
import type { Params } from '../types.js';
|
|
3
|
+
export declare const useTranslationServerMiddleware: (event: H3Event, defaultLocale?: string, currentLocale?: string) => Promise<(key: string, params?: Params, defaultValue?: string) => string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getQuery, getCookie } from "h3";
|
|
2
|
-
import { useTranslationHelper } from "nuxt-i18n-micro-core";
|
|
2
|
+
import { interpolate, useTranslationHelper } from "nuxt-i18n-micro-core";
|
|
3
3
|
async function fetchTranslations(locale) {
|
|
4
4
|
try {
|
|
5
5
|
const translations = await $fetch(`/_locales/general/${locale}/data.json`);
|
|
@@ -16,9 +16,12 @@ export const useTranslationServerMiddleware = async (event, defaultLocale, curre
|
|
|
16
16
|
const translations = await fetchTranslations(locale);
|
|
17
17
|
await loadTranslations(locale, translations);
|
|
18
18
|
}
|
|
19
|
-
function t(key) {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
function t(key, params, defaultValue) {
|
|
20
|
+
let translation = getTranslation(locale, "index", key);
|
|
21
|
+
if (!translation) {
|
|
22
|
+
translation = defaultValue || key;
|
|
23
|
+
}
|
|
24
|
+
return typeof translation === "string" && params ? interpolate(translation, params) : translation;
|
|
22
25
|
}
|
|
23
26
|
return t;
|
|
24
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.56.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",
|
|
@@ -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-
|
|
56
|
-
"nuxt-i18n-micro-
|
|
55
|
+
"nuxt-i18n-micro-core": "1.0.10",
|
|
56
|
+
"nuxt-i18n-micro-test-utils": "1.0.3"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/jest": "^29.5.14",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"af1dab1c-c3cf-4127-b3f8-8cfc1bb495ea","timestamp":1735902513062,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|