diff --git a/web/src/lang/en_us.js b/web/src/lang/en_us.js index 2e978e20..94fee6da 100644 --- a/web/src/lang/en_us.js +++ b/web/src/lang/en_us.js @@ -114,7 +114,8 @@ export default { 'If the download is not triggered, check whether it is blocked by the browser', paddingX: 'Padding x', paddingY: 'Padding y', - useMultiPageExport: 'Export multi page' + useMultiPageExport: 'Export multi page', + defaultFileName: 'Mind map' }, fullscreen: { fullscreenShow: 'Full screen show', @@ -123,7 +124,13 @@ export default { import: { title: 'Import', selectFile: 'Select file', - supportFile: 'Support .smm、.json、.xmind、.xlsx、.md file' + supportFile: 'Support .smm、.json、.xmind、.xlsx、.md file', + enableFileTip: 'Please select .smm、.json、.xmind、.xlsx、.md file', + maxFileNum: 'At most one file can be selected', + notSelectTip: 'Please select the file to import', + fileContentError: 'The file content is incorrect', + importSuccess: 'Import success', + fileParsingFailed: 'File parsing failed' }, navigatorToolbar: { openMiniMap: 'Open mini map', @@ -192,7 +199,15 @@ export default { vertical: 'Vertical' }, theme: { - title: 'Theme' + title: 'Theme', + classics: 'Classics', + dark: 'Darkness', + simple: 'Simple', + coverTip: + 'You have currently customized the basic style, do you want to overwrite it?', + tip: 'Tip', + cover: 'Cover', + reserve: 'Reserve' }, toolbar: { undo: 'Undo', @@ -219,12 +234,27 @@ export default { associativeLine: 'Associative line', painter: 'Painter', formula: 'Formula', - more: 'More' + more: 'More', + selectFileTip: 'Please select a file', + notSupportTip: + 'Your browser or network protocol does not support this feature', + tip: 'Tip', + editingLocalFileTipFront: 'Currently editing your local【', + editingLocalFileTipEnd: '】file', + fileContentError: 'File content error', + fileOpenFailed: 'File open failed', + defaultFileName: 'Mind map', + creatingTip: 'Creating file' }, edit: { newFeatureNoticeTitle: 'New feature reminder', newFeatureNoticeMessage: - 'This update supports node rich text editing, But there are some defects, The most important impact is that the time to export the image is proportional to the number of nodes, Therefore, if you are more dependent on export requirements, you can use【Base style】-【Other config】-【Enable node rich text editing】Set to turn off rich text editing mode.' + 'This update supports node rich text editing, But there are some defects, The most important impact is that the time to export the image is proportional to the number of nodes, Therefore, if you are more dependent on export requirements, you can use【Base style】-【Other config】-【Enable node rich text editing】Set to turn off rich text editing mode.', + root: 'Root node', + splitByWrap: 'Is automatically split nodes based on line breaks?', + tip: 'Tip', + yes: 'Yes', + no: 'No' }, mouseAction: { tip1: @@ -248,6 +278,21 @@ export default { title: 'Formula', placeholder: 'Please enter LaText syntax', confirm: 'Confirm', - common: 'Common formulas' + common: 'Common formulas', + tip: 'Inserting formulas is not supported in non rich text mode' + }, + richTextToolbar: { + bold: 'Bold', + italic: 'Italic', + underline: 'Underline', + strike: 'Strike', + fontFamily: 'Font family', + fontSize: 'Font size', + color: 'Color', + backgroundColor: 'Background color', + removeFormat: 'Clear Style' + }, + other: { + loading: 'Loading, please wait...' } } diff --git a/web/src/lang/zh_cn.js b/web/src/lang/zh_cn.js index 9cbe50a0..521b0c37 100644 --- a/web/src/lang/zh_cn.js +++ b/web/src/lang/zh_cn.js @@ -112,7 +112,8 @@ export default { notifyMessage: '如果没有触发下载,请检查是否被浏览器拦截了', paddingX: '水平内边距', paddingY: '垂直内边距', - useMultiPageExport: '是否多页导出' + useMultiPageExport: '是否多页导出', + defaultFileName: '思维导图' }, fullscreen: { fullscreenShow: '全屏查看', @@ -121,7 +122,13 @@ export default { import: { title: '导入', selectFile: '选取文件', - supportFile: '支持.smm、.json、.xmind、.xlsx、.md文件' + supportFile: '支持.smm、.json、.xmind、.xlsx、.md文件', + enableFileTip: '请选择.smm、.json、.xmind、.xlsx、.md文件', + maxFileNum: '最多只能选择一个文件', + notSelectTip: '请选择要导入的文件', + fileContentError: '文件内容有误', + importSuccess: '导入成功', + fileParsingFailed: '文件解析失败' }, navigatorToolbar: { openMiniMap: '开启小地图', @@ -190,7 +197,14 @@ export default { vertical: '垂直' }, theme: { - title: '主题' + title: '主题', + classics: '经典', + dark: '深色', + simple: '朴素', + coverTip: '你当前自定义过基础样式,是否覆盖?', + tip: '提示', + cover: '覆盖', + reserve: '保留' }, toolbar: { undo: '回退', @@ -217,12 +231,26 @@ export default { associativeLine: '关联线', painter: '格式刷', formula: '公式', - more: '更多' + more: '更多', + selectFileTip: '请选择文件', + notSupportTip: '你的浏览器或网络协议不支持该功能', + tip: '提示', + editingLocalFileTipFront: '当前正在编辑你本机的【', + editingLocalFileTipEnd: '】文件', + fileContentError: '文件内容有误', + fileOpenFailed: '文件打开失败', + defaultFileName: '思维导图', + creatingTip: '正在创建文件' }, edit: { newFeatureNoticeTitle: '新特性提醒', newFeatureNoticeMessage: - '本次更新支持了节点富文本编辑,但是存在一定缺陷,最主要的影响是导出为图片的时间和节点数量成正比,所以对导出需求比较依赖的话可以通过【基础样式】-【其他配置】-【是否开启节点富文本编辑】设置关掉富文本编辑模式。' + '本次更新支持了节点富文本编辑,但是存在一定缺陷,最主要的影响是导出为图片的时间和节点数量成正比,所以对导出需求比较依赖的话可以通过【基础样式】-【其他配置】-【是否开启节点富文本编辑】设置关掉富文本编辑模式。', + root: '根节点', + splitByWrap: '是否按换行自动分割节点?', + tip: '提示', + yes: '是', + no: '否' }, mouseAction: { tip1: '当前:左键拖动画布,右键框选节点', @@ -244,6 +272,21 @@ export default { title: '公式', placeholder: '请输入 LaText 语法', confirm: '完成', - common: '常用公式' + common: '常用公式', + tip: '非富文本模式下不支持插入公式' + }, + richTextToolbar: { + bold: '加粗', + italic: '斜体', + underline: '下划线', + strike: '删除线', + fontFamily: '字体', + fontSize: '字号', + color: '字体颜色', + backgroundColor: '背景颜色', + removeFormat: '清除样式' + }, + other: { + loading: '正在加载,请稍后...' } } diff --git a/web/src/pages/Edit/Index.vue b/web/src/pages/Edit/Index.vue index 60595d8f..c33dde73 100644 --- a/web/src/pages/Edit/Index.vue +++ b/web/src/pages/Edit/Index.vue @@ -43,7 +43,7 @@ export default { this.initLocalConfig() const loading = this.$loading({ lock: true, - text: '正在加载,请稍后...' + text: this.$t('other.loading') }) await this.getUserMindMapData() this.show = true diff --git a/web/src/pages/Edit/components/Contextmenu.vue b/web/src/pages/Edit/components/Contextmenu.vue index b1952dc8..c84157a6 100644 --- a/web/src/pages/Edit/components/Contextmenu.vue +++ b/web/src/pages/Edit/components/Contextmenu.vue @@ -11,7 +11,7 @@ @click="exec('INSERT_NODE', insertNodeBtnDisabled)" :class="{ disabled: insertNodeBtnDisabled }" > - {{ $t('contextmenu.insertSiblingNode') }} + {{ $t('contextmenu.insertSiblingNode') }} Enter
- {{ $t('contextmenu.insertChildNode') }} + {{ $t('contextmenu.insertChildNode') }} Tab
- {{ $t('contextmenu.insertParentNode') }} + {{ $t('contextmenu.insertParentNode') }} Shift + Tab
- {{ $t('contextmenu.insertSummary') }} + {{ $t('contextmenu.insertSummary') }} Ctrl + G
- {{ $t('contextmenu.moveUpNode') }} + {{ $t('contextmenu.moveUpNode') }} Ctrl + ↑
- {{ $t('contextmenu.moveDownNode') }} + {{ $t('contextmenu.moveDownNode') }} Ctrl + ↓
- {{ $t('contextmenu.deleteNode') }} + {{ $t('contextmenu.deleteNode') }} Delete
- {{ $t('contextmenu.deleteCurrentNode') }} + {{ $t('contextmenu.deleteCurrentNode') }} Shift + Backspace
- {{ $t('contextmenu.copyNode') }} + {{ $t('contextmenu.copyNode') }} Ctrl + C
- {{ $t('contextmenu.cutNode') }} + {{ $t('contextmenu.cutNode') }} Ctrl + X
- {{ $t('contextmenu.pasteNode') }} + {{ $t('contextmenu.pasteNode') }} Ctrl + V
- {{ $t('contextmenu.removeHyperlink') }} + {{ $t('contextmenu.removeHyperlink') }}
- {{ $t('contextmenu.removeNote') }} + {{ $t('contextmenu.removeNote') }}
@@ -403,8 +403,17 @@ export default { } } + .name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .desc { color: #999; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .subItems { diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index aa1641f1..4bcb2c64 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -275,7 +275,7 @@ export default { if (hasFileURL) { root = { data: { - text: '根节点' + text: this.$t('edit.root') }, children: [] } @@ -308,9 +308,9 @@ export default { enableAutoEnterTextEditWhenKeydown: true, customHandleClipboardText: handleClipboardText, handleIsSplitByWrapOnPasteCreateNewNode: () => { - return this.$confirm('是否按换行自动分割节点?', '提示', { - confirmButtonText: '是', - cancelButtonText: '否', + return this.$confirm(this.$t('edit.splitByWrap'), this.$t('edit.tip'), { + confirmButtonText: this.$t('edit.yes'), + cancelButtonText: this.$t('edit.no'), type: 'warning' }) } diff --git a/web/src/pages/Edit/components/Export.vue b/web/src/pages/Edit/components/Export.vue index 06552be4..4e99ab8d 100644 --- a/web/src/pages/Edit/components/Export.vue +++ b/web/src/pages/Edit/components/Export.vue @@ -101,7 +101,7 @@ export default { return { dialogVisible: false, exportType: 'smm', - fileName: '思维导图', + fileName: this.$t('export.defaultFileName'), widthConfig: true, isTransparent: false, loading: false, diff --git a/web/src/pages/Edit/components/FormulaSidebar.vue b/web/src/pages/Edit/components/FormulaSidebar.vue index bf95acac..53fd655f 100644 --- a/web/src/pages/Edit/components/FormulaSidebar.vue +++ b/web/src/pages/Edit/components/FormulaSidebar.vue @@ -89,14 +89,17 @@ export default { handleNodeActive(...args) { this.activeNodes = [...args[1]] - if (this.activeNodes.length <= 0 && this.activeSidebar === 'formulaSidebar') { + if ( + this.activeNodes.length <= 0 && + this.activeSidebar === 'formulaSidebar' + ) { this.setActiveSidebar(null) } }, confirm() { if (!this.localConfig.openNodeRichText) { - return this.$message.warning('非富文本模式下不支持插入公式') + return this.$message.warning(this.$t('formulaSidebar.tip')) } let str = this.formulaText.trim() if (!str) return diff --git a/web/src/pages/Edit/components/Import.vue b/web/src/pages/Edit/components/Import.vue index 1693ccbb..59761978 100644 --- a/web/src/pages/Edit/components/Import.vue +++ b/web/src/pages/Edit/components/Import.vue @@ -107,7 +107,7 @@ export default { onChange(file) { let reg = /\.(smm|xmind|json|xlsx|md)$/ if (!reg.test(file.name)) { - this.$message.error('请选择.smm、.json、.xmind、.xlsx、.md文件') + this.$message.error(this.$t('import.enableFileTip')) this.fileList = [] } else { this.fileList.push(file) @@ -120,7 +120,7 @@ export default { * @Desc: 数量超出限制 */ onExceed() { - this.$message.error('最多只能选择一个文件') + this.$message.error(this.$t('import.maxFileNum')) }, /** @@ -139,7 +139,7 @@ export default { */ confirm() { if (this.fileList.length <= 0) { - return this.$message.error('请选择要导入的文件') + return this.$message.error(this.$t('import.notSelectTip')) } this.$store.commit('setIsHandleLocalFile', false) let file = this.fileList[0] @@ -151,7 +151,7 @@ export default { this.handleExcel(file) } else if (/\.md$/.test(file.name)) { this.handleMd(file) - } + } this.cancel() }, @@ -167,13 +167,13 @@ export default { try { let data = JSON.parse(evt.target.result) if (typeof data !== 'object') { - throw new Error('文件内容有误') + throw new Error(this.$t('import.fileContentError')) } this.$bus.$emit('setData', data) - this.$message.success('导入成功') + this.$message.success(this.$t('import.importSuccess')) } catch (error) { console.log(error) - this.$message.error('文件解析失败') + this.$message.error(this.$t('import.fileParsingFailed')) } } }, @@ -187,10 +187,10 @@ export default { try { let data = await xmind.parseXmindFile(file.raw) this.$bus.$emit('setData', data) - this.$message.success('导入成功') + this.$message.success(this.$t('import.importSuccess')) } catch (error) { console.log(error) - this.$message.error('文件解析失败') + this.$message.error(this.$t('import.fileParsingFailed')) } }, @@ -254,10 +254,10 @@ export default { } } this.$bus.$emit('setData', layers[0][0]) - this.$message.success('导入成功') + this.$message.success(this.$t('import.importSuccess')) } catch (error) { console.log(error) - this.$message.error('文件解析失败') + this.$message.error(this.$t('import.fileParsingFailed')) } }, @@ -269,10 +269,10 @@ export default { try { let data = await markdown.transformMarkdownTo(evt.target.result) this.$bus.$emit('setData', data) - this.$message.success('导入成功') + this.$message.success(this.$t('import.importSuccess')) } catch (error) { console.log(error) - this.$message.error('文件解析失败') + this.$message.error(this.$t('import.fileParsingFailed')) } } } diff --git a/web/src/pages/Edit/components/RichTextToolbar.vue b/web/src/pages/Edit/components/RichTextToolbar.vue index 5c68679b..8773f7bd 100644 --- a/web/src/pages/Edit/components/RichTextToolbar.vue +++ b/web/src/pages/Edit/components/RichTextToolbar.vue @@ -7,13 +7,13 @@ @click.stop.passive v-show="showRichTextToolbar" > - +
- +
- +
- +
- +
- +
- +
@@ -92,7 +92,10 @@ - + - +
diff --git a/web/src/pages/Edit/components/Theme.vue b/web/src/pages/Edit/components/Theme.vue index f35b588a..23adcee3 100644 --- a/web/src/pages/Edit/components/Theme.vue +++ b/web/src/pages/Edit/components/Theme.vue @@ -122,17 +122,17 @@ export default { }) this.groupList = [ { - name: '经典', + name: this.$t('theme.classics'), list: classicsList }, { - name: '深色', + name: this.$t('theme.dark'), list: this.themeList.filter(item => { return item.dark }) }, { - name: '朴素', + name: this.$t('theme.simple'), list: baiduList } ] @@ -146,9 +146,9 @@ export default { const customThemeConfig = this.mindMap.getCustomThemeConfig() const hasCustomThemeConfig = Object.keys(customThemeConfig).length > 0 if (hasCustomThemeConfig) { - this.$confirm('你当前自定义过基础样式,是否覆盖?', '提示', { - confirmButtonText: '覆盖', - cancelButtonText: '保留', + this.$confirm(this.$t('theme.coverTip'), this.$t('theme.tip'), { + confirmButtonText: this.$t('theme.cover'), + cancelButtonText: this.$t('theme.reserve'), type: 'warning' }) .then(() => { diff --git a/web/src/pages/Edit/components/Toolbar.vue b/web/src/pages/Edit/components/Toolbar.vue index 52d4467b..769004ca 100644 --- a/web/src/pages/Edit/components/Toolbar.vue +++ b/web/src/pages/Edit/components/Toolbar.vue @@ -195,7 +195,7 @@ export default { } fileHandle = _fileHandle if (fileHandle.kind === 'directory') { - this.$message.warning('请选择文件') + this.$message.warning(this.$t('toolbar.selectFileTip')) return } this.readFile() @@ -204,9 +204,7 @@ export default { if (error.toString().includes('aborted')) { return } - this.$message.warning( - '你的浏览器可能不支持,建议使用最新版本的Chrome浏览器' - ) + this.$message.warning(this.$t('toolbar.notSupportTip')) } }, @@ -219,8 +217,10 @@ export default { this.setData(fileReader.result) Notification.closeAll() Notification({ - title: '提示', - message: `当前正在编辑你本机的【${file.name}】文件`, + title: this.$t('toolbar.tip'), + message: `${this.$t('toolbar.editingLocalFileTipFront')}${ + file.name + }${this.$t('toolbar.editingLocalFileTipEnd')}`, duration: 0, showClose: true }) @@ -233,7 +233,7 @@ export default { try { let data = JSON.parse(str) if (typeof data !== 'object') { - throw new Error('文件内容有误') + throw new Error(this.$t('toolbar.fileContentError')) } if (data.root) { this.isFullDataFile = true @@ -247,7 +247,7 @@ export default { this.$bus.$emit('setData', data) } catch (error) { console.log(error) - this.$message.error('文件打开失败') + this.$message.error(this.$t('toolbar.fileOpenFailed')) } }, @@ -286,14 +286,14 @@ export default { accept: { 'application/json': ['.smm'] } } ], - suggestedName: '思维导图' + suggestedName: this.$t('toolbar.defaultFileName') }) if (!_fileHandle) { return } const loading = this.$loading({ lock: true, - text: '正在创建文件', + text: this.$t('toolbar.creatingTip'), spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }) @@ -308,9 +308,7 @@ export default { if (error.toString().includes('aborted')) { return } - this.$message.warning( - '你的浏览器可能不支持,建议使用最新版本的Chrome浏览器' - ) + this.$message.warning(this.$t('toolbar.notSupportTip')) } } }