[update ueditor] 切换语言

This commit is contained in:
danshihao
2024-08-02 15:05:00 +08:00
parent f197fabd95
commit 0ef8fad83c
3 changed files with 12 additions and 2 deletions
+10
View File
@@ -62,6 +62,16 @@ export default {
}
},
mounted () {
// 首次加载完所有语言包后,浅拷贝存备份(没有找到正常切换语言的api,暂时先这么处理)
if (Object.keys(UE.I18N).length > 1) {
window.__COPY_UE_I18N__ = { ...UE.I18N }
}
// 更新语言包(将备份语言包浅拷贝回来,只保留需要的一个需要的语言包)
if (localStorage.getItem('language') === 'en-us') {
UE.I18N = { en: window.__COPY_UE_I18N__.en }
} else {
UE.I18N = { ['zh-cn']: window.__COPY_UE_I18N__['zh-cn'] }
}
UEDITOR_CONFIG.UEDITOR_HOME_URL = '../../../public/ueditor/'
// 初始化UE
this.editor = UE.delEditor('editor')