|
@@ -5,6 +5,8 @@ import E from 'wangeditor'
|
|
|
import createKityformula from "./kityformula";
|
|
|
import myscriptMath from "./myscript-math-web";
|
|
|
import { app } from '@/boot-app.js'
|
|
|
+import { editor_tw_config } from './editorLangTw.js'
|
|
|
+import i18next from 'i18next'
|
|
|
import {
|
|
|
Message,
|
|
|
Modal
|
|
@@ -17,11 +19,20 @@ import {
|
|
|
export default {
|
|
|
/* 初始化自定义富文本配置项 */
|
|
|
initMyEditor(editor,vm,isOption) {
|
|
|
+ let curLang = localStorage.getItem('local') || 'zh-cn'
|
|
|
+ // 自定义语言
|
|
|
+ editor.config.languages['tw'] = editor_tw_config
|
|
|
+ // 选择语言
|
|
|
+ editor.config.lang = curLang === 'zh-tw' ? 'tw' : curLang === 'en-us' ? 'en' : 'zh'
|
|
|
+ // 引入 i18next 插件
|
|
|
+ editor.i18next = i18next
|
|
|
+
|
|
|
// 初始化公式、视频、音频、画板功能
|
|
|
this.addFormula(vm,editor)
|
|
|
this.addVideoUpload(vm,editor)
|
|
|
this.addAudio(vm,editor)
|
|
|
this.addCanvas(vm,editor)
|
|
|
+
|
|
|
editor.config.uploadImgMaxSize = 2 * 1024 * 1024 // 2M
|
|
|
editor.config.uploadImgShowBase64 = true;
|
|
|
editor.config.uploadImgMaxLength = 5 // 一次最多上传 5 个图片
|
|
@@ -48,6 +59,13 @@ export default {
|
|
|
|
|
|
/* 初始化自定义富文本简版配置项 */
|
|
|
initSimpleEditor(editor) {
|
|
|
+ let curLang = localStorage.getItem('local') || 'zh-cn'
|
|
|
+ // 自定义语言
|
|
|
+ editor.config.languages['tw'] = editor_tw_config
|
|
|
+ // 选择语言
|
|
|
+ editor.config.lang = curLang === 'zh-tw' ? 'tw' : curLang === 'en-us' ? 'en' : 'zh'
|
|
|
+ // 引入 i18next 插件
|
|
|
+ editor.i18next = i18next
|
|
|
editor.config.uploadImgMaxSize = 2 * 1024 * 1024 // 2M
|
|
|
editor.config.uploadImgShowBase64 = true;
|
|
|
editor.config.uploadImgMaxLength = 5 // 一次最多上传 5 个图片
|