nuxt-i18n-micro 1.81.0 → 1.83.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/8ca6bd8f-ef82-4332-a5b1-4a2144fc0d82.json +1 -0
- package/dist/client/index.html +2 -2
- package/dist/module.json +1 -1
- package/dist/runtime/components/i18n-group.vue +6 -3
- package/dist/runtime/components/i18n-t.vue +4 -2
- package/dist/runtime/plugins/01.plugin.d.ts +2 -2
- package/dist/runtime/plugins/01.plugin.js +5 -2
- package/package.json +3 -3
- package/dist/client/_nuxt/builds/meta/cb71af6c-35bf-4233-98f2-bda40f06f17a.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/BBbCCCx2.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BRj5A2lo.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CfVvufsh.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/MjlAM4Ld.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/MjlAM4Ld.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},1743403362286,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"8ca6bd8f-ef82-4332-a5b1-4a2144fc0d82",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/BBbCCCx2.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BRj5A2lo.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CfVvufsh.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/MjlAM4Ld.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/MjlAM4Ld.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},1743403362286,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"8ca6bd8f-ef82-4332-a5b1-4a2144fc0d82",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"8ca6bd8f-ef82-4332-a5b1-4a2144fc0d82","timestamp":1743403356798}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"8ca6bd8f-ef82-4332-a5b1-4a2144fc0d82","timestamp":1743403356798,"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/BBbCCCx2.js">
|
|
9
9
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.BRj5A2lo.css">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CfVvufsh.js">
|
|
11
|
-
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/MjlAM4Ld.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/MjlAM4Ld.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},1743403362286,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"8ca6bd8f-ef82-4332-a5b1-4a2144fc0d82",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
|
@@ -8,13 +8,16 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script setup>
|
|
11
|
-
import {
|
|
11
|
+
import { useNuxtApp, useRoute } from '#imports'
|
|
12
12
|
|
|
13
13
|
const props = defineProps({
|
|
14
14
|
prefix: { type: String, required: true },
|
|
15
15
|
groupClass: { type: String, default: '' },
|
|
16
16
|
})
|
|
17
17
|
|
|
18
|
-
const {
|
|
19
|
-
const
|
|
18
|
+
const { $_t } = useNuxtApp()
|
|
19
|
+
const route = useRoute()
|
|
20
|
+
const $t = $_t(route)
|
|
21
|
+
|
|
22
|
+
const translate = (key, params = {}) => $t(`${props.prefix}.${key}`, params)
|
|
20
23
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { h, defineComponent } from "vue";
|
|
3
|
-
import { useNuxtApp } from "#imports";
|
|
3
|
+
import { useNuxtApp, useRoute } from "#imports";
|
|
4
4
|
export default defineComponent({
|
|
5
5
|
name: "I18nT",
|
|
6
6
|
props: {
|
|
@@ -48,7 +48,9 @@ export default defineComponent({
|
|
|
48
48
|
setup(props, { slots, attrs }) {
|
|
49
49
|
return () => {
|
|
50
50
|
const options = {};
|
|
51
|
-
const { $getLocale, $
|
|
51
|
+
const { $getLocale, $_t, $tc, $tn, $td, $tdr } = useNuxtApp();
|
|
52
|
+
const route = useRoute();
|
|
53
|
+
const $t = $_t(route);
|
|
52
54
|
if (props.number !== void 0) {
|
|
53
55
|
const numberValue = Number(props.number);
|
|
54
56
|
return h(props.tag, { ...attrs, innerHTML: $t(props.keypath, { number: $tn(numberValue) }) });
|
|
@@ -16,7 +16,7 @@ declare const _default: import("nuxt/app").Plugin<{
|
|
|
16
16
|
tn: (value: number, options?: Intl.NumberFormatOptions) => string;
|
|
17
17
|
td: (value: Date | number | string, options?: Intl.DateTimeFormatOptions) => string;
|
|
18
18
|
tdr: (value: Date | number | string, options?: Intl.RelativeTimeFormatOptions) => string;
|
|
19
|
-
has: (key: string) => boolean;
|
|
19
|
+
has: (key: string, route?: RouteLocationNormalizedLoaded) => boolean;
|
|
20
20
|
mergeTranslations: (newTranslations: Translations) => void;
|
|
21
21
|
mergeGlobalTranslations: (newTranslations: Translations) => void;
|
|
22
22
|
switchLocaleRoute: (toLocale: string) => string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
@@ -43,7 +43,7 @@ declare const _default: import("nuxt/app").Plugin<{
|
|
|
43
43
|
tn: (value: number, options?: Intl.NumberFormatOptions) => string;
|
|
44
44
|
td: (value: Date | number | string, options?: Intl.DateTimeFormatOptions) => string;
|
|
45
45
|
tdr: (value: Date | number | string, options?: Intl.RelativeTimeFormatOptions) => string;
|
|
46
|
-
has: (key: string) => boolean;
|
|
46
|
+
has: (key: string, route?: RouteLocationNormalizedLoaded) => boolean;
|
|
47
47
|
mergeTranslations: (newTranslations: Translations) => void;
|
|
48
48
|
mergeGlobalTranslations: (newTranslations: Translations) => void;
|
|
49
49
|
switchLocaleRoute: (toLocale: string) => string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
@@ -151,8 +151,11 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
151
151
|
const currentLocale = routeService.getCurrentLocale();
|
|
152
152
|
return translationService.formatRelativeTime(value, currentLocale, options);
|
|
153
153
|
},
|
|
154
|
-
has: (key) => {
|
|
155
|
-
|
|
154
|
+
has: (key, route) => {
|
|
155
|
+
route = route ?? routeService.getCurrentRoute();
|
|
156
|
+
const locale = routeService.getCurrentLocale();
|
|
157
|
+
const routeName = routeService.getRouteName(route, locale);
|
|
158
|
+
return !!i18nHelper.getTranslation(locale, routeName, key);
|
|
156
159
|
},
|
|
157
160
|
mergeTranslations: (newTranslations) => {
|
|
158
161
|
const route = routeService.getCurrentRoute();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.83.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",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"sirv": "^2.0.4",
|
|
61
61
|
"ufo": "^1.5.4",
|
|
62
62
|
"nuxt-i18n-micro-core": "1.0.18",
|
|
63
|
-
"nuxt-i18n-micro-
|
|
64
|
-
"nuxt-i18n-micro-
|
|
63
|
+
"nuxt-i18n-micro-types": "1.0.3",
|
|
64
|
+
"nuxt-i18n-micro-test-utils": "1.0.6"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@nuxt/devtools": "^2.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"cb71af6c-35bf-4233-98f2-bda40f06f17a","timestamp":1742713441576,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|