nuxt-i18n-micro 1.28.0 → 1.29.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 +6 -6
- package/dist/client/404.html +6 -6
- package/dist/client/_nuxt/{BfH8Q6Ot.js → B3qz2zap.js} +1 -1
- package/dist/client/_nuxt/{2C6ahHCU.js → CKE-slgQ.js} +1 -1
- package/dist/client/_nuxt/{0GmYR_kR.js → CtNJ_juG.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/586a38c7-df12-4fac-ae0d-f67dd0448804.json +1 -0
- package/dist/client/_nuxt/mVL4Ag1z.js +98 -0
- package/dist/client/index.html +6 -6
- package/dist/module.json +1 -1
- package/dist/runtime/plugins/01.plugin.d.ts +1 -1
- package/dist/runtime/plugins/01.plugin.js +4 -10
- package/package.json +1 -1
- package/dist/client/_nuxt/Czi4MokJ.js +0 -98
- package/dist/client/_nuxt/builds/meta/be20711c-09b4-4275-a779-8234f5aad9c8.json +0 -1
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.BqOlM4b6.css">
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/mVL4Ag1z.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.C_4C5G96.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/B3qz2zap.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CtNJ_juG.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.CBAEdpZV.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/CKE-slgQ.js">
|
|
11
|
+
<script type="module" src="/__nuxt-i18n-micro/_nuxt/mVL4Ag1z.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},1729326556734,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"586a38c7-df12-4fac-ae0d-f67dd0448804",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
|
@@ -57,7 +57,7 @@ declare const _default: import("#app").Plugin<{
|
|
|
57
57
|
export default _default;
|
|
58
58
|
export interface PluginsInjections {
|
|
59
59
|
$getLocale: () => string;
|
|
60
|
-
$getLocaleName: () => string;
|
|
60
|
+
$getLocaleName: () => string | null;
|
|
61
61
|
$getLocales: () => Locale[];
|
|
62
62
|
$defaultLocale: () => string | undefined;
|
|
63
63
|
$getRouteName: (route?: RouteLocationNormalizedLoaded | RouteLocationResolvedGeneric, locale?: string) => string;
|
|
@@ -17,18 +17,12 @@ function getCurrentLocale(route, i18nConfig, hashLocale) {
|
|
|
17
17
|
return (route.params?.locale ?? i18nConfig.defaultLocale).toString();
|
|
18
18
|
}
|
|
19
19
|
function getCurrentName(route, i18nConfig, hashLocale) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} else if (route.params?.locale) {
|
|
24
|
-
currentLocale = (route.params?.locale ?? i18nConfig.defaultLocale).toString();
|
|
25
|
-
}
|
|
26
|
-
const checkLocale = i18nConfig.locales?.find((l) => l.code === currentLocale);
|
|
27
|
-
if (!checkLocale || !checkLocale.displayName) {
|
|
28
|
-
console.warn(`current locale name not found`);
|
|
20
|
+
const currentLocaleCode = getCurrentLocale(route, i18nConfig, hashLocale);
|
|
21
|
+
const checkLocale = i18nConfig.locales?.find((l) => l.code === currentLocaleCode);
|
|
22
|
+
if (!checkLocale) {
|
|
29
23
|
return null;
|
|
30
24
|
}
|
|
31
|
-
return checkLocale
|
|
25
|
+
return checkLocale?.displayName ?? null;
|
|
32
26
|
}
|
|
33
27
|
function getRouteName(route, locale) {
|
|
34
28
|
return (route?.name ?? "").toString().replace("localized-", "").replace(new RegExp(`-${locale}$`), "");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.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",
|