add i18n
This commit is contained in:
1 parent
59728e46b3
commit
69fdb3a933
6 files changed
+126
-4
No files matched your search
@@ -0,0 +1,16 @@
|
||||
export default {
|
||||
message: {
|
||||
copied: 'Copied'
|
||||
},
|
||||
menu: {
|
||||
home: 'Home',
|
||||
editor: 'Editor'
|
||||
},
|
||||
option: {
|
||||
theme: 'Theme',
|
||||
highlight: 'Code Highlight Theme',
|
||||
bold: 'Bold',
|
||||
italic: 'Italic',
|
||||
strikeout: 'Strikeout'
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
import enLang from './en/index';
|
||||
import zhLang from './zh/index';
|
||||
import enLocale from 'element-plus/lib/locale/lang/en';
|
||||
import zhLocale from 'element-plus/lib/locale/lang/zh-cn';
|
||||
import { createI18n } from 'vue-i18n';
|
||||
|
||||
const i18n = createI18n({
|
||||
locale: zhLocale.name,
|
||||
fallbackLocale: enLocale.name,
|
||||
messages: {
|
||||
[enLocale.name]: {
|
||||
el: enLocale.el,
|
||||
...enLang
|
||||
},
|
||||
[zhLocale.name]: {
|
||||
el: zhLocale.el,
|
||||
...zhLang
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
@@ -0,0 +1,16 @@
|
||||
export default {
|
||||
message: {
|
||||
copied: '复制成功'
|
||||
},
|
||||
menu: {
|
||||
home: '首页',
|
||||
editor: '编辑器'
|
||||
},
|
||||
option: {
|
||||
theme: '主题',
|
||||
highlight: '代码高亮',
|
||||
bold: '粗体',
|
||||
italic: '斜体',
|
||||
strikeout: '删除线'
|
||||
}
|
||||
};
|
||||
+3
-2
@@ -1,9 +1,10 @@
|
||||
import { createApp } from 'vue';
|
||||
import App from './App.vue';
|
||||
import './style.css';
|
||||
import router from './router/index';
|
||||
import store from './store/index';
|
||||
import ElementPlus from 'element-plus';
|
||||
import i18n from './i18n/index';
|
||||
import './style.css';
|
||||
import 'element-plus/dist/index.css';
|
||||
|
||||
createApp(App).use(router).use(store).use(ElementPlus).mount('#app');
|
||||
createApp(App).use(router).use(store).use(ElementPlus).use(i18n).mount('#app');
|
||||
Reference in new issue
Block a user