1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| import Vue from "vue"; import Vuetify from "vuetify/lib"; import VueI18n from "vue-i18n";
Vue.use(Vuetify); Vue.use(VueI18n);
import zhHans from "vuetify/es5/locale/zh-Hans"; import ja from "vuetify/es5/locale/ja";
const zhHansUser = { ...zhHans, hello: "你好", $vuetify: { hello: "你好", }, }; const jaUser = { ...ja, hello: "こんにちは", $vuetify: { hello: "こんにちは", }, };
const i18n = new VueI18n({ locale: "zhHans", messages: { zhHans: zhHansUser, ja: jaUser, }, });
const vuetify = new Vuetify({ lang: { t: (key, ...params) => i18n.t(key, params), }, }); const app = new Vue({ vuetify, i18n, }).$mount("#app");
|