nuxt-i18n-micro 3.29.4 → 3.29.5
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 +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/6385e487-b291-4cb4-8a64-ef47f393c2be.json +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/composables/useLocaleHead.js +18 -24
- package/dist/runtime/plugins/01.plugin.d.ts +8 -7
- package/dist/runtime/utils/nuxt-i18n.d.ts +6 -5
- package/dist/runtime/utils/nuxt-i18n.js +1 -1
- package/package.json +4 -4
- package/dist/client/_nuxt/builds/meta/7a8cab88-a568-460d-8a67-5955e9b3c5ff.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"6385e487-b291-4cb4-8a64-ef47f393c2be",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789398317458,false]</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"6385e487-b291-4cb4-8a64-ef47f393c2be",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789398317459,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"6385e487-b291-4cb4-8a64-ef47f393c2be","timestamp":1789398315001}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"6385e487-b291-4cb4-8a64-ef47f393c2be","timestamp":1789398315001,"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"}}</script><link rel="stylesheet" href="/__nuxt-i18n-micro/_nuxt/entry.CJGrD2VA.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BAu8wLxk.js"><script type="module" src="/__nuxt-i18n-micro/_nuxt/CZxMDymS.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-404.BRCCa7jH.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BlsWt_np.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/Bo5omLnI.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.C7JgQlK0.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CSbZDNyO.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"6385e487-b291-4cb4-8a64-ef47f393c2be",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789398317459,false]</script></body></html>
|
package/dist/module.json
CHANGED
|
@@ -5,6 +5,7 @@ import { resolveOgLocale, warnUnresolvedOgLocale } from "@i18n-micro/utils/resol
|
|
|
5
5
|
import { joinURL, parseURL, withQuery } from "ufo";
|
|
6
6
|
import { ref, unref, watch } from "vue";
|
|
7
7
|
import { useNuxtApp, useRoute, useState } from "#app";
|
|
8
|
+
import { applyTrailingSlash } from "../utils/trailing-slash.js";
|
|
8
9
|
export const useLocaleHead = ({
|
|
9
10
|
addDirAttribute = true,
|
|
10
11
|
identifierAttribute = "id",
|
|
@@ -75,23 +76,30 @@ export const useLocaleHead = ({
|
|
|
75
76
|
fullPath = `/${fullPath}`;
|
|
76
77
|
}
|
|
77
78
|
const whitelist = canonicalQueryWhitelist ?? [];
|
|
79
|
+
const trailingSlash = i18nConfig.trailingSlash;
|
|
80
|
+
const toSeoHref = (pathOrUrl) => {
|
|
81
|
+
if (!pathOrUrl) return "";
|
|
82
|
+
let href;
|
|
83
|
+
if (pathOrUrl.startsWith("http://") || pathOrUrl.startsWith("https://")) {
|
|
84
|
+
href = filterLocalizedHref(pathOrUrl, whitelist);
|
|
85
|
+
} else {
|
|
86
|
+
const filteredPath = filterLocalizedHref(pathOrUrl, whitelist);
|
|
87
|
+
href = joinURL(unref(baseUrl), filteredPath.startsWith("/") ? filteredPath : `/${filteredPath}`);
|
|
88
|
+
}
|
|
89
|
+
return applyTrailingSlash(href, trailingSlash);
|
|
90
|
+
};
|
|
78
91
|
const currentSwitchedPath = switchLocalePath(locale);
|
|
79
92
|
let ogUrl;
|
|
80
93
|
if (currentSwitchedPath) {
|
|
81
|
-
|
|
82
|
-
ogUrl = filterLocalizedHref(currentSwitchedPath, whitelist);
|
|
83
|
-
} else {
|
|
84
|
-
const filteredPath = filterLocalizedHref(currentSwitchedPath, whitelist);
|
|
85
|
-
ogUrl = joinURL(unref(baseUrl), filteredPath.startsWith("/") ? filteredPath : `/${filteredPath}`);
|
|
86
|
-
}
|
|
94
|
+
ogUrl = toSeoHref(currentSwitchedPath);
|
|
87
95
|
} else {
|
|
88
96
|
const matchedLocale = [...locales].sort((a, b) => b.code.length - a.code.length).find((localeItem) => fullPath.startsWith(`/${localeItem.code}`));
|
|
89
97
|
let localizedPath = fullPath;
|
|
90
98
|
if (routeName.startsWith(localizedRouteNamePrefixResolved) && matchedLocale) {
|
|
91
99
|
localizedPath = fullPath.slice(matchedLocale.code.length + 1);
|
|
92
|
-
ogUrl = joinURL(unref(baseUrl), locale, filterQuery(localizedPath, whitelist));
|
|
100
|
+
ogUrl = applyTrailingSlash(joinURL(unref(baseUrl), locale, filterQuery(localizedPath, whitelist)), trailingSlash);
|
|
93
101
|
} else {
|
|
94
|
-
ogUrl = joinURL(unref(baseUrl), filterQuery(fullPath, whitelist));
|
|
102
|
+
ogUrl = applyTrailingSlash(joinURL(unref(baseUrl), filterQuery(fullPath, whitelist)), trailingSlash);
|
|
95
103
|
}
|
|
96
104
|
}
|
|
97
105
|
const htmlAttrs = {
|
|
@@ -140,14 +148,7 @@ export const useLocaleHead = ({
|
|
|
140
148
|
for (const loc of localesForSeo) {
|
|
141
149
|
const switchedPath = switchLocalePath(loc.code);
|
|
142
150
|
if (!switchedPath) continue;
|
|
143
|
-
|
|
144
|
-
if (switchedPath.startsWith("http://") || switchedPath.startsWith("https://")) {
|
|
145
|
-
href = filterLocalizedHref(switchedPath, whitelist);
|
|
146
|
-
} else {
|
|
147
|
-
const filteredPath = filterLocalizedHref(switchedPath, whitelist);
|
|
148
|
-
href = joinURL(unref(baseUrl), filteredPath.startsWith("/") ? filteredPath : `/${filteredPath}`);
|
|
149
|
-
}
|
|
150
|
-
hrefByCode.set(String(loc.code), href);
|
|
151
|
+
hrefByCode.set(String(loc.code), toSeoHref(switchedPath));
|
|
151
152
|
}
|
|
152
153
|
return resolveHreflangAlternates(localesForSeo, {
|
|
153
154
|
hreflangBaseLanguage: i18nConfig.hreflangBaseLanguage ?? false
|
|
@@ -168,17 +169,10 @@ export const useLocaleHead = ({
|
|
|
168
169
|
if (!isNoPrefixStrategy(strategy) && defaultLocaleObj?.seo !== false) {
|
|
169
170
|
const defaultSwitchedPath = switchLocalePath(defaultLocale);
|
|
170
171
|
if (defaultSwitchedPath) {
|
|
171
|
-
let xDefaultHref;
|
|
172
|
-
if (defaultSwitchedPath.startsWith("http://") || defaultSwitchedPath.startsWith("https://")) {
|
|
173
|
-
xDefaultHref = filterLocalizedHref(defaultSwitchedPath, whitelist);
|
|
174
|
-
} else {
|
|
175
|
-
const filteredPath = filterLocalizedHref(defaultSwitchedPath, whitelist);
|
|
176
|
-
xDefaultHref = joinURL(unref(baseUrl), filteredPath.startsWith("/") ? filteredPath : `/${filteredPath}`);
|
|
177
|
-
}
|
|
178
172
|
xDefaultLink = {
|
|
179
173
|
[identifierAttribute]: "i18n-xd",
|
|
180
174
|
rel: "alternate",
|
|
181
|
-
href:
|
|
175
|
+
href: toSeoHref(defaultSwitchedPath),
|
|
182
176
|
hreflang: "x-default"
|
|
183
177
|
};
|
|
184
178
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PathStrategy } from '@i18n-micro/path-strategy';
|
|
2
2
|
import type { CleanTranslation, DefineI18nRouteConfig, I18nRouteParams, Locale, MissingHandler, ModuleOptionsExtend, Params, Translations, TranslationKey } from '@i18n-micro/types';
|
|
3
3
|
import type { RouteLocationNamedRaw, RouteLocationNormalizedLoaded, RouteLocationRaw, RouteLocationResolved, RouteLocationResolvedGeneric } from 'vue-router';
|
|
4
|
+
import { type TranslationFn } from '../utils/nuxt-i18n.js';
|
|
5
|
+
export type { TranslationFn };
|
|
4
6
|
declare const _default: import("nuxt/app").Plugin<{
|
|
5
7
|
getI18nConfig: () => ModuleOptionsExtend;
|
|
6
8
|
helper: {
|
|
@@ -15,9 +17,9 @@ declare const _default: import("nuxt/app").Plugin<{
|
|
|
15
17
|
getLocales: () => Locale[];
|
|
16
18
|
getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
|
|
17
19
|
t: (key: TranslationKey, params?: Params, defaultValue?: string | null, routeContext?: unknown) => CleanTranslation;
|
|
18
|
-
ts: (key:
|
|
19
|
-
_t: (route: RouteLocationNormalizedLoaded) =>
|
|
20
|
-
_ts: (route: RouteLocationNormalizedLoaded) =>
|
|
20
|
+
ts: (key: TranslationKey, params?: Params, defaultValue?: string, route?: RouteLocationNormalizedLoaded) => string;
|
|
21
|
+
_t: (route: RouteLocationNormalizedLoaded) => TranslationFn<CleanTranslation>;
|
|
22
|
+
_ts: (route: RouteLocationNormalizedLoaded) => TranslationFn<string>;
|
|
21
23
|
tc: (key: TranslationKey, count: number | Params, defaultValue?: string) => string;
|
|
22
24
|
tn: {
|
|
23
25
|
(value: number, options?: Intl.NumberFormatOptions): string;
|
|
@@ -58,9 +60,9 @@ declare const _default: import("nuxt/app").Plugin<{
|
|
|
58
60
|
getLocales: () => Locale[];
|
|
59
61
|
getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
|
|
60
62
|
t: (key: TranslationKey, params?: Params, defaultValue?: string | null, routeContext?: unknown) => CleanTranslation;
|
|
61
|
-
ts: (key:
|
|
62
|
-
_t: (route: RouteLocationNormalizedLoaded) =>
|
|
63
|
-
_ts: (route: RouteLocationNormalizedLoaded) =>
|
|
63
|
+
ts: (key: TranslationKey, params?: Params, defaultValue?: string, route?: RouteLocationNormalizedLoaded) => string;
|
|
64
|
+
_t: (route: RouteLocationNormalizedLoaded) => TranslationFn<CleanTranslation>;
|
|
65
|
+
_ts: (route: RouteLocationNormalizedLoaded) => TranslationFn<string>;
|
|
64
66
|
tc: (key: TranslationKey, count: number | Params, defaultValue?: string) => string;
|
|
65
67
|
tn: {
|
|
66
68
|
(value: number, options?: Intl.NumberFormatOptions): string;
|
|
@@ -89,7 +91,6 @@ declare const _default: import("nuxt/app").Plugin<{
|
|
|
89
91
|
setMissingHandler: (handler: MissingHandler | null) => void;
|
|
90
92
|
}>;
|
|
91
93
|
export default _default;
|
|
92
|
-
export type TranslationFn<T extends CleanTranslation> = (key: TranslationKey, params?: Params, defaultValue?: string | null) => T;
|
|
93
94
|
export interface PluginsInjections {
|
|
94
95
|
/** The active routing strategy, resolving locales to and from paths. */
|
|
95
96
|
$i18nStrategy: PathStrategy;
|
|
@@ -4,6 +4,7 @@ import type { CleanTranslation, I18nRouteParams, MissingHandler, ModuleOptionsEx
|
|
|
4
4
|
import type { RouteLocationNamedRaw, RouteLocationNormalizedLoaded, RouteLocationRaw, RouteLocationResolved, RouteLocationResolvedGeneric, Router } from 'vue-router';
|
|
5
5
|
import type { GetLocaleFromRoute } from '../composables/useI18nLocale.js';
|
|
6
6
|
import { type LoadOptions } from './storage.js';
|
|
7
|
+
export type TranslationFn<T extends CleanTranslation> = (key: TranslationKey, params?: Params, defaultValue?: string | null) => T;
|
|
7
8
|
export interface RouteTranslationContext {
|
|
8
9
|
locale: string;
|
|
9
10
|
routeName: string;
|
|
@@ -86,8 +87,8 @@ export declare class NuxtI18n extends BaseI18n {
|
|
|
86
87
|
mergeTranslations(newTranslations: Translations): void;
|
|
87
88
|
loadPageTranslations(locale: string, routeName: string, translations: Translations): Promise<void>;
|
|
88
89
|
mergeTranslationAsync(locale: string, routeName: string, newTranslations: Translations, loadIfMissing: LoadTranslationsChunk): Promise<void>;
|
|
89
|
-
tForRoute(route: unknown):
|
|
90
|
-
tsForRoute(route: unknown):
|
|
90
|
+
tForRoute(route: unknown): TranslationFn<CleanTranslation>;
|
|
91
|
+
tsForRoute(route: unknown): TranslationFn<string>;
|
|
91
92
|
protected touch(): void;
|
|
92
93
|
protected resolveLookup(key: TranslationKey, routeContext?: unknown): unknown | null;
|
|
93
94
|
protected resolveHas(key: TranslationKey): boolean;
|
|
@@ -174,9 +175,9 @@ export declare function createNuxtI18nPluginApi(deps: NuxtI18nPluginApiDeps): {
|
|
|
174
175
|
getLocales: () => import("@i18n-micro/types").Locale[];
|
|
175
176
|
getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
|
|
176
177
|
t: (key: TranslationKey, params?: Params, defaultValue?: string | null, routeContext?: unknown) => CleanTranslation;
|
|
177
|
-
ts: (key:
|
|
178
|
-
_t: (route: RouteLocationNormalizedLoaded) =>
|
|
179
|
-
_ts: (route: RouteLocationNormalizedLoaded) =>
|
|
178
|
+
ts: (key: TranslationKey, params?: Params, defaultValue?: string, route?: RouteLocationNormalizedLoaded) => string;
|
|
179
|
+
_t: (route: RouteLocationNormalizedLoaded) => TranslationFn<CleanTranslation>;
|
|
180
|
+
_ts: (route: RouteLocationNormalizedLoaded) => TranslationFn<string>;
|
|
180
181
|
tc: (key: TranslationKey, count: number | Params, defaultValue?: string) => string;
|
|
181
182
|
tn: {
|
|
182
183
|
(value: number, options?: Intl.NumberFormatOptions): string;
|
|
@@ -215,7 +215,7 @@ export class NuxtI18n extends BaseI18n {
|
|
|
215
215
|
return (key, params, defaultValue) => this.t(key, params, defaultValue, route);
|
|
216
216
|
}
|
|
217
217
|
tsForRoute(route) {
|
|
218
|
-
return (key, params, defaultValue) => this.ts(key, params, defaultValue, route);
|
|
218
|
+
return (key, params, defaultValue) => this.ts(key, params, defaultValue ?? void 0, route);
|
|
219
219
|
}
|
|
220
220
|
touch() {
|
|
221
221
|
this.contextSignal.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "3.29.
|
|
3
|
+
"version": "3.29.5",
|
|
4
4
|
"description": "Fast, lightweight i18n for Nuxt with strategy-based routing and minimal overhead.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -83,12 +83,12 @@
|
|
|
83
83
|
"ufo": "^1.6.4",
|
|
84
84
|
"unplugin": "^1.16.1 || ^2.0.0 || ^3.3.0",
|
|
85
85
|
"@i18n-micro/hmr": "^1.0.15",
|
|
86
|
-
"@i18n-micro/core": "^1.3.18",
|
|
87
|
-
"@i18n-micro/path-strategy": "^1.3.17",
|
|
88
86
|
"@i18n-micro/test-utils": "^1.2.15",
|
|
89
87
|
"@i18n-micro/route-strategy": "^1.1.25",
|
|
88
|
+
"@i18n-micro/path-strategy": "^1.3.17",
|
|
90
89
|
"@i18n-micro/types": "^1.2.15",
|
|
91
|
-
"@i18n-micro/utils": "^1.0.23"
|
|
90
|
+
"@i18n-micro/utils": "^1.0.23",
|
|
91
|
+
"@i18n-micro/core": "^1.3.18"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@nuxt/devtools": "^3.4.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"7a8cab88-a568-460d-8a67-5955e9b3c5ff","timestamp":1789393262923,"prerendered":[]}
|