File tree 4 files changed +16
-6
lines changed
4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ export default {
131
131
installed_templates .length === 0
132
132
? null
133
133
: {
134
- name: this .$tc (
134
+ name: this .$t (
135
135
" message.installed_template" ,
136
136
installed_templates .length ,
137
137
),
@@ -140,7 +140,7 @@ export default {
140
140
builtin_templates .length === 0
141
141
? null
142
142
: {
143
- name: this .$tc (
143
+ name: this .$t (
144
144
" message.builtin_template" ,
145
145
builtin_templates .length ,
146
146
),
@@ -149,14 +149,14 @@ export default {
149
149
customized_templates .length === 0
150
150
? null
151
151
: {
152
- name: this .$tc (
152
+ name: this .$t (
153
153
" message.customized_template" ,
154
154
customized_templates .length ,
155
155
),
156
156
sub: customized_templates,
157
157
},
158
158
{
159
- name: this .$tc (" message.setting" , 2 ),
159
+ name: this .$t (" message.setting" , 2 ),
160
160
sub: [
161
161
{
162
162
name: this .$t (" message.management" ),
Original file line number Diff line number Diff line change 1
1
import { createI18n } from "vue-i18n" ;
2
+ import { en , zhHans } from "vuetify/locale" ;
2
3
3
4
function loadLocaleMessages ( ) {
4
5
const locales = require . context (
@@ -14,10 +15,13 @@ function loadLocaleMessages() {
14
15
messages [ locale ] = locales ( key ) ;
15
16
}
16
17
} ) ;
18
+ messages [ "en" ] [ "$vuetify" ] = en ;
19
+ messages [ "zh" ] [ "$vuetify" ] = zhHans ;
17
20
return messages ;
18
21
}
19
22
20
23
export default createI18n ( {
24
+ legacy : false ,
21
25
locale :
22
26
process . env . VUE_APP_I18N_LOCALE || navigator . language . split ( "-" ) [ 0 ] || "en" ,
23
27
fallbackLocale : process . env . VUE_APP_I18N_FALLBACK_LOCALE || "en" ,
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ import "vuetify/styles";
2
2
import { createVuetify } from "vuetify" ;
3
3
import { aliases , fa } from "vuetify/iconsets/fa" ;
4
4
import "@fortawesome/fontawesome-free/css/all.css" ;
5
+ import { createVueI18nAdapter } from "vuetify/locale/adapters/vue-i18n" ;
6
+ import { useI18n } from "vue-i18n" ;
7
+ import i18n from "../i18n.js" ;
5
8
6
9
const vuetify = createVuetify ( {
7
10
components : { } ,
@@ -23,6 +26,9 @@ const vuetify = createVuetify({
23
26
} ,
24
27
} ,
25
28
} ,
29
+ locale : {
30
+ adapter : createVueI18nAdapter ( { i18n, useI18n } ) ,
31
+ } ,
26
32
} ) ;
27
33
28
34
export default vuetify ;
Original file line number Diff line number Diff line change 3
3
<v-data-table :headers =" headers" :items =" items" :items-per-page =" 10" >
4
4
<template #item .template =" { item } " >
5
5
<v-btn :to =" item.to" >
6
- {{ $tc ("message.template") }}
6
+ {{ $t ("message.template") }}
7
7
</v-btn >
8
8
</template >
9
9
<template #item .delete =" { item } " >
@@ -24,7 +24,7 @@ export default {
24
24
return {
25
25
headers: [
26
26
{ title: this .$t (" message.name" ), key: " name" },
27
- { title: this .$tc (" message.template" ), key: " template" },
27
+ { title: this .$t (" message.template" ), key: " template" },
28
28
{ title: this .$t (" message.delete" ), key: " delete" },
29
29
],
30
30
items: this .all_items (),
You can’t perform that action at this time.
0 commit comments