Add an event hook after i18n loaded
This commit is contained in:
parent
b5ee28e60a
commit
0c858cb6c3
|
|
@ -1,4 +1,5 @@
|
||||||
import elementLocale from 'element-ui/lib/locale'
|
import elementLocale from 'element-ui/lib/locale'
|
||||||
|
import { emit } from './event'
|
||||||
|
|
||||||
const langs = {
|
const langs = {
|
||||||
en: {
|
en: {
|
||||||
|
|
@ -17,6 +18,7 @@ async function load(language) {
|
||||||
(async () => {
|
(async () => {
|
||||||
const text = await loadBS()
|
const text = await loadBS()
|
||||||
blessing.i18n = Object.assign(blessing.i18n || Object.create(null), text)
|
blessing.i18n = Object.assign(blessing.i18n || Object.create(null), text)
|
||||||
|
emit('i18nLoaded', blessing.i18n)
|
||||||
})(),
|
})(),
|
||||||
(async () => {
|
(async () => {
|
||||||
elementLocale.use((await loadElement()).default)
|
elementLocale.use((await loadElement()).default)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user