[update ueditor] 切换语言
This commit is contained in:
@@ -74,7 +74,7 @@ UE.I18N['en'] = {
|
||||
'jsonEncodeError': 'Server Return Format Error',
|
||||
'loading':"loading...",
|
||||
'loadError':"load error",
|
||||
'errorLoadConfig': 'Server config not loaded, upload can not work.',
|
||||
'errorLoadConfig': 'Cannot upload images by pasting or dragging.',
|
||||
},
|
||||
'simpleupload':{
|
||||
'exceedSizeError': 'File Size Exceed',
|
||||
|
||||
@@ -74,7 +74,7 @@ UE.I18N['zh-cn'] = {
|
||||
'jsonEncodeError': '服务器返回格式错误',
|
||||
'loading':"正在上传...",
|
||||
'loadError':"上传错误",
|
||||
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!'
|
||||
'errorLoadConfig': '不支持通过粘贴或拖拽上传图片!'
|
||||
},
|
||||
'simpleupload':{
|
||||
'exceedSizeError': '文件大小超出限制',
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user