nuxt-i18n-micro 1.29.0 → 1.29.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/{CtNJ_juG.js → 0GmYR_kR.js} +1 -1
- package/dist/client/_nuxt/{CKE-slgQ.js → 2C6ahHCU.js} +1 -1
- package/dist/client/_nuxt/{B3qz2zap.js → BfH8Q6Ot.js} +1 -1
- package/dist/client/_nuxt/Czi4MokJ.js +98 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c6bfb7b0-9919-40d4-b4ae-cc005b332740.json +1 -0
- package/dist/client/index.html +6 -6
- package/dist/module.d.mts +1 -0
- package/dist/module.d.ts +1 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/i18n-link.vue +2 -1
- package/dist/runtime/components/i18n-switcher.vue +2 -1
- package/dist/runtime/components/i18n-t.vue +5 -4
- package/dist/runtime/components/i18n-t.vue.d.ts +1 -1
- package/dist/runtime/composables/useLocaleHead.js +1 -1
- package/dist/runtime/plugins/01.plugin.js +4 -1
- package/dist/runtime/plugins/03.define.js +2 -2
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +2 -1
- package/dist/client/_nuxt/builds/meta/586a38c7-df12-4fac-ae0d-f67dd0448804.json +0 -1
- package/dist/client/_nuxt/mVL4Ag1z.js +0 -98
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"c6bfb7b0-9919-40d4-b4ae-cc005b332740","timestamp":1729513225644}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"c6bfb7b0-9919-40d4-b4ae-cc005b332740","timestamp":1729513225644,"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.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/Czi4MokJ.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/BfH8Q6Ot.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/0GmYR_kR.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/2C6ahHCU.js">
|
|
11
|
+
<script type="module" src="/__nuxt-i18n-micro/_nuxt/Czi4MokJ.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},1729513243725,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"c6bfb7b0-9919-40d4-b4ae-cc005b332740",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.d.mts
CHANGED
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
<script lang="ts" setup>
|
|
11
11
|
import type { RouteLocationRaw } from 'vue-router'
|
|
12
|
+
import type { PluginsInjections } from '../../runtime/plugins/01.plugin'
|
|
12
13
|
import { useNuxtApp, computed, useRoute, useRouter } from '#imports'
|
|
13
14
|
|
|
14
|
-
const { $localeRoute } = useNuxtApp()
|
|
15
|
+
const { $localeRoute } = useNuxtApp().$i18n as PluginsInjections
|
|
15
16
|
|
|
16
17
|
interface Props {
|
|
17
18
|
to: RouteLocationRaw | string
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
import { ref, computed } from 'vue'
|
|
41
41
|
import type { CSSProperties } from 'vue'
|
|
42
42
|
import type { Locale } from '../../types'
|
|
43
|
+
import type { PluginsInjections } from '../../runtime/plugins/01.plugin'
|
|
43
44
|
import { useNuxtApp } from '#app'
|
|
44
45
|
import { useRoute } from '#imports'
|
|
45
46
|
|
|
@@ -67,7 +68,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
67
68
|
customIconStyle: () => ({}),
|
|
68
69
|
})
|
|
69
70
|
|
|
70
|
-
const { $localeRoute, $getLocales, $getLocale, $getLocaleName } = useNuxtApp()
|
|
71
|
+
const { $localeRoute, $getLocales, $getLocale, $getLocaleName } = useNuxtApp().$i18n as PluginsInjections
|
|
71
72
|
const locales = ref($getLocales())
|
|
72
73
|
const currentLocale = computed(() => $getLocale())
|
|
73
74
|
const currentLocaleName = computed(() => $getLocaleName())
|
|
@@ -39,19 +39,20 @@ export default defineComponent({
|
|
|
39
39
|
setup(props, { slots, attrs }) {
|
|
40
40
|
return () => {
|
|
41
41
|
const options = {};
|
|
42
|
+
const { $getLocale, $t, $tc } = useNuxtApp().$i18n;
|
|
42
43
|
if (props.plural !== void 0) {
|
|
43
44
|
if (props.customPluralRule) {
|
|
44
45
|
return h(props.tag, { ...attrs, innerHTML: props.customPluralRule(
|
|
45
46
|
props.keypath,
|
|
46
47
|
Number.parseInt(props.plural.toString()),
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
$getLocale(),
|
|
49
|
+
$t
|
|
49
50
|
) });
|
|
50
51
|
} else {
|
|
51
|
-
return h(props.tag, { ...attrs, innerHTML:
|
|
52
|
+
return h(props.tag, { ...attrs, innerHTML: $tc(props.keypath, Number.parseInt(props.plural.toString())) });
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
|
-
const translation = (
|
|
55
|
+
const translation = ($t(props.keypath, { ...props.params, ...options }) ?? "").toString();
|
|
55
56
|
if (props.hideIfEmpty && !translation.trim()) {
|
|
56
57
|
return props.defaultValue ?? null;
|
|
57
58
|
}
|
|
@@ -67,8 +67,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
67
67
|
default: null;
|
|
68
68
|
};
|
|
69
69
|
}>> & Readonly<{}>, {
|
|
70
|
-
tag: string;
|
|
71
70
|
params: Record<string, string | number | boolean>;
|
|
71
|
+
tag: string;
|
|
72
72
|
defaultValue: string;
|
|
73
73
|
html: boolean;
|
|
74
74
|
hideIfEmpty: boolean;
|
|
@@ -8,7 +8,7 @@ export const useLocaleHead = ({ addDirAttribute = true, identifierAttribute = "i
|
|
|
8
8
|
});
|
|
9
9
|
function updateMeta() {
|
|
10
10
|
const { defaultLocale, includeDefaultLocaleRoute } = useRuntimeConfig().public.i18nConfig;
|
|
11
|
-
const { $getLocales, $getLocale } = useNuxtApp();
|
|
11
|
+
const { $getLocales, $getLocale } = useNuxtApp().$i18n;
|
|
12
12
|
const route = useRoute();
|
|
13
13
|
const locale = unref($getLocale());
|
|
14
14
|
const routeName = (route.name ?? "").toString();
|
|
@@ -290,7 +290,10 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
290
290
|
return i18nRouteParams.value;
|
|
291
291
|
}
|
|
292
292
|
};
|
|
293
|
-
provideData
|
|
293
|
+
const $provideData = Object.fromEntries(
|
|
294
|
+
Object.entries(provideData).map(([key, value]) => [`$${key}`, value])
|
|
295
|
+
);
|
|
296
|
+
provideData.i18n = { ...provideData, ...$provideData };
|
|
294
297
|
return {
|
|
295
298
|
provide: provideData
|
|
296
299
|
};
|
|
@@ -53,8 +53,8 @@ export default defineNuxtPlugin(async (_nuxtApp) => {
|
|
|
53
53
|
if (Object.values(normalizedLocales).length) {
|
|
54
54
|
if (normalizedLocales[currentLocale]) {
|
|
55
55
|
const translation = normalizedLocales[currentLocale];
|
|
56
|
-
const
|
|
57
|
-
|
|
56
|
+
const { $mergeTranslations } = useNuxtApp().$i18n;
|
|
57
|
+
$mergeTranslations(translation);
|
|
58
58
|
}
|
|
59
59
|
if (!normalizedLocales[currentLocale]) {
|
|
60
60
|
let defaultRouteName = route.name?.toString().replace("localized-", "").replace(new RegExp(`-${currentLocale}$`), "");
|
package/dist/types.d.mts
CHANGED
|
@@ -4,4 +4,4 @@ declare module '@nuxt/schema' {
|
|
|
4
4
|
interface NuxtHooks extends ModuleHooks {}
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export { type
|
|
7
|
+
export { type PluginsInjections } from './module.js'
|
package/dist/types.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ declare module '@nuxt/schema' {
|
|
|
4
4
|
interface NuxtHooks extends ModuleHooks {}
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export { type
|
|
7
|
+
export { type PluginsInjections } from './module'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.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",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"client:build": "nuxi generate client",
|
|
54
54
|
"client:dev": "nuxi dev client --port 3300",
|
|
55
55
|
"typecheck": "tsc --noEmit",
|
|
56
|
+
"typecheck:nuxt": "nuxt typecheck --no-emit",
|
|
56
57
|
"docs:dev": "vitepress dev docs",
|
|
57
58
|
"docs:build": "vitepress build docs",
|
|
58
59
|
"docs:serve": "vitepress serve docs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"586a38c7-df12-4fac-ae0d-f67dd0448804","timestamp":1729326546192,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|