From 0c858cb6c37b714edc80f4a8682ca9a4ee05ddb7 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 1 May 2019 19:42:13 +0800 Subject: [PATCH] Add an event hook after i18n loaded --- resources/assets/src/scripts/i18n-text.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/assets/src/scripts/i18n-text.js b/resources/assets/src/scripts/i18n-text.js index a89f9eac..8e2ab070 100644 --- a/resources/assets/src/scripts/i18n-text.js +++ b/resources/assets/src/scripts/i18n-text.js @@ -1,4 +1,5 @@ import elementLocale from 'element-ui/lib/locale' +import { emit } from './event' const langs = { en: { @@ -17,6 +18,7 @@ async function load(language) { (async () => { const text = await loadBS() blessing.i18n = Object.assign(blessing.i18n || Object.create(null), text) + emit('i18nLoaded', blessing.i18n) })(), (async () => { elementLocale.use((await loadElement()).default)