From 8d03aa4095275fb02c6c8505a8302b52c3a7c55e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Mar 2022 16:36:39 -0300 Subject: [PATCH 01/24] Improve save logic. --- packages/editor/src/classes/menu/Menu.ts | 33 +++++++++---------- .../src/components/LocalStorageManager.ts | 5 +-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/editor/src/classes/menu/Menu.ts b/packages/editor/src/classes/menu/Menu.ts index 21f1a556..eb2a4a9b 100644 --- a/packages/editor/src/classes/menu/Menu.ts +++ b/packages/editor/src/classes/menu/Menu.ts @@ -33,8 +33,6 @@ import { $msg } from '@wisemapping/mindplot'; class Menu extends IMenu { constructor(designer: Designer, containerId: string, readOnly = false, baseUrl = '') { super(designer, containerId); - const saveElem = $('#save'); - const widgetsBaseUrl = `${baseUrl}css/widget`; // Create panels ... @@ -274,30 +272,31 @@ class Menu extends IMenu { Menu._registerTooltip('fontItalic', $msg('FONT_ITALIC'), 'meta+I'); - if (saveElem) { + if (!readOnly) { + // Register action on save ... + const saveElem = $('#save'); this._addButton('save', false, false, () => { this.save(saveElem, designer, true); }); Menu._registerTooltip('save', $msg('SAVE'), 'meta+S'); - if (!readOnly) { - window.addEventListener('beforeunload', () => { + // Register unload save ... + window.addEventListener('beforeunload', () => { + if (this.isSaveRequired()) { + this.save(saveElem, designer, false); + } + this.unlockMap(designer); + }); + + // Autosave on a fixed period of time ... + setInterval( + () => { if (this.isSaveRequired()) { this.save(saveElem, designer, false); } - this.unlockMap(designer); - }); - - // Autosave on a fixed period of time ... - setInterval( - () => { - if (this.isSaveRequired()) { - this.save(saveElem, designer, false); - } - }, 10000, - ); - } + }, 10000, + ); } } diff --git a/packages/mindplot/src/components/LocalStorageManager.ts b/packages/mindplot/src/components/LocalStorageManager.ts index ae35abe3..62ec4b5c 100644 --- a/packages/mindplot/src/components/LocalStorageManager.ts +++ b/packages/mindplot/src/components/LocalStorageManager.ts @@ -32,12 +32,13 @@ class LocalStorageManager extends PersistenceManager { this.readOnly = readOnly; } - saveMapXml(mapId: string, mapDoc: Document): void { + saveMapXml(mapId: string, mapDoc: Document, _pref: string, _saveHistory: boolean, events): void { const mapXml = new XMLSerializer().serializeToString(mapDoc); if (!this.readOnly) { localStorage.setItem(`${mapId}-xml`, mapXml); + events.onSuccess(); } - console.log(`Map XML to save => ${this.saveMapXml}`); + console.log(`Map XML to save => ${mapXml}`); } discardChanges(mapId: string) { From 924ff3ffc1059eff4c0472f0d4706ec7843d5986 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Mar 2022 17:04:44 -0300 Subject: [PATCH 02/24] Fix order --- packages/editor/test/playground/map-render/js/editor.tsx | 2 +- packages/editor/test/playground/map-render/samples/order.wxml | 1 + .../mindplot/src/components/persistence/XMLSerializerTango.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 packages/editor/test/playground/map-render/samples/order.wxml diff --git a/packages/editor/test/playground/map-render/js/editor.tsx b/packages/editor/test/playground/map-render/js/editor.tsx index bc09334b..5a318e0c 100644 --- a/packages/editor/test/playground/map-render/js/editor.tsx +++ b/packages/editor/test/playground/map-render/js/editor.tsx @@ -30,7 +30,7 @@ const initialization = (designer: Designer) => { }); }; -const persistence = new LocalStorageManager('samples/{id}.wxml', false); +const persistence = new LocalStorageManager('samples/{id}.wxml', false, false); const mapId = 'welcome'; const options: EditorOptions = { zoom: 0.8, diff --git a/packages/editor/test/playground/map-render/samples/order.wxml b/packages/editor/test/playground/map-render/samples/order.wxml new file mode 100644 index 00000000..b0599b02 --- /dev/null +++ b/packages/editor/test/playground/map-render/samples/order.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts index fbd98485..a0a47be0 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts +++ b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts @@ -411,6 +411,7 @@ class XMLSerializerTango implements XMLMindmapSerializer { if (topic.getType() !== 'CentralTopic') { topic .getChildren() + .sort((a, b) => a.getOrder() - b.getOrder()) .forEach((child, index) => { if (child.getOrder() !== index) { child.setOrder(index); From e0e53c331f17818dea58518eb47b8a1228f436d5 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Mar 2022 23:26:24 -0300 Subject: [PATCH 03/24] Add Chinesse support. --- packages/editor/lang/zh.json | 14 + packages/editor/src/classes/i18n-msg/index.ts | 4 + packages/editor/src/compiled-lang/zh.json | 26 + .../mindplot/src/components/lang/Bundle.js | 2 + packages/mindplot/src/components/lang/zh.js | 84 ++ packages/webapp/lang/zh.json | 504 ++++++++ packages/webapp/src/classes/app-i18n/index.ts | 6 +- packages/webapp/src/compiled-lang/zh.json | 1016 +++++++++++++++++ 8 files changed, 1653 insertions(+), 3 deletions(-) create mode 100644 packages/editor/lang/zh.json create mode 100644 packages/editor/src/compiled-lang/zh.json create mode 100644 packages/mindplot/src/components/lang/zh.js create mode 100644 packages/webapp/lang/zh.json create mode 100644 packages/webapp/src/compiled-lang/zh.json diff --git a/packages/editor/lang/zh.json b/packages/editor/lang/zh.json new file mode 100644 index 00000000..ecea81dc --- /dev/null +++ b/packages/editor/lang/zh.json @@ -0,0 +1,14 @@ +{ + "editor.try-welcome": { + "defaultMessage": "这个编辑区域展示了一些思维导图编辑器的功能!" + }, + "editor.try-welcome-description": { + "defaultMessage": "注册后可以免费创建、分享和发布无限数量的思维导图。" + }, + "login.signup": { + "defaultMessage": "注册" + }, + "action.share": { + "defaultMessage": "分享" + } +} \ No newline at end of file diff --git a/packages/editor/src/classes/i18n-msg/index.ts b/packages/editor/src/classes/i18n-msg/index.ts index 9b9a25b9..187bdc5d 100644 --- a/packages/editor/src/classes/i18n-msg/index.ts +++ b/packages/editor/src/classes/i18n-msg/index.ts @@ -3,6 +3,8 @@ import ES from './../../compiled-lang/es.json'; import EN from './../../compiled-lang/en.json'; import DE from './../../compiled-lang/de.json'; import RU from './../../compiled-lang/ru.json'; +import ZH from './../../compiled-lang/zh.json'; + class I18nMsg { static loadLocaleData(locale: string) { @@ -17,6 +19,8 @@ class I18nMsg { return DE; case 'ru': return RU; + case 'zh': + return ZH; default: return EN; } diff --git a/packages/editor/src/compiled-lang/zh.json b/packages/editor/src/compiled-lang/zh.json new file mode 100644 index 00000000..e0ab537c --- /dev/null +++ b/packages/editor/src/compiled-lang/zh.json @@ -0,0 +1,26 @@ +{ + "action.share": [ + { + "type": 0, + "value": "分享" + } + ], + "editor.try-welcome": [ + { + "type": 0, + "value": "这个编辑区域展示了一些思维导图编辑器的功能!" + } + ], + "editor.try-welcome-description": [ + { + "type": 0, + "value": "注册后可以免费创建、分享和发布无限数量的思维导图。" + } + ], + "login.signup": [ + { + "type": 0, + "value": "注册" + } + ] +} \ No newline at end of file diff --git a/packages/mindplot/src/components/lang/Bundle.js b/packages/mindplot/src/components/lang/Bundle.js index 5e3d6e44..fc724967 100644 --- a/packages/mindplot/src/components/lang/Bundle.js +++ b/packages/mindplot/src/components/lang/Bundle.js @@ -21,6 +21,7 @@ import EN from './en'; import DE from './de'; import FR from './fr'; import RU from './ru'; +import ZH from './zh'; const Bundle = { es: ES, @@ -28,6 +29,7 @@ const Bundle = { de: DE, fr: FR, ru: RU, + zh: ZH, }; export default Bundle; diff --git a/packages/mindplot/src/components/lang/zh.js b/packages/mindplot/src/components/lang/zh.js new file mode 100644 index 00000000..31adcd34 --- /dev/null +++ b/packages/mindplot/src/components/lang/zh.js @@ -0,0 +1,84 @@ +const ZH = { + ZOOM_IN: '放大', + ZOOM_OUT: '缩小', + TOPIC_SHAPE: '主题形状', + TOPIC_ADD: '添加主题', + TOPIC_DELETE: '删除主题', + TOPIC_ICON: '添加图标', + TOPIC_LINK: '添加链接', + TOPIC_RELATIONSHIP: '关系', + TOPIC_COLOR: '主题颜色', + TOPIC_BORDER_COLOR: '主题边框颜色', + TOPIC_NOTE: '添加注释', + FONT_FAMILY: '字体类型', + FONT_SIZE: '文本大小', + FONT_BOLD: '粗体文本', + FONT_ITALIC: '斜体文本', + UNDO: '撤销', + REDO: '重做', + INSERT: '插入', + SAVE: '保存', + NOTE: '注释', + ADD_TOPIC: '添加主题', + LOADING: '加载......', + EXPORT: '导出', + PRINT: '打印', + PUBLISH: '发布', + COLLABORATE: '分享', + HISTORY: '历史', + DISCARD_CHANGES: '放弃更改', + FONT_COLOR: '文本颜色', + SAVING: '保存......', + SAVE_COMPLETE: '保存完成', + ZOOM_IN_ERROR: '放大比例过高。', + ZOOM_ERROR: '无法再缩放了。', + ONLY_ONE_TOPIC_MUST_BE_SELECTED: '无法创建主题。只能选择一个主题。', + ONE_TOPIC_MUST_BE_SELECTED: '无法创建主题。必须选择一个主题。', + ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE: '无法折叠子节点,必须只选择一个主题。', + SAVE_COULD_NOT_BE_COMPLETED: '无法完成保存,请稍后再试。', + UNEXPECTED_ERROR_LOADING: "我们很抱歉,发生了意外错误。\n再次尝试重新加载编辑器。如果问题仍然存在,请联系我们support@wisemapping.com。", + MAIN_TOPIC: '重点主题', + SUB_TOPIC: '子主题', + ISOLATED_TOPIC: '独立主题', + CENTRAL_TOPIC: '中心主题', + SHORTCUTS: '键盘快捷键', + ENTITIES_COULD_NOT_BE_DELETED: '无法删除主题或关系。至少选择一个脑图实体。', + AT_LEAST_ONE_TOPIC_MUST_BE_SELECTED: '至少要选择一个主题', + CLIPBOARD_IS_EMPTY: '没有东西可以复制。剪贴板是空的。', + CENTRAL_TOPIC_CAN_NOT_BE_DELETED: '无法删除中心主题。', + RELATIONSHIP_COULD_NOT_BE_CREATED: '无法创建关系。必须先选择要建立关系的主题。', + SELECTION_COPIED_TO_CLIPBOARD: '主题已复制到剪贴板', + WRITE_YOUR_TEXT_HERE: '在这里写你的注释......', + REMOVE: '删除', + ACCEPT: '接受', + CANCEL: '取消', + LINK: '链接', + OPEN_LINK: '打开URL', + SESSION_EXPIRED: '您的会话已过期,请重新登录。', + URL_ERROR: 'URL无效', + ACTION: '操作', + CREATE_SIBLING_TOPIC: '创建并行主题', + CREATE_CHILD_TOPIC: '创建子主题', + DELETE_TOPIC: '删除主题', + EDIT_TOPIC_TEXT: '编辑主题文本', + JUST_START_TYPING: '开始打字', + CANCEL_TEXT_CHANGES: '取消文本更改', + TOPIC_NAVIGATION: '主题导航', + ARROW_KEYS: '方向按键', + SELECT_MULTIPLE_NODES: '选择多个节点', + UNDO_EDITION: '撤销编辑', + REDO_EDITION: '重做修改', + SELECT_ALL_TOPIC: '选择所有主题', + CHANGE_TEXT_BOLD: '更改粗体文本', + SAVE_CHANGES: '保存更改', + CHANGE_TEXT_ITALIC: '更改斜体文本', + DESELECT_ALL_TOPIC: '取消选择所有主题', + COLLAPSE_CHILDREN: '折叠子节点', + KEYBOARD_SHORTCUTS_MSG: '键盘快捷键可以让你永远不用把手从键盘上拿开来使用鼠标,从而帮助你节省时间。', + COPY_AND_PASTE_TOPICS: '复制和粘贴主题', + MULTIPLE_LINES: '添加多行文本', + BACK_TO_MAP_LIST: '回到脑图列表', + KEYBOARD_SHOTCUTS: '键盘快捷键', +}; + +export default ZH; diff --git a/packages/webapp/lang/zh.json b/packages/webapp/lang/zh.json new file mode 100644 index 00000000..2629fedd --- /dev/null +++ b/packages/webapp/lang/zh.json @@ -0,0 +1,504 @@ +{ + "account.delete-warning": { + "defaultMessage": "请记住,您将无法访问您添加的任何思维导图。您的所有信息都将被删除,并且无法恢复。" + }, + "accountinfo.button": { + "defaultMessage": "接受" + }, + "accountinfo.deleteaccount": { + "defaultMessage": "删除账号" + }, + "accountinfo.email": { + "defaultMessage": "Email电子邮件" + }, + "accountinfo.firstname": { + "defaultMessage": "名字" + }, + "accountinfo.lastname": { + "defaultMessage": "姓氏" + }, + "accountinfo.title": { + "defaultMessage": "账户信息" + }, + "action.cancel-button": { + "defaultMessage": "取消" + }, + "action.close-button": { + "defaultMessage": "关闭" + }, + "action.delete": { + "defaultMessage": "删除" + }, + "action.delete-description": { + "defaultMessage": "已删除的思维导图无法恢复。您想继续吗?" + }, + "action.delete-title": { + "defaultMessage": "删除" + }, + "action.duplicate": { + "defaultMessage": "复制" + }, + "action.export": { + "defaultMessage": "导出" + }, + "action.history": { + "defaultMessage": "历史" + }, + "action.history-description": { + "defaultMessage": "过去90天内引入的更改列表。" + }, + "action.history-title": { + "defaultMessage": "历史版本" + }, + "action.import": { + "defaultMessage": "导入" + }, + "action.info": { + "defaultMessage": "信息" + }, + "action.label": { + "defaultMessage": "添加标签" + }, + "action.new": { + "defaultMessage": "新建脑图" + }, + "action.open": { + "defaultMessage": "打开" + }, + "action.print": { + "defaultMessage": "打印" + }, + "action.publish": { + "defaultMessage": "发布" + }, + "action.rename": { + "defaultMessage": "重命名" + }, + "action.rename-description-placeholder": { + "defaultMessage": "描述" + }, + "action.rename-name-placeholder": { + "defaultMessage": "名称" + }, + "action.share": { + "defaultMessage": "分享" + }, + "changepwd.button": { + "defaultMessage": "更改" + }, + "changepwd.confirm-password": { + "defaultMessage": "确认密码" + }, + "changepwd.description": { + "defaultMessage": "请为您的账户提供新密码" + }, + "changepwd.password": { + "defaultMessage": "密码" + }, + "changepwd.password-match": { + "defaultMessage": "密码不一致,请再试一次" + }, + "changepwd.title": { + "defaultMessage": "更改密码" + }, + "common.wait": { + "defaultMessage": "请等待。。。" + }, + "create.button": { + "defaultMessage": "创建" + }, + "create.description": { + "defaultMessage": "请填写新的脑图名称和描述" + }, + "create.title": { + "defaultMessage": "创建一个新的思维导图" + }, + "deletem.title": { + "defaultMessage": "所有选中的脑图将被删除" + }, + "duplicate.title": { + "defaultMessage": "复制" + }, + "expired.description": { + "defaultMessage": "您的当前会话已过期。请登录后重试。" + }, + "expired.title": { + "defaultMessage": "您的会话已过期" + }, + "export.desc": { + "defaultMessage": "以您需要的格式导出此脑图,并在演示文稿中使用或通过电子邮件分享" + }, + "export.document": { + "defaultMessage": "思维导图工具:以第三方思维导图格式导出您的思维导图" + }, + "export.document-label": { + "defaultMessage": "文档:将你的思维导图导出到一个独立的文档中来分享" + }, + "export.image": { + "defaultMessage": "Image: Get a graphic representation of your map including all colors and shapes.图像:以图片形式获取包含所有颜色和形状的脑图" + }, + "export.img-center": { + "defaultMessage": "居中并缩放合适大小" + }, + "export.title": { + "defaultMessage": "导出" + }, + "export.warning": { + "defaultMessage": "导出到图像(SVG,PNG,JPEG,PDF)仅在编辑器工具栏中可用。" + }, + "footer.aboutus": { + "defaultMessage": "关于我们" + }, + "footer.contactus": { + "defaultMessage": "联系我们" + }, + "footer.faq": { + "defaultMessage": "常见问题" + }, + "footer.faqandhelp": { + "defaultMessage": "帮助和常见问题" + }, + "footer.feedback": { + "defaultMessage": "反馈" + }, + "footer.opensource": { + "defaultMessage": "开源" + }, + "footer.others": { + "defaultMessage": "其它" + }, + "footer.termsandconditions": { + "defaultMessage": "条款和条件" + }, + "forgot.desc": { + "defaultMessage": "我们将向您发送电子邮件以重置您的密码。" + }, + "forgot.email": { + "defaultMessage": "电子邮件" + }, + "forgot.page-title": { + "defaultMessage": "忘记密码|WiseMapping" + }, + "forgot.register": { + "defaultMessage": "发送恢复链接" + }, + "forgot.success.desc": { + "defaultMessage": "我们已经向您发送了一封电子邮件,允许您重置密码。您应该会在几分钟内收到" + }, + "forgot.success.title": { + "defaultMessage": "您的临时密码已发送。" + }, + "forgot.title": { + "defaultMessage": "重置密码" + }, + "forgotsuccess.page-title": { + "defaultMessage": "密码已恢复|WiseMapping" + }, + "header.donthaveaccount": { + "defaultMessage": "没有账号?" + }, + "header.haveaccount": { + "defaultMessage": "已经有一个账号?" + }, + "help.support": { + "defaultMessage": "支持" + }, + "history.no-changes": { + "defaultMessage": "没有可用的更改" + }, + "import.button": { + "defaultMessage": "创建" + }, + "import.description": { + "defaultMessage": "您可以将WiseMapping脑图导入到您的脑图列表中。选择要导入的文件。" + }, + "import.title": { + "defaultMessage": "导入现有的思维导图" + }, + "info.basic-info": { + "defaultMessage": "基本信息" + }, + "info.button": { + "defaultMessage": "接受" + }, + "info.creation-time": { + "defaultMessage": "创建日期" + }, + "info.creator": { + "defaultMessage": "创建人" + }, + "info.description": { + "defaultMessage": "描述" + }, + "info.description-msg": { + "defaultMessage": "通过发布脑图,你让互联网上的每个人都能看到它。" + }, + "info.modified-time": { + "defaultMessage": "最后修改日期" + }, + "info.modified-tny": { + "defaultMessage": "最后修改人" + }, + "info.name": { + "defaultMessage": "名称" + }, + "info.public-visibility": { + "defaultMessage": "公开可见" + }, + "info.sharing": { + "defaultMessage": "分享" + }, + "info.starred": { + "defaultMessage": "星标" + }, + "info.title": { + "defaultMessage": "信息" + }, + "label.add-button": { + "defaultMessage": "添加标签" + }, + "label.add-for": { + "defaultMessage": "编辑脑图标签:" + }, + "label.add-placeholder": { + "defaultMessage": "标签标题" + }, + "label.change-color": { + "defaultMessage": "更改标签颜色" + }, + "label.delete-description": { + "defaultMessage": "将被删除,包括它与所有现有脑图的关联。是否继续?" + }, + "label.delete-title": { + "defaultMessage": "确认标签删除" + }, + "label.description": { + "defaultMessage": "使用标签来组织你的脑图。" + }, + "label.title": { + "defaultMessage": "添加标签" + }, + "language.change": { + "defaultMessage": "更改语言" + }, + "language.help": { + "defaultMessage": "帮助翻译" + }, + "login.desc": { + "defaultMessage": "登录您的账号" + }, + "login.email": { + "defaultMessage": "电子邮件" + }, + "login.error": { + "defaultMessage": "您输入的电子邮件地址或密码无效。" + }, + "login.forgotpwd": { + "defaultMessage": "忘记密码?" + }, + "login.hsqldbcofig": { + "defaultMessage": "虽然HSQLDB在安装过程中默认与WiseMapping捆绑在一起,但我们不建议将此数据库用于生产用途。请考虑使用MySQL 5.7代替。您可以找到更多关于如何配置MySQL的信息", + "description": "缺少已配置的生产数据库" + }, + "login.page-title": { + "defaultMessage": "登录|WiseMapping" + }, + "login.password": { + "defaultMessage": "密码" + }, + "login.remberme": { + "defaultMessage": "记住我的登录" + }, + "login.signin": { + "defaultMessage": "登录" + }, + "login.signup": { + "defaultMessage": "注册" + }, + "login.title": { + "defaultMessage": "欢迎" + }, + "login.userinactive": { + "defaultMessage": "对不起,您的账号尚未激活。当它激活时,您将收到一封通知电子邮件。敬请关注!" + }, + "map.creator": { + "defaultMessage": "创建人" + }, + "map.delete-selected": { + "defaultMessage": "删除选中项" + }, + "map.last-update": { + "defaultMessage": "最后更新" + }, + "map.more-actions": { + "defaultMessage": "更多操作" + }, + "map.name": { + "defaultMessage": "名称" + }, + "map.tooltip-add": { + "defaultMessage": "将标签添加到选定项" + }, + "maps.choose-file": { + "defaultMessage": "选择一个文件" + }, + "maps.create-tooltip": { + "defaultMessage": "创建一个新的思维导图" + }, + "maps.empty-result": { + "defaultMessage": "没有找到与当前筛选条件匹配的思维导图。" + }, + "maps.import-desc": { + "defaultMessage": "从其它工具导入" + }, + "maps.modified": { + "defaultMessage": "修改" + }, + "maps.modified-by": { + "defaultMessage": "修改人" + }, + "maps.modified-by-desc": { + "defaultMessage": "{on}由{by}修改" + }, + "maps.nav-all": { + "defaultMessage": "所有" + }, + "maps.nav-onwned": { + "defaultMessage": "拥有" + }, + "maps.nav-public": { + "defaultMessage": "公共" + }, + "maps.nav-shared": { + "defaultMessage": "与我分享" + }, + "maps.nav-starred": { + "defaultMessage": "星标" + }, + "maps.page-title": { + "defaultMessage": "我的脑图|WiseMapping" + }, + "maps.revert": { + "defaultMessage": "恢复" + }, + "maps.search-action": { + "defaultMessage": "搜索。。。" + }, + "maps.tooltip-open": { + "defaultMessage": "打开编辑" + }, + "maps.tooltip-starred": { + "defaultMessage": "星标" + }, + "maps.view": { + "defaultMessage": "查看" + }, + "menu.account": { + "defaultMessage": "账号" + }, + "menu.change-password": { + "defaultMessage": "更改密码" + }, + "menu.signout": { + "defaultMessage": "注销" + }, + "publish.button": { + "defaultMessage": "接受" + }, + "publish.checkbox": { + "defaultMessage": "开启公共分享" + }, + "publish.description": { + "defaultMessage": "通过发布脑图,你让互联网上的每个人都能看到它。" + }, + "publish.embedded": { + "defaultMessage": "嵌入" + }, + "publish.embedded-msg": { + "defaultMessage": "复制这段代码以嵌入到您的博客或页面中:" + }, + "publish.public-url": { + "defaultMessage": "公共UPL" + }, + "publish.public-url-msg": { + "defaultMessage": "复制并粘贴下面的链接,与同事分享您的脑图:" + }, + "publish.title": { + "defaultMessage": "发布" + }, + "registation.success-title": { + "defaultMessage": "注册成功|WiseMapping" + }, + "registration.desc": { + "defaultMessage": "Signing up is free and just take a moment注册免费,分分钟就好" + }, + "registration.email": { + "defaultMessage": "电子邮件" + }, + "registration.firstname": { + "defaultMessage": "名字" + }, + "registration.lastname": { + "defaultMessage": "姓氏" + }, + "registration.page-title": { + "defaultMessage": "注册|WiseMapping" + }, + "registration.password": { + "defaultMessage": "密码" + }, + "registration.register": { + "defaultMessage": "注册" + }, + "registration.success.desc": { + "defaultMessage": "点击下面的登录按钮,开始创建思维导图。" + }, + "registration.termandconditions": { + "defaultMessage": "客户条款:请检查您在上面输入的WiseMapping账号信息,并在此处查看客户条款。点击下面的'注册'即表示您同意上面的客户条款和隐私政策" + }, + "registration.title": { + "defaultMessage": "成为成员" + }, + "rename.description": { + "defaultMessage": "请填写新的脑图名称和描述。" + }, + "rename.title": { + "defaultMessage": "重命名" + }, + "resetpassword.success.title": { + "defaultMessage": "您的账号已成功创建" + }, + "role.editor": { + "defaultMessage": "编辑人" + }, + "role.owner": { + "defaultMessage": "所有人" + }, + "role.viewer": { + "defaultMessage": "查看人" + }, + "share.add-button": { + "defaultMessage": "添加" + }, + "share.add-message": { + "defaultMessage": "添加消息" + }, + "share.can-edit": { + "defaultMessage": "可编辑" + }, + "share.can-view": { + "defaultMessage": "可查看" + }, + "share.delete": { + "defaultMessage": "删除协作人" + }, + "share.delete-description": { + "defaultMessage": "邀请人们与你合作创建你的思维导图。他们将通过电子邮件得到通知。" + }, + "share.delete-title": { + "defaultMessage": "与人分享" + }, + "share.message": { + "defaultMessage": "消息" + } +} diff --git a/packages/webapp/src/classes/app-i18n/index.ts b/packages/webapp/src/classes/app-i18n/index.ts index c43439aa..e5af79f5 100644 --- a/packages/webapp/src/classes/app-i18n/index.ts +++ b/packages/webapp/src/classes/app-i18n/index.ts @@ -47,7 +47,7 @@ export default abstract class AppI18n { } } -export type LocaleCode = 'en' | 'es' | 'fr' | 'de' | 'ru'; +export type LocaleCode = 'en' | 'es' | 'fr' | 'de' | 'ru' | 'zh'; export const Locales = { EN: new Locale('en', 'English', require('./../../compiled-lang/en.json')), // eslint-disable-line @@ -55,10 +55,10 @@ export const Locales = { DE: new Locale('fr', 'Français', require('./../../compiled-lang/fr.json')), // eslint-disable-line FR: new Locale('de', 'Deutsch', require('./../../compiled-lang/de.json')), // eslint-disable-line RU: new Locale('ru', 'Pусский', require('./../../compiled-lang/ru.json')), // eslint-disable-line + ZH: new Locale('zh', '中文', require('./../../compiled-lang/zh.json')), // eslint-disable-line + }; - - export const localeFromStr = (code: string): Locale => { const locales: Locale[] = Object.values(Locales); diff --git a/packages/webapp/src/compiled-lang/zh.json b/packages/webapp/src/compiled-lang/zh.json new file mode 100644 index 00000000..b249b5b4 --- /dev/null +++ b/packages/webapp/src/compiled-lang/zh.json @@ -0,0 +1,1016 @@ +{ + "account.delete-warning": [ + { + "type": 0, + "value": "请记住,您将无法访问您添加的任何思维导图。您的所有信息都将被删除,并且无法恢复。" + } + ], + "accountinfo.button": [ + { + "type": 0, + "value": "接受" + } + ], + "accountinfo.deleteaccount": [ + { + "type": 0, + "value": "删除账号" + } + ], + "accountinfo.email": [ + { + "type": 0, + "value": "Email电子邮件" + } + ], + "accountinfo.firstname": [ + { + "type": 0, + "value": "名字" + } + ], + "accountinfo.lastname": [ + { + "type": 0, + "value": "姓氏" + } + ], + "accountinfo.title": [ + { + "type": 0, + "value": "账户信息" + } + ], + "action.cancel-button": [ + { + "type": 0, + "value": "取消" + } + ], + "action.close-button": [ + { + "type": 0, + "value": "关闭" + } + ], + "action.delete": [ + { + "type": 0, + "value": "删除" + } + ], + "action.delete-description": [ + { + "type": 0, + "value": "已删除的思维导图无法恢复。您想继续吗?" + } + ], + "action.delete-title": [ + { + "type": 0, + "value": "删除" + } + ], + "action.duplicate": [ + { + "type": 0, + "value": "复制" + } + ], + "action.export": [ + { + "type": 0, + "value": "导出" + } + ], + "action.history": [ + { + "type": 0, + "value": "历史" + } + ], + "action.history-description": [ + { + "type": 0, + "value": "过去90天内引入的更改列表。" + } + ], + "action.history-title": [ + { + "type": 0, + "value": "历史版本" + } + ], + "action.import": [ + { + "type": 0, + "value": "导入" + } + ], + "action.info": [ + { + "type": 0, + "value": "信息" + } + ], + "action.label": [ + { + "type": 0, + "value": "添加标签" + } + ], + "action.new": [ + { + "type": 0, + "value": "新建脑图" + } + ], + "action.open": [ + { + "type": 0, + "value": "打开" + } + ], + "action.print": [ + { + "type": 0, + "value": "打印" + } + ], + "action.publish": [ + { + "type": 0, + "value": "发布" + } + ], + "action.rename": [ + { + "type": 0, + "value": "重命名" + } + ], + "action.rename-description-placeholder": [ + { + "type": 0, + "value": "描述" + } + ], + "action.rename-name-placeholder": [ + { + "type": 0, + "value": "名称" + } + ], + "action.share": [ + { + "type": 0, + "value": "分享" + } + ], + "changepwd.button": [ + { + "type": 0, + "value": "更改" + } + ], + "changepwd.confirm-password": [ + { + "type": 0, + "value": "确认密码" + } + ], + "changepwd.description": [ + { + "type": 0, + "value": "请为您的账户提供新密码" + } + ], + "changepwd.password": [ + { + "type": 0, + "value": "密码" + } + ], + "changepwd.password-match": [ + { + "type": 0, + "value": "密码不一致,请再试一次" + } + ], + "changepwd.title": [ + { + "type": 0, + "value": "更改密码" + } + ], + "common.wait": [ + { + "type": 0, + "value": "请等待。。。" + } + ], + "create.button": [ + { + "type": 0, + "value": "创建" + } + ], + "create.description": [ + { + "type": 0, + "value": "请填写新的脑图名称和描述" + } + ], + "create.title": [ + { + "type": 0, + "value": "创建一个新的思维导图" + } + ], + "deletem.title": [ + { + "type": 0, + "value": "所有选中的脑图将被删除" + } + ], + "duplicate.title": [ + { + "type": 0, + "value": "复制" + } + ], + "expired.description": [ + { + "type": 0, + "value": "您的当前会话已过期。请登录后重试。" + } + ], + "expired.title": [ + { + "type": 0, + "value": "您的会话已过期" + } + ], + "export.desc": [ + { + "type": 0, + "value": "以您需要的格式导出此脑图,并在演示文稿中使用或通过电子邮件分享" + } + ], + "export.document": [ + { + "type": 0, + "value": "思维导图工具:以第三方思维导图格式导出您的思维导图" + } + ], + "export.document-label": [ + { + "type": 0, + "value": "文档:将你的思维导图导出到一个独立的文档中来分享" + } + ], + "export.image": [ + { + "type": 0, + "value": "Image: Get a graphic representation of your map including all colors and shapes.图像:以图片形式获取包含所有颜色和形状的脑图" + } + ], + "export.img-center": [ + { + "type": 0, + "value": "居中并缩放合适大小" + } + ], + "export.title": [ + { + "type": 0, + "value": "导出" + } + ], + "export.warning": [ + { + "type": 0, + "value": "导出到图像(SVG,PNG,JPEG,PDF)仅在编辑器工具栏中可用。" + } + ], + "footer.aboutus": [ + { + "type": 0, + "value": "关于我们" + } + ], + "footer.contactus": [ + { + "type": 0, + "value": "联系我们" + } + ], + "footer.faq": [ + { + "type": 0, + "value": "常见问题" + } + ], + "footer.faqandhelp": [ + { + "type": 0, + "value": "帮助和常见问题" + } + ], + "footer.feedback": [ + { + "type": 0, + "value": "反馈" + } + ], + "footer.opensource": [ + { + "type": 0, + "value": "开源" + } + ], + "footer.others": [ + { + "type": 0, + "value": "其它" + } + ], + "footer.termsandconditions": [ + { + "type": 0, + "value": "条款和条件" + } + ], + "forgot.desc": [ + { + "type": 0, + "value": "我们将向您发送电子邮件以重置您的密码。" + } + ], + "forgot.email": [ + { + "type": 0, + "value": "电子邮件" + } + ], + "forgot.page-title": [ + { + "type": 0, + "value": "忘记密码|WiseMapping" + } + ], + "forgot.register": [ + { + "type": 0, + "value": "发送恢复链接" + } + ], + "forgot.success.desc": [ + { + "type": 0, + "value": "我们已经向您发送了一封电子邮件,允许您重置密码。您应该会在几分钟内收到" + } + ], + "forgot.success.title": [ + { + "type": 0, + "value": "您的临时密码已发送。" + } + ], + "forgot.title": [ + { + "type": 0, + "value": "重置密码" + } + ], + "forgotsuccess.page-title": [ + { + "type": 0, + "value": "密码已恢复|WiseMapping" + } + ], + "header.donthaveaccount": [ + { + "type": 0, + "value": "没有账号?" + } + ], + "header.haveaccount": [ + { + "type": 0, + "value": "已经有一个账号?" + } + ], + "help.support": [ + { + "type": 0, + "value": "支持" + } + ], + "history.no-changes": [ + { + "type": 0, + "value": "没有可用的更改" + } + ], + "import.button": [ + { + "type": 0, + "value": "创建" + } + ], + "import.description": [ + { + "type": 0, + "value": "您可以将WiseMapping脑图导入到您的脑图列表中。选择要导入的文件。" + } + ], + "import.title": [ + { + "type": 0, + "value": "导入现有的思维导图" + } + ], + "info.basic-info": [ + { + "type": 0, + "value": "基本信息" + } + ], + "info.button": [ + { + "type": 0, + "value": "接受" + } + ], + "info.creation-time": [ + { + "type": 0, + "value": "创建日期" + } + ], + "info.creator": [ + { + "type": 0, + "value": "创建人" + } + ], + "info.description": [ + { + "type": 0, + "value": "描述" + } + ], + "info.description-msg": [ + { + "type": 0, + "value": "通过发布脑图,你让互联网上的每个人都能看到它。" + } + ], + "info.modified-time": [ + { + "type": 0, + "value": "最后修改日期" + } + ], + "info.modified-tny": [ + { + "type": 0, + "value": "最后修改人" + } + ], + "info.name": [ + { + "type": 0, + "value": "名称" + } + ], + "info.public-visibility": [ + { + "type": 0, + "value": "公开可见" + } + ], + "info.sharing": [ + { + "type": 0, + "value": "分享" + } + ], + "info.starred": [ + { + "type": 0, + "value": "星标" + } + ], + "info.title": [ + { + "type": 0, + "value": "信息" + } + ], + "label.add-button": [ + { + "type": 0, + "value": "添加标签" + } + ], + "label.add-for": [ + { + "type": 0, + "value": "编辑脑图标签:" + } + ], + "label.add-placeholder": [ + { + "type": 0, + "value": "标签标题" + } + ], + "label.change-color": [ + { + "type": 0, + "value": "更改标签颜色" + } + ], + "label.delete-description": [ + { + "type": 0, + "value": "将被删除,包括它与所有现有脑图的关联。是否继续?" + } + ], + "label.delete-title": [ + { + "type": 0, + "value": "确认标签删除" + } + ], + "label.description": [ + { + "type": 0, + "value": "使用标签来组织你的脑图。" + } + ], + "label.title": [ + { + "type": 0, + "value": "添加标签" + } + ], + "language.change": [ + { + "type": 0, + "value": "更改语言" + } + ], + "language.help": [ + { + "type": 0, + "value": "帮助翻译" + } + ], + "login.desc": [ + { + "type": 0, + "value": "登录您的账号" + } + ], + "login.email": [ + { + "type": 0, + "value": "电子邮件" + } + ], + "login.error": [ + { + "type": 0, + "value": "您输入的电子邮件地址或密码无效。" + } + ], + "login.forgotpwd": [ + { + "type": 0, + "value": "忘记密码?" + } + ], + "login.hsqldbcofig": [ + { + "type": 0, + "value": "虽然HSQLDB在安装过程中默认与WiseMapping捆绑在一起,但我们不建议将此数据库用于生产用途。请考虑使用MySQL 5.7代替。您可以找到更多关于如何配置MySQL的信息" + } + ], + "login.page-title": [ + { + "type": 0, + "value": "登录|WiseMapping" + } + ], + "login.password": [ + { + "type": 0, + "value": "密码" + } + ], + "login.remberme": [ + { + "type": 0, + "value": "记住我的登录" + } + ], + "login.signin": [ + { + "type": 0, + "value": "登录" + } + ], + "login.signup": [ + { + "type": 0, + "value": "注册" + } + ], + "login.title": [ + { + "type": 0, + "value": "欢迎" + } + ], + "login.userinactive": [ + { + "type": 0, + "value": "对不起,您的账号尚未激活。当它激活时,您将收到一封通知电子邮件。敬请关注!" + } + ], + "map.creator": [ + { + "type": 0, + "value": "创建人" + } + ], + "map.delete-selected": [ + { + "type": 0, + "value": "删除选中项" + } + ], + "map.last-update": [ + { + "type": 0, + "value": "最后更新" + } + ], + "map.more-actions": [ + { + "type": 0, + "value": "更多操作" + } + ], + "map.name": [ + { + "type": 0, + "value": "名称" + } + ], + "map.tooltip-add": [ + { + "type": 0, + "value": "将标签添加到选定项" + } + ], + "maps.choose-file": [ + { + "type": 0, + "value": "选择一个文件" + } + ], + "maps.create-tooltip": [ + { + "type": 0, + "value": "创建一个新的思维导图" + } + ], + "maps.empty-result": [ + { + "type": 0, + "value": "没有找到与当前筛选条件匹配的思维导图。" + } + ], + "maps.import-desc": [ + { + "type": 0, + "value": "从其它工具导入" + } + ], + "maps.modified": [ + { + "type": 0, + "value": "修改" + } + ], + "maps.modified-by": [ + { + "type": 0, + "value": "修改人" + } + ], + "maps.modified-by-desc": [ + { + "type": 1, + "value": "on" + }, + { + "type": 0, + "value": "由" + }, + { + "type": 1, + "value": "by" + }, + { + "type": 0, + "value": "修改" + } + ], + "maps.nav-all": [ + { + "type": 0, + "value": "所有" + } + ], + "maps.nav-onwned": [ + { + "type": 0, + "value": "拥有" + } + ], + "maps.nav-public": [ + { + "type": 0, + "value": "公共" + } + ], + "maps.nav-shared": [ + { + "type": 0, + "value": "与我分享" + } + ], + "maps.nav-starred": [ + { + "type": 0, + "value": "星标" + } + ], + "maps.page-title": [ + { + "type": 0, + "value": "我的脑图|WiseMapping" + } + ], + "maps.revert": [ + { + "type": 0, + "value": "恢复" + } + ], + "maps.search-action": [ + { + "type": 0, + "value": "搜索。。。" + } + ], + "maps.tooltip-open": [ + { + "type": 0, + "value": "打开编辑" + } + ], + "maps.tooltip-starred": [ + { + "type": 0, + "value": "星标" + } + ], + "maps.view": [ + { + "type": 0, + "value": "查看" + } + ], + "menu.account": [ + { + "type": 0, + "value": "账号" + } + ], + "menu.change-password": [ + { + "type": 0, + "value": "更改密码" + } + ], + "menu.signout": [ + { + "type": 0, + "value": "注销" + } + ], + "publish.button": [ + { + "type": 0, + "value": "接受" + } + ], + "publish.checkbox": [ + { + "type": 0, + "value": "开启公共分享" + } + ], + "publish.description": [ + { + "type": 0, + "value": "通过发布脑图,你让互联网上的每个人都能看到它。" + } + ], + "publish.embedded": [ + { + "type": 0, + "value": "嵌入" + } + ], + "publish.embedded-msg": [ + { + "type": 0, + "value": "复制这段代码以嵌入到您的博客或页面中:" + } + ], + "publish.public-url": [ + { + "type": 0, + "value": "公共UPL" + } + ], + "publish.public-url-msg": [ + { + "type": 0, + "value": "复制并粘贴下面的链接,与同事分享您的脑图:" + } + ], + "publish.title": [ + { + "type": 0, + "value": "发布" + } + ], + "registation.success-title": [ + { + "type": 0, + "value": "注册成功|WiseMapping" + } + ], + "registration.desc": [ + { + "type": 0, + "value": "Signing up is free and just take a moment注册免费,分分钟就好" + } + ], + "registration.email": [ + { + "type": 0, + "value": "电子邮件" + } + ], + "registration.firstname": [ + { + "type": 0, + "value": "名字" + } + ], + "registration.lastname": [ + { + "type": 0, + "value": "姓氏" + } + ], + "registration.page-title": [ + { + "type": 0, + "value": "注册|WiseMapping" + } + ], + "registration.password": [ + { + "type": 0, + "value": "密码" + } + ], + "registration.register": [ + { + "type": 0, + "value": "注册" + } + ], + "registration.success.desc": [ + { + "type": 0, + "value": "点击下面的登录按钮,开始创建思维导图。" + } + ], + "registration.termandconditions": [ + { + "type": 0, + "value": "客户条款:请检查您在上面输入的WiseMapping账号信息,并在此处查看客户条款。点击下面的'注册'即表示您同意上面的客户条款和隐私政策" + } + ], + "registration.title": [ + { + "type": 0, + "value": "成为成员" + } + ], + "rename.description": [ + { + "type": 0, + "value": "请填写新的脑图名称和描述。" + } + ], + "rename.title": [ + { + "type": 0, + "value": "重命名" + } + ], + "resetpassword.success.title": [ + { + "type": 0, + "value": "您的账号已成功创建" + } + ], + "role.editor": [ + { + "type": 0, + "value": "编辑人" + } + ], + "role.owner": [ + { + "type": 0, + "value": "所有人" + } + ], + "role.viewer": [ + { + "type": 0, + "value": "查看人" + } + ], + "share.add-button": [ + { + "type": 0, + "value": "添加" + } + ], + "share.add-message": [ + { + "type": 0, + "value": "添加消息" + } + ], + "share.can-edit": [ + { + "type": 0, + "value": "可编辑" + } + ], + "share.can-view": [ + { + "type": 0, + "value": "可查看" + } + ], + "share.delete": [ + { + "type": 0, + "value": "删除协作人" + } + ], + "share.delete-description": [ + { + "type": 0, + "value": "邀请人们与你合作创建你的思维导图。他们将通过电子邮件得到通知。" + } + ], + "share.delete-title": [ + { + "type": 0, + "value": "与人分享" + } + ], + "share.message": [ + { + "type": 0, + "value": "消息" + } + ] +} \ No newline at end of file From a6262ee5ffc57f68e18743355ccc17107ccd0b47 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Mar 2022 23:36:43 -0300 Subject: [PATCH 04/24] Add node shoutcuts --- .../src/classes/menu/KeyboardShortcutDialog.js | 10 ++++++++++ .../mindplot/src/components/DesignerKeyboard.ts | 14 ++++++++++++++ packages/mindplot/src/components/lang/zh.js | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/classes/menu/KeyboardShortcutDialog.js b/packages/editor/src/classes/menu/KeyboardShortcutDialog.js index 58231d27..99e82694 100644 --- a/packages/editor/src/classes/menu/KeyboardShortcutDialog.js +++ b/packages/editor/src/classes/menu/KeyboardShortcutDialog.js @@ -126,6 +126,16 @@ class KeyboardShortcutDialog extends BootstrapDialog { Ctrl + b ⌘ + b + + ${$msg('TOPIC_NOTE')} + Ctrl + n + ⌘ + n + + + ${$msg('TOPIC_LINK')} + Ctrl + l + ⌘ + l + `); diff --git a/packages/mindplot/src/components/DesignerKeyboard.ts b/packages/mindplot/src/components/DesignerKeyboard.ts index 0d146ef8..278de869 100644 --- a/packages/mindplot/src/components/DesignerKeyboard.ts +++ b/packages/mindplot/src/components/DesignerKeyboard.ts @@ -117,6 +117,20 @@ class DesignerKeyboard extends Keyboard { designer.copyToClipboard(); }, ); + this.addShortcut( + ['ctrl+l', 'meta+l'], (event: Event) => { + event.preventDefault(); + event.stopPropagation(); + designer.addLink(); + }, + ); + this.addShortcut( + ['ctrl+n', 'meta+n'], (event: Event) => { + event.preventDefault(); + event.stopPropagation(); + designer.addNote(); + }, + ); this.addShortcut( ['ctrl+v', 'meta+v'], (event: Event) => { event.preventDefault(); diff --git a/packages/mindplot/src/components/lang/zh.js b/packages/mindplot/src/components/lang/zh.js index 31adcd34..b4eb5c96 100644 --- a/packages/mindplot/src/components/lang/zh.js +++ b/packages/mindplot/src/components/lang/zh.js @@ -36,7 +36,7 @@ const ZH = { ONE_TOPIC_MUST_BE_SELECTED: '无法创建主题。必须选择一个主题。', ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE: '无法折叠子节点,必须只选择一个主题。', SAVE_COULD_NOT_BE_COMPLETED: '无法完成保存,请稍后再试。', - UNEXPECTED_ERROR_LOADING: "我们很抱歉,发生了意外错误。\n再次尝试重新加载编辑器。如果问题仍然存在,请联系我们support@wisemapping.com。", + UNEXPECTED_ERROR_LOADING: '我们很抱歉,发生了意外错误。\n再次尝试重新加载编辑器。如果问题仍然存在,请联系我们support@wisemapping.com。', MAIN_TOPIC: '重点主题', SUB_TOPIC: '子主题', ISOLATED_TOPIC: '独立主题', From 7e207a52854614fc340bf57f6db0427d907baa89 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Mar 2022 23:55:10 -0300 Subject: [PATCH 05/24] Remove shortcuts display from menu --- packages/editor/src/classes/menu/Menu.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/editor/src/classes/menu/Menu.ts b/packages/editor/src/classes/menu/Menu.ts index eb2a4a9b..816c02f2 100644 --- a/packages/editor/src/classes/menu/Menu.ts +++ b/packages/editor/src/classes/menu/Menu.ts @@ -211,7 +211,7 @@ class Menu extends IMenu { if (undoButton) { undoButton.disable(); } - Menu._registerTooltip('undoEdition', $msg('UNDO'), 'meta+Z'); + Menu._registerTooltip('undoEdition', $msg('UNDO')); const redoButton = this._addButton('redoEdition', false, false, () => { designer.redo(); @@ -219,7 +219,7 @@ class Menu extends IMenu { if (redoButton) { redoButton.disable(); } - Menu._registerTooltip('redoEdition', $msg('REDO'), 'meta+shift+Z'); + Menu._registerTooltip('redoEdition', $msg('REDO')); if (redoButton && undoButton) { designer.addEvent('modelUpdate', (event) => { @@ -239,12 +239,12 @@ class Menu extends IMenu { this._addButton('addTopic', true, false, () => { designer.createSiblingForSelectedNode(); }); - Menu._registerTooltip('addTopic', $msg('ADD_TOPIC'), 'Enter'); + Menu._registerTooltip('addTopic', $msg('ADD_TOPIC'); this._addButton('deleteTopic', true, true, () => { designer.deleteSelectedEntities(); }); - Menu._registerTooltip('deleteTopic', $msg('TOPIC_DELETE'), 'Delete'); + Menu._registerTooltip('deleteTopic', $msg('TOPIC_DELETE')); this._addButton('topicLink', true, false, () => { designer.addLink(); @@ -279,7 +279,7 @@ class Menu extends IMenu { () => { this.save(saveElem, designer, true); }); - Menu._registerTooltip('save', $msg('SAVE'), 'meta+S'); + Menu._registerTooltip('save', $msg('SAVE')); // Register unload save ... window.addEventListener('beforeunload', () => { From ce5ec6d6719485520edbf76b81e842fea5cfb759 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Mar 2022 23:58:57 -0300 Subject: [PATCH 06/24] Add Chinese to lang toolbar --- .../webapp/src/components/maps-page/language-menu/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/webapp/src/components/maps-page/language-menu/index.tsx b/packages/webapp/src/components/maps-page/language-menu/index.tsx index befefe3d..02aa8957 100644 --- a/packages/webapp/src/components/maps-page/language-menu/index.tsx +++ b/packages/webapp/src/components/maps-page/language-menu/index.tsx @@ -106,6 +106,10 @@ const LanguageMenu = (): React.ReactElement => { {Locales.RU.label} + + {Locales.ZH.label} + + Date: Mon, 14 Mar 2022 00:02:15 -0300 Subject: [PATCH 07/24] Fix compilation --- packages/editor/src/classes/menu/Menu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/classes/menu/Menu.ts b/packages/editor/src/classes/menu/Menu.ts index 816c02f2..57b7a035 100644 --- a/packages/editor/src/classes/menu/Menu.ts +++ b/packages/editor/src/classes/menu/Menu.ts @@ -239,7 +239,7 @@ class Menu extends IMenu { this._addButton('addTopic', true, false, () => { designer.createSiblingForSelectedNode(); }); - Menu._registerTooltip('addTopic', $msg('ADD_TOPIC'); + Menu._registerTooltip('addTopic', $msg('ADD_TOPIC')); this._addButton('deleteTopic', true, true, () => { designer.deleteSelectedEntities(); From f2a98129f7f827a541eb7d872adb1a6f2fd43417 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 00:05:09 -0300 Subject: [PATCH 08/24] v5.0.9 --- packages/webapp/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webapp/package.json b/packages/webapp/package.json index cf5225aa..ef72bd5b 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -1,6 +1,6 @@ { "name": "@wisemapping/webapp", - "version": "5.0.8", + "version": "5.0.9", "main": "app.jsx", "scripts": { "start": "webpack serve --config webpack.dev.js ", From 08242dcbadf7fd37507cbcc2c6898406424b6c7a Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 00:17:41 -0300 Subject: [PATCH 09/24] Fix time display on de and zh --- packages/mindplot/package.json | 2 +- packages/webapp/src/classes/app-i18n/index.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/mindplot/package.json b/packages/mindplot/package.json index e8833eaf..1eeb1747 100644 --- a/packages/mindplot/package.json +++ b/packages/mindplot/package.json @@ -1,6 +1,6 @@ { "name": "@wisemapping/mindplot", - "version": "5.0.8", + "version": "5.0.9", "description": "WiseMapping - Mindplot Canvas Library", "homepage": "http://www.wisemapping.org/", "directories": { diff --git a/packages/webapp/src/classes/app-i18n/index.ts b/packages/webapp/src/classes/app-i18n/index.ts index e5af79f5..48cfa9a2 100644 --- a/packages/webapp/src/classes/app-i18n/index.ts +++ b/packages/webapp/src/classes/app-i18n/index.ts @@ -2,7 +2,9 @@ import { fetchAccount } from './../../redux/clientSlice'; import 'dayjs/locale/fr'; import 'dayjs/locale/en'; import 'dayjs/locale/es'; +import 'dayjs/locale/de'; import 'dayjs/locale/ru'; +import 'dayjs/locale/zh'; export class Locale { code: LocaleCode; From 8e263e4047c041c84cf29e5f0e38a5e4311d18dd Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 00:27:04 -0300 Subject: [PATCH 10/24] Change add note shorcut to avoid collision with chrome shortcuts --- packages/editor/src/classes/menu/KeyboardShortcutDialog.js | 4 ++-- packages/mindplot/src/components/DesignerKeyboard.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/editor/src/classes/menu/KeyboardShortcutDialog.js b/packages/editor/src/classes/menu/KeyboardShortcutDialog.js index 99e82694..dda05336 100644 --- a/packages/editor/src/classes/menu/KeyboardShortcutDialog.js +++ b/packages/editor/src/classes/menu/KeyboardShortcutDialog.js @@ -128,8 +128,8 @@ class KeyboardShortcutDialog extends BootstrapDialog { ${$msg('TOPIC_NOTE')} - Ctrl + n - ⌘ + n + Ctrl + k + ⌘ + k ${$msg('TOPIC_LINK')} diff --git a/packages/mindplot/src/components/DesignerKeyboard.ts b/packages/mindplot/src/components/DesignerKeyboard.ts index 278de869..e7050f0b 100644 --- a/packages/mindplot/src/components/DesignerKeyboard.ts +++ b/packages/mindplot/src/components/DesignerKeyboard.ts @@ -125,7 +125,7 @@ class DesignerKeyboard extends Keyboard { }, ); this.addShortcut( - ['ctrl+n', 'meta+n'], (event: Event) => { + ['ctrl+k', 'meta+k'], (event: Event) => { event.preventDefault(); event.stopPropagation(); designer.addNote(); From 7701d00159a71f23eaf3afb2be375b0020c8f779 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 00:37:42 -0300 Subject: [PATCH 11/24] Add type infomation to deserializer --- .../src/components/persistence/XMLSerializerTango.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts index a0a47be0..cf074747 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts +++ b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts @@ -25,6 +25,7 @@ import NodeModel from '../model/NodeModel'; import RelationshipModel from '../model/RelationshipModel'; import XMLMindmapSerializer from './XMLMindmapSerializer'; import FeatureType from '../model/FeatureType'; +import Relationship from '../Relationship'; class XMLSerializerTango implements XMLMindmapSerializer { private static MAP_ROOT_NODE = 'map'; @@ -457,7 +458,7 @@ class XMLSerializerTango implements XMLMindmapSerializer { return value; } - static _deserializeRelationship(domElement, mindmap) { + static _deserializeRelationship(domElement: Element, mindmap: Mindmap): RelationshipModel { const srcId = Number.parseInt(domElement.getAttribute('srcTopicId'), 10); const destId = Number.parseInt(domElement.getAttribute('destTopicId'), 10); const lineType = Number.parseInt(domElement.getAttribute('lineType'), 10); @@ -468,6 +469,7 @@ class XMLSerializerTango implements XMLMindmapSerializer { if (srcId === destId) { throw new Error('Invalid relationship, dest and source are equals'); } + // Is the connections points valid ?. If it's not, do not load the relationship ... if (mindmap.findNodeById(srcId) == null || mindmap.findNodeById(destId) == null) { throw new Error('Transition could not created, missing node for relationship'); @@ -481,8 +483,9 @@ class XMLSerializerTango implements XMLMindmapSerializer { if ($defined(destCtrlPoint) && destCtrlPoint !== '') { model.setDestCtrlPoint(Point.fromString(destCtrlPoint)); } - model.setEndArrow('false'); - model.setStartArrow('true'); + + model.setEndArrow(false); + model.setStartArrow(true); return model; } From fdfb67a5fefeaf56c0d30b48644ee26c2632d151 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 00:52:19 -0300 Subject: [PATCH 12/24] Update automation tests --- .../persistence/XMLSerializerTango.ts | 4 +-- .../test/unit/export/expected/bug2.md | 10 +++---- .../test/unit/export/expected/bug2.mm | 12 ++++----- .../test/unit/export/expected/bug2.txt | 26 +++++++++---------- .../test/unit/export/expected/bug2.wxml | 4 +-- .../test/unit/export/expected/bug3.mm | 4 +-- .../test/unit/export/expected/complex.wxml | 4 +-- .../mindplot/test/unit/export/expected/enc.md | 2 +- .../mindplot/test/unit/export/expected/enc.mm | 2 +- .../test/unit/export/expected/enc.txt | 6 ++--- .../test/unit/export/expected/enc.wxml | 6 ++--- .../test/unit/export/expected/process.mm | 4 +-- .../test/unit/export/expected/welcome.mm | 2 +- 13 files changed, 42 insertions(+), 44 deletions(-) diff --git a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts index cf074747..e8e7b719 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts +++ b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts @@ -25,7 +25,6 @@ import NodeModel from '../model/NodeModel'; import RelationshipModel from '../model/RelationshipModel'; import XMLMindmapSerializer from './XMLMindmapSerializer'; import FeatureType from '../model/FeatureType'; -import Relationship from '../Relationship'; class XMLSerializerTango implements XMLMindmapSerializer { private static MAP_ROOT_NODE = 'map'; @@ -446,7 +445,7 @@ class XMLSerializerTango implements XMLMindmapSerializer { return value; } - static _deserializeNodeText(domElem) { + static _deserializeNodeText(domElem: ChildNode) { const children = domElem.childNodes; let value = null; for (let i = 0; i < children.length; i++) { @@ -483,7 +482,6 @@ class XMLSerializerTango implements XMLMindmapSerializer { if ($defined(destCtrlPoint) && destCtrlPoint !== '') { model.setDestCtrlPoint(Point.fromString(destCtrlPoint)); } - model.setEndArrow(false); model.setStartArrow(true); return model; diff --git a/packages/mindplot/test/unit/export/expected/bug2.md b/packages/mindplot/test/unit/export/expected/bug2.md index 2dd2052f..ea1c7fc8 100644 --- a/packages/mindplot/test/unit/export/expected/bug2.md +++ b/packages/mindplot/test/unit/export/expected/bug2.md @@ -6,14 +6,14 @@ - Naturaleza - Animales, Plantas, Piedras - Arqueología + - Culturas Antiguas + - Egipto, Grecia, China... - Energía + - Paleontología - Astronomía - Arquitectura - Cocina - Poesía - - Culturas Antiguas - - Egipto, Grecia, China... - - Paleontología - Duración limitada: 5-6 semanas - Niños y niñas que quieren saber más - Alternativa a otras actividades de ocio @@ -25,11 +25,11 @@ - Actividades centradas en el contexto cercano - Flexibilidad en el uso de las lenguas de trabajo (inglés, castellano, esukara?) - Complementamos el trabajo de la escuela[^1] + - SaberMás trabaja con, desde y para la motivación + - Trabajamos en equipo en nuestros proyectos - Cada uno va a su ritmo, y cada cual pone sus límites - Aprendemos todos de todos - Valoramos lo que hemos aprendido - - SaberMás trabaja con, desde y para la motivación - - Trabajamos en equipo en nuestros proyectos diff --git a/packages/mindplot/test/unit/export/expected/bug2.mm b/packages/mindplot/test/unit/export/expected/bug2.mm index 3baf15c5..ccd871e5 100644 --- a/packages/mindplot/test/unit/export/expected/bug2.mm +++ b/packages/mindplot/test/unit/export/expected/bug2.mm @@ -7,15 +7,15 @@ + + + + - - - - @@ -41,11 +41,11 @@ + + - - \ No newline at end of file diff --git a/packages/mindplot/test/unit/export/expected/bug2.txt b/packages/mindplot/test/unit/export/expected/bug2.txt index 426423e8..829e3610 100644 --- a/packages/mindplot/test/unit/export/expected/bug2.txt +++ b/packages/mindplot/test/unit/export/expected/bug2.txt @@ -5,14 +5,14 @@ 1.3.1 Naturaleza 1.3.1.1 Animales, Plantas, Piedras 1.3.2 Arqueología - 1.3.3 Energía - 1.3.4 Astronomía - 1.3.5 Arquitectura - 1.3.6 Cocina - 1.3.7 Poesía - 1.3.8 Culturas Antiguas - 1.3.8.1 Egipto, Grecia, China... - 1.3.9 Paleontología + 1.3.3 Culturas Antiguas + 1.3.3.1 Egipto, Grecia, China... + 1.3.4 Energía + 1.3.5 Paleontología + 1.3.6 Astronomía + 1.3.7 Arquitectura + 1.3.8 Cocina + 1.3.9 Poesía 1.4 Duración limitada: 5-6 semanas 1.5 Niños y niñas que quieren saber más 1.6 Alternativa a otras actividades de ocio @@ -30,8 +30,8 @@ ayudándole a que encuentre respuesta a las preguntas que él o ella se plantea. Por ese motivo, SaberMás proyecta estar al lado de los niños que necesitan una motivación extra para entender la escuela y fluir en ella, y también al lado de aquellos a quienes la curiosidad y las ganas de saber les lleva más allá.] - 1.14.1 Cada uno va a su ritmo, y cada cual pone sus límites - 1.14.2 Aprendemos todos de todos - 1.14.3 Valoramos lo que hemos aprendido - 1.14.4 SaberMás trabaja con, desde y para la motivación - 1.14.5 Trabajamos en equipo en nuestros proyectos + 1.14.1 SaberMás trabaja con, desde y para la motivación + 1.14.2 Trabajamos en equipo en nuestros proyectos + 1.14.3 Cada uno va a su ritmo, y cada cual pone sus límites + 1.14.4 Aprendemos todos de todos + 1.14.5 Valoramos lo que hemos aprendido diff --git a/packages/mindplot/test/unit/export/expected/bug2.wxml b/packages/mindplot/test/unit/export/expected/bug2.wxml index 227024c2..65ae6963 100644 --- a/packages/mindplot/test/unit/export/expected/bug2.wxml +++ b/packages/mindplot/test/unit/export/expected/bug2.wxml @@ -1,6 +1,6 @@ - \ No newline at end of file + y también al lado de aquellos a quienes la curiosidad y las ganas de saber les lleva más allá.]]> \ No newline at end of file diff --git a/packages/mindplot/test/unit/export/expected/bug3.mm b/packages/mindplot/test/unit/export/expected/bug3.mm index ebbb2f0b..4cd9b74b 100644 --- a/packages/mindplot/test/unit/export/expected/bug3.mm +++ b/packages/mindplot/test/unit/export/expected/bug3.mm @@ -332,7 +332,7 @@ - + @@ -944,7 +944,7 @@ - + diff --git a/packages/mindplot/test/unit/export/expected/complex.wxml b/packages/mindplot/test/unit/export/expected/complex.wxml index 91268870..76b3603a 100644 --- a/packages/mindplot/test/unit/export/expected/complex.wxml +++ b/packages/mindplot/test/unit/export/expected/complex.wxml @@ -1,5 +1,5 @@ + @@ -117,7 +118,6 @@ - diff --git a/packages/mindplot/test/unit/export/expected/enc.txt b/packages/mindplot/test/unit/export/expected/enc.txt index 616c6491..ab0dd50b 100644 --- a/packages/mindplot/test/unit/export/expected/enc.txt +++ b/packages/mindplot/test/unit/export/expected/enc.txt @@ -41,7 +41,8 @@ the investment in complete sampling may be worthwhile for at least some traits. [Note: Falar que isso corrobora nossa sugestão de utilizar poucas medidas, mas que elas sejam confiáveis.] 1.2 Chazdon 2010. Biotropica. 42(1): 31–40 - 1.2.1 Here, we develop a new approach that links functional attributes + 1.2.1 Falar no artigo que esse trabalho fala que é inadequada a divisão entre pioneira e não pioneira devido a grande variação que há entre elas. Além de terem descoberto que durante a ontogenia a resposta a luminosidade muda dentro de uma mesma espécie. Porém recomendar que essa classificação continue sendo usada em curto prazo enquanto não há informações confiáveis suficiente para esta simples classificação. Outras classificações como esta do artigo são bem vinda, contanto que tenham dados confiáveis. Porém dados estáticos já são difíceis de se obter, dados temporais, como taxa de crescimento em diâmetro ou altura, são mais difíceis ainda. Falar que vários tipos de classificações podem ser utilizadas e quanto mais detalhe melhor, porém os dados é que são mais limitantes. Se focarmos em dados de germinação e crescimento limitantes, como sugerem sainete e whitmore, da uma idéia maismrápida e a curto prazo da classificação destas espécies. Depois com o tempo conseguiremos construir classificações mais detalhadas e com mais dados confiáveis. + 1.2.2 Here, we develop a new approach that links functional attributes of tree species with studies of forest recovery and regional land-use transitions (Chazdon et al. 2007). Grouping species according to their functional attributes or demographic rates provides @@ -49,12 +50,11 @@ insight into both applied and theoretical questions, such as selecting species for reforestation programs, assessing ecosystem services, and understanding community assembly processes in tropical forests (Diaz et al. 2007, Kraft et al. 2008). - 1.2.2 Since we have data on leaf + 1.2.3 Since we have data on leaf and wood functional traits for only a subset of the species in our study sites, we based our functional type classification on information for a large number of tree species obtained through vegetation monitoring studies. - 1.2.3 Falar no artigo que esse trabalho fala que é inadequada a divisão entre pioneira e não pioneira devido a grande variação que há entre elas. Além de terem descoberto que durante a ontogenia a resposta a luminosidade muda dentro de uma mesma espécie. Porém recomendar que essa classificação continue sendo usada em curto prazo enquanto não há informações confiáveis suficiente para esta simples classificação. Outras classificações como esta do artigo são bem vinda, contanto que tenham dados confiáveis. Porém dados estáticos já são difíceis de se obter, dados temporais, como taxa de crescimento em diâmetro ou altura, são mais difíceis ainda. Falar que vários tipos de classificações podem ser utilizadas e quanto mais detalhe melhor, porém os dados é que são mais limitantes. Se focarmos em dados de germinação e crescimento limitantes, como sugerem sainete e whitmore, da uma idéia maismrápida e a curto prazo da classificação destas espécies. Depois com o tempo conseguiremos construir classificações mais detalhadas e com mais dados confiáveis. 1.2.4 Our approach avoided preconceived notions of successional behavior or shade tolerance of tree species by developing an objective and independent classification of functional types based on vegetation diff --git a/packages/mindplot/test/unit/export/expected/enc.wxml b/packages/mindplot/test/unit/export/expected/enc.wxml index b4136958..8194da80 100644 --- a/packages/mindplot/test/unit/export/expected/enc.wxml +++ b/packages/mindplot/test/unit/export/expected/enc.wxml @@ -28,18 +28,18 @@ failed to accurately estimate the variance of trait values. This indicates that in situations where accurate estimation of plotlevel variance is desired, complete censuses are essential.]]> - - + + diff --git a/packages/mindplot/test/unit/export/expected/welcome.mm b/packages/mindplot/test/unit/export/expected/welcome.mm index d4497d04..e9c6cde4 100644 --- a/packages/mindplot/test/unit/export/expected/welcome.mm +++ b/packages/mindplot/test/unit/export/expected/welcome.mm @@ -12,7 +12,7 @@ - + From fdbad76428bf5e8b7accb19fae03df2f9046e5bf Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 14:37:45 -0300 Subject: [PATCH 13/24] Fix location resources. --- packages/editor/package.json | 4 +-- packages/webapp/lang/en.json | 5 +++- packages/webapp/lang/zh.json | 12 ++++----- packages/webapp/package.json | 4 +-- packages/webapp/src/classes/app-i18n/index.ts | 2 +- packages/webapp/src/compiled-lang/en.json | 26 +++++++++++++++++-- packages/webapp/src/compiled-lang/zh.json | 12 ++++----- 7 files changed, 45 insertions(+), 20 deletions(-) diff --git a/packages/editor/package.json b/packages/editor/package.json index b08accde..7d88d4be 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -8,8 +8,8 @@ "cy:run": "cypress run", "test:integration": "start-server-and-test 'yarn playground' http-get://localhost:8081 'yarn cy:run'", "test": "yarn test:integration", - "extract": "for lang in {'es','en','fr','de'};do formatjs extract 'src/**/*.ts*' --ignore 'src/@types/**/*' --out-file lang/${lang}.json;done", - "compile": "formatjs compile" + "i18n:extract": "formatjs extract 'src/**/*.ts*' --ignore 'src/@types/**/*' --out-file lang/es.json", + "i18n:compile": "for lang in {'es','en','fr','de','zh','ru'};do formatjs compile lang/${lang}.json --ast --out-file src/compiled-lang/${lang}.json;done" }, "repository": "http://www.wisemapping.com", "author": "Paulo Veiga , Ezequiel Bergamaschi ", diff --git a/packages/webapp/lang/en.json b/packages/webapp/lang/en.json index c744821f..b6dc8426 100644 --- a/packages/webapp/lang/en.json +++ b/packages/webapp/lang/en.json @@ -258,7 +258,7 @@ "defaultMessage": "Add label" }, "label.add-for": { - "defaultMessage": "Editing labels for maps:" + "defaultMessage": "Editing labels for" }, "label.add-placeholder": { "defaultMessage": "Label title" @@ -275,6 +275,9 @@ "label.description": { "defaultMessage": "Use labels to organize your maps." }, + "label.maps-count": { + "defaultMessage": "{count} maps" + }, "label.title": { "defaultMessage": "Add a label" }, diff --git a/packages/webapp/lang/zh.json b/packages/webapp/lang/zh.json index 2629fedd..8fbeab6a 100644 --- a/packages/webapp/lang/zh.json +++ b/packages/webapp/lang/zh.json @@ -1,5 +1,5 @@ { - "account.delete-warning": { + "account.delete-warning警告": { "defaultMessage": "请记住,您将无法访问您添加的任何思维导图。您的所有信息都将被删除,并且无法恢复。" }, "accountinfo.button": { @@ -249,7 +249,7 @@ "defaultMessage": "分享" }, "info.starred": { - "defaultMessage": "星标" + "defaultMessage": "收藏" }, "info.title": { "defaultMessage": "信息" @@ -364,16 +364,16 @@ "defaultMessage": "所有" }, "maps.nav-onwned": { - "defaultMessage": "拥有" + "defaultMessage": "我的" }, "maps.nav-public": { - "defaultMessage": "公共" + "defaultMessage": "公开" }, "maps.nav-shared": { "defaultMessage": "与我分享" }, "maps.nav-starred": { - "defaultMessage": "星标" + "defaultMessage": "收藏" }, "maps.page-title": { "defaultMessage": "我的脑图|WiseMapping" @@ -388,7 +388,7 @@ "defaultMessage": "打开编辑" }, "maps.tooltip-starred": { - "defaultMessage": "星标" + "defaultMessage": "收藏" }, "maps.view": { "defaultMessage": "查看" diff --git a/packages/webapp/package.json b/packages/webapp/package.json index ef72bd5b..050678a5 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -9,8 +9,8 @@ "lint": "eslint src", "cy:run": "cypress run", "test:integration": "start-server-and-test start http-get://localhost:3000 cy:run", - "extract": "formatjs extract 'src/**/*.ts*' --ignore 'src/@types/**/*' --out-file lang/en.json", - "compile": "formatjs compile", + "i18n:extract": "formatjs extract 'src/**/*.ts*' --ignore 'src/@types/**/*' --out-file lang/en.json", + "i18n:compile": "for lang in {'es','en','fr','de','zh','ru'};do formatjs compile lang/${lang}.json --ast --out-file src/compiled-lang/${lang}.json;done", "test": "yarn test:integration" }, "files": [ diff --git a/packages/webapp/src/classes/app-i18n/index.ts b/packages/webapp/src/classes/app-i18n/index.ts index 48cfa9a2..9dbb79dc 100644 --- a/packages/webapp/src/classes/app-i18n/index.ts +++ b/packages/webapp/src/classes/app-i18n/index.ts @@ -57,7 +57,7 @@ export const Locales = { DE: new Locale('fr', 'Français', require('./../../compiled-lang/fr.json')), // eslint-disable-line FR: new Locale('de', 'Deutsch', require('./../../compiled-lang/de.json')), // eslint-disable-line RU: new Locale('ru', 'Pусский', require('./../../compiled-lang/ru.json')), // eslint-disable-line - ZH: new Locale('zh', '中文', require('./../../compiled-lang/zh.json')), // eslint-disable-line + ZH: new Locale('zh', '中文 (简体)', require('./../../compiled-lang/zh.json')), // eslint-disable-line }; diff --git a/packages/webapp/src/compiled-lang/en.json b/packages/webapp/src/compiled-lang/en.json index b473d642..048200d6 100644 --- a/packages/webapp/src/compiled-lang/en.json +++ b/packages/webapp/src/compiled-lang/en.json @@ -275,6 +275,12 @@ "value": "Image: Get a graphic representation of your map including all colors and shapes." } ], + "export.img-center": [ + { + "type": 0, + "value": "Center and zoom to fit" + } + ], "export.title": [ { "type": 0, @@ -512,7 +518,7 @@ "label.add-for": [ { "type": 0, - "value": "Editing labels for maps:" + "value": "Editing labels for" } ], "label.add-placeholder": [ @@ -545,6 +551,16 @@ "value": "Use labels to organize your maps." } ], + "label.maps-count": [ + { + "type": 1, + "value": "count" + }, + { + "type": 0, + "value": " maps" + } + ], "label.title": [ { "type": 0, @@ -887,6 +903,12 @@ "value": "Last Name" } ], + "registration.page-title": [ + { + "type": 0, + "value": "Registration | WiseMapping" + } + ], "registration.password": [ { "type": 0, @@ -914,7 +936,7 @@ "registration.title": [ { "type": 0, - "value": "Registration | WiseMapping" + "value": "Become a member" } ], "rename.description": [ diff --git a/packages/webapp/src/compiled-lang/zh.json b/packages/webapp/src/compiled-lang/zh.json index b249b5b4..6a386e91 100644 --- a/packages/webapp/src/compiled-lang/zh.json +++ b/packages/webapp/src/compiled-lang/zh.json @@ -1,5 +1,5 @@ { - "account.delete-warning": [ + "account.delete-warning警告": [ { "type": 0, "value": "请记住,您将无法访问您添加的任何思维导图。您的所有信息都将被删除,并且无法恢复。" @@ -500,7 +500,7 @@ "info.starred": [ { "type": 0, - "value": "星标" + "value": "收藏" } ], "info.title": [ @@ -740,13 +740,13 @@ "maps.nav-onwned": [ { "type": 0, - "value": "拥有" + "value": "我的" } ], "maps.nav-public": [ { "type": 0, - "value": "公共" + "value": "公开" } ], "maps.nav-shared": [ @@ -758,7 +758,7 @@ "maps.nav-starred": [ { "type": 0, - "value": "星标" + "value": "收藏" } ], "maps.page-title": [ @@ -788,7 +788,7 @@ "maps.tooltip-starred": [ { "type": 0, - "value": "星标" + "value": "收藏" } ], "maps.view": [ From ce284a12024343d05aacb2024bef87b2b1c0b36b Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 14:47:42 -0300 Subject: [PATCH 14/24] Fix i18n issue on editor dialog --- .../src/components/editor-page/index.tsx | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index 2651230f..53f72be4 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -3,14 +3,15 @@ import ActionDispatcher from '../maps-page/action-dispatcher'; import { ActionType } from '../maps-page/action-chooser'; import Editor from '@wisemapping/editor'; import { EditorRenderMode, PersistenceManager } from '@wisemapping/mindplot'; - -import AppI18n from '../../classes/app-i18n'; +import { IntlProvider } from 'react-intl'; +import AppI18n, { Locales } from '../../classes/app-i18n'; import { useSelector } from 'react-redux'; import { hotkeysEnabled } from '../../redux/editorSlice'; import ReactGA from 'react-ga'; import Client from '../../classes/client'; import { activeInstance, fetchAccount, fetchMapById } from '../../redux/clientSlice'; -import EditorOptionsBuilder from './EditorOptionsBuilder'; +import EditorOptionsBulder from './EditorOptionsBuider'; + export type EditorPropsType = { isTryMode: boolean; @@ -23,7 +24,6 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { const client: Client = useSelector(activeInstance); useEffect(() => { - document.title = `${global.mapTitle ? global.mapTitle : 'unknown'} | WiseMapping `; ReactGA.pageview(window.location.pathname + window.location.search); }, []); @@ -37,16 +37,16 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { const fetchResult = fetchMapById(mapId); if (!fetchResult.isLoading) { if (fetchResult.error) { - throw new Error(`Map information could not be loaded: ${JSON.stringify(fetchResult)}`); + throw new Error(`User coild not be loaded: ${JSON.stringify(fetchResult.error)}`); } - result = `edition-${fetchResult?.map?.role}`; + result = fetchResult.map.role === 'owner' ? 'edition-owner' : 'edition-editor'; } } return result; } // What is the role ? - const mapId = EditorOptionsBuilder.loadMapId(); + const mapId = EditorOptionsBulder.loadMapId(); const mode = findEditorMode(isTryMode, mapId); // Account settings can be null and editor cannot be initilized multiple times. This creates problems @@ -56,12 +56,16 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { let options, persistence: PersistenceManager; if (loadCompleted) { - options = EditorOptionsBuilder.build(userLocale.code, mode, hotkey); + options = EditorOptionsBulder.build(userLocale.code, mode, hotkey); persistence = client.buildPersistenceManager(mode); } return loadCompleted ? ( - <> + } + > { fromEditor /> } - ) : <> + ) : <> } From 034d514cb58713669068df4e96170ba48eb71284 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 14:57:07 -0300 Subject: [PATCH 15/24] Fix compilation --- .../src/components/editor-page/EditorOptionsBuilder.ts | 5 +++-- packages/webapp/src/components/editor-page/index.tsx | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/webapp/src/components/editor-page/EditorOptionsBuilder.ts b/packages/webapp/src/components/editor-page/EditorOptionsBuilder.ts index cf6a2ff7..2a00ab1e 100644 --- a/packages/webapp/src/components/editor-page/EditorOptionsBuilder.ts +++ b/packages/webapp/src/components/editor-page/EditorOptionsBuilder.ts @@ -2,7 +2,7 @@ import { EditorOptions } from '@wisemapping/editor'; import { EditorRenderMode } from '@wisemapping/mindplot'; import AppConfig from '../../classes/app-config'; -export default class EditorOptionsBuilder { +class EditorOptionsBuilder { static build(locale: string, mode: EditorRenderMode, hotkeys: boolean): EditorOptions { let options: EditorOptions = { @@ -37,4 +37,5 @@ export default class EditorOptionsBuilder { static loadMapId(): number { return !AppConfig.isDevelopEnv() ? global.mapId : 11; } -} \ No newline at end of file +} +export default EditorOptionsBuilder; diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index 53f72be4..bef42b0b 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -10,8 +10,7 @@ import { hotkeysEnabled } from '../../redux/editorSlice'; import ReactGA from 'react-ga'; import Client from '../../classes/client'; import { activeInstance, fetchAccount, fetchMapById } from '../../redux/clientSlice'; -import EditorOptionsBulder from './EditorOptionsBuider'; - +import EditorOptionsBuilder from './EditorOptionsBuilder'; export type EditorPropsType = { isTryMode: boolean; @@ -46,7 +45,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { } // What is the role ? - const mapId = EditorOptionsBulder.loadMapId(); + const mapId = EditorOptionsBuilder.loadMapId(); const mode = findEditorMode(isTryMode, mapId); // Account settings can be null and editor cannot be initilized multiple times. This creates problems @@ -56,7 +55,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { let options, persistence: PersistenceManager; if (loadCompleted) { - options = EditorOptionsBulder.build(userLocale.code, mode, hotkey); + options = EditorOptionsBuilder.build(userLocale.code, mode, hotkey); persistence = client.buildPersistenceManager(mode); } From b84d7f333834d490e8d79a17f4100b5a35dc340e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 15:18:31 -0300 Subject: [PATCH 16/24] Fix hardcoded resources --- packages/mindplot/src/components/lang/de.js | 2 +- packages/mindplot/src/components/lang/en.js | 1 + packages/mindplot/src/components/lang/es.js | 1 + packages/mindplot/src/components/lang/fr.js | 1 + packages/mindplot/src/components/lang/ru.js | 1 + packages/mindplot/src/components/lang/zh.js | 2 ++ packages/mindplot/src/components/widget/LinkEditor.js | 2 +- packages/mindplot/src/components/widget/NoteEditor.js | 2 +- 8 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/mindplot/src/components/lang/de.js b/packages/mindplot/src/components/lang/de.js index 90308caa..c2cb2111 100644 --- a/packages/mindplot/src/components/lang/de.js +++ b/packages/mindplot/src/components/lang/de.js @@ -79,7 +79,7 @@ const DE = { MULTIPLE_LINES: 'Füge mehrer Textzeilen hinzu', BACK_TO_MAP_LIST: 'Zurück zur Kartenliste', KEYBOARD_SHOTCUTS: 'Tastaturkürzel', - + PASTE_URL_HERE: 'Fügen Sie hier die gewünschte URL-Adresse ein:', }; export default DE; diff --git a/packages/mindplot/src/components/lang/en.js b/packages/mindplot/src/components/lang/en.js index 751055e3..0ebe385f 100644 --- a/packages/mindplot/src/components/lang/en.js +++ b/packages/mindplot/src/components/lang/en.js @@ -79,6 +79,7 @@ const EN = { MULTIPLE_LINES: 'Add multiple text lines', BACK_TO_MAP_LIST: 'Back to Maps List', KEYBOARD_SHOTCUTS: 'Keyboard Shorcuts', + PASTE_URL_HERE: 'Paste your url address here:', }; export default EN; diff --git a/packages/mindplot/src/components/lang/es.js b/packages/mindplot/src/components/lang/es.js index 7e052167..87f65188 100644 --- a/packages/mindplot/src/components/lang/es.js +++ b/packages/mindplot/src/components/lang/es.js @@ -79,6 +79,7 @@ const ES = { MULTIPLE_LINES: 'Ajouter plusieurs lignes de texte', BACK_TO_MAP_LIST: 'Volver a la lista de mapas', KEYBOARD_SHOTCUTS: 'Métodos abreviados de teclado', + PASTE_URL_HERE: 'Copie la URL que desea aca:', }; export default ES; diff --git a/packages/mindplot/src/components/lang/fr.js b/packages/mindplot/src/components/lang/fr.js index 2356e2c3..f8a90848 100644 --- a/packages/mindplot/src/components/lang/fr.js +++ b/packages/mindplot/src/components/lang/fr.js @@ -79,6 +79,7 @@ const FR = { MULTIPLE_LINES: 'Ajouter plusieurs lignes de texte', BACK_TO_MAP_LIST: 'Retour à la liste des cartes', KEYBOARD_SHOTCUTS: 'Raccourcis clavier', + PASTE_URL_HERE: 'Collez l\'adresse URL souhaitée ici :', }; export default FR; diff --git a/packages/mindplot/src/components/lang/ru.js b/packages/mindplot/src/components/lang/ru.js index 751055e3..d962cd26 100644 --- a/packages/mindplot/src/components/lang/ru.js +++ b/packages/mindplot/src/components/lang/ru.js @@ -79,6 +79,7 @@ const EN = { MULTIPLE_LINES: 'Add multiple text lines', BACK_TO_MAP_LIST: 'Back to Maps List', KEYBOARD_SHOTCUTS: 'Keyboard Shorcuts', + PASTE_URL_HERE: 'Вставьте нужный URL-адрес здесь:', }; export default EN; diff --git a/packages/mindplot/src/components/lang/zh.js b/packages/mindplot/src/components/lang/zh.js index b4eb5c96..ef262eef 100644 --- a/packages/mindplot/src/components/lang/zh.js +++ b/packages/mindplot/src/components/lang/zh.js @@ -79,6 +79,8 @@ const ZH = { MULTIPLE_LINES: '添加多行文本', BACK_TO_MAP_LIST: '回到脑图列表', KEYBOARD_SHOTCUTS: '键盘快捷键', + PASTE_URL_HERE: '在此处粘贴所需的 URL 地址:', + }; export default ZH; diff --git a/packages/mindplot/src/components/widget/LinkEditor.js b/packages/mindplot/src/components/widget/LinkEditor.js index cc83f2f8..681429c1 100644 --- a/packages/mindplot/src/components/widget/LinkEditor.js +++ b/packages/mindplot/src/components/widget/LinkEditor.js @@ -49,7 +49,7 @@ class LinkEditor extends BootstrapDialog { action: 'none', id: 'linkFormId', }); - const text = $('

').text('Paste your url here:'); + const text = $('

').text($msg('PASTE_URL_HERE')); text.css('margin', '0px 0px 20px'); this.form.append(text); diff --git a/packages/mindplot/src/components/widget/NoteEditor.js b/packages/mindplot/src/components/widget/NoteEditor.js index 584aa376..3d127996 100644 --- a/packages/mindplot/src/components/widget/NoteEditor.js +++ b/packages/mindplot/src/components/widget/NoteEditor.js @@ -23,7 +23,7 @@ import { $msg } from '../Messages'; class NoteEditor extends BootstrapDialog { constructor(model) { $assert(model, 'model can not be null'); - super($msg('Note'), { + super($msg('NOTE'), { cancelButton: true, closeButton: true, acceptButton: true, From ee3b5e6ea4bfda6b580335ed9a3fbc53ab75f49c Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 22:59:25 -0300 Subject: [PATCH 17/24] Fix resource in Chinese --- packages/webapp/lang/zh.json | 4 ++-- packages/webapp/src/compiled-lang/zh.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/webapp/lang/zh.json b/packages/webapp/lang/zh.json index 8fbeab6a..ab4be629 100644 --- a/packages/webapp/lang/zh.json +++ b/packages/webapp/lang/zh.json @@ -135,7 +135,7 @@ "defaultMessage": "文档:将你的思维导图导出到一个独立的文档中来分享" }, "export.image": { - "defaultMessage": "Image: Get a graphic representation of your map including all colors and shapes.图像:以图片形式获取包含所有颜色和形状的脑图" + "defaultMessage": "图像:以图片形式获取包含所有颜色和形状的脑图" }, "export.img-center": { "defaultMessage": "居中并缩放合适大小" @@ -430,7 +430,7 @@ "defaultMessage": "注册成功|WiseMapping" }, "registration.desc": { - "defaultMessage": "Signing up is free and just take a moment注册免费,分分钟就好" + "defaultMessage": "注册免费,分分钟就好" }, "registration.email": { "defaultMessage": "电子邮件" diff --git a/packages/webapp/src/compiled-lang/zh.json b/packages/webapp/src/compiled-lang/zh.json index 6a386e91..f2bdbe7f 100644 --- a/packages/webapp/src/compiled-lang/zh.json +++ b/packages/webapp/src/compiled-lang/zh.json @@ -272,7 +272,7 @@ "export.image": [ { "type": 0, - "value": "Image: Get a graphic representation of your map including all colors and shapes.图像:以图片形式获取包含所有颜色和形状的脑图" + "value": "图像:以图片形式获取包含所有颜色和形状的脑图" } ], "export.img-center": [ @@ -872,7 +872,7 @@ "registration.desc": [ { "type": 0, - "value": "Signing up is free and just take a moment注册免费,分分钟就好" + "value": "注册免费,分分钟就好" } ], "registration.email": [ From 75274e5cc84f0eda9d446a180754efb5568ba966 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 23:17:28 -0300 Subject: [PATCH 18/24] Add local storage of user settings locale. --- packages/webapp/src/classes/app-i18n/index.ts | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/webapp/src/classes/app-i18n/index.ts b/packages/webapp/src/classes/app-i18n/index.ts index 9dbb79dc..e3354608 100644 --- a/packages/webapp/src/classes/app-i18n/index.ts +++ b/packages/webapp/src/classes/app-i18n/index.ts @@ -19,13 +19,21 @@ export class Locale { } export default abstract class AppI18n { + private static LOCAL_STORAGE_KEY = 'user.locale'; + public static getUserLocale(): Locale { // @Todo Hack: Try page must not account info. Add this to avoid 403 errors. const isTryPage = window.location.href.endsWith('/try'); let result: Locale; if (!isTryPage) { const account = fetchAccount(); - result = account?.locale ? account.locale : this.getBrowserLocale(); + result = account?.locale ? account.locale : this.getDefaultLocale(); + + // If the local storage value is different, update ... + if (account?.locale && result.code !== localStorage.getItem(AppI18n.LOCAL_STORAGE_KEY)) { + localStorage.setItem(AppI18n.LOCAL_STORAGE_KEY, result.code); + } + } else { result = this.getBrowserLocale(); } @@ -47,6 +55,21 @@ export default abstract class AppI18n { return result; } + + public static getDefaultLocale(): Locale { + // Fetch local from local storage ... + let result: Locale; + const userLocaleCode: string = localStorage.getItem(AppI18n.LOCAL_STORAGE_KEY); + if (userLocaleCode) { + result = localeFromStr(userLocaleCode); + } + + // Ok, use browser default ... + if (!result) { + result = this.getBrowserLocale(); + } + return result; + } } export type LocaleCode = 'en' | 'es' | 'fr' | 'de' | 'ru' | 'zh'; From 0f8d3a3c89dc51df85cca2f5b45890f70214bdcd Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 23:19:03 -0300 Subject: [PATCH 19/24] Minor change. --- packages/webapp/src/app.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index f5b1ac02..2cc517fc 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -38,7 +38,7 @@ const queryClient = new QueryClient({ }); const App = (): ReactElement => { - const locale = AppI18n.getBrowserLocale(); + const locale = AppI18n.getDefaultLocale(); const EnhacedEditorPage = withSessionExpirationHandling(EditorPage); return locale.message ? ( @@ -81,7 +81,7 @@ const App = (): ReactElement => { component={withSessionExpirationHandling(MapsPage)} /> - + From 152d7d9fad9ff8ac7803f2c915ed945362464ccc Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 14 Mar 2022 23:20:58 -0300 Subject: [PATCH 20/24] Change locale resolution --- packages/webapp/src/classes/app-i18n/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webapp/src/classes/app-i18n/index.ts b/packages/webapp/src/classes/app-i18n/index.ts index e3354608..3019ea71 100644 --- a/packages/webapp/src/classes/app-i18n/index.ts +++ b/packages/webapp/src/classes/app-i18n/index.ts @@ -35,7 +35,7 @@ export default abstract class AppI18n { } } else { - result = this.getBrowserLocale(); + result = this.getDefaultLocale(); } return result; } From 758b156db2bed3a2cece3879cfd8639437ea5551 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 15 Mar 2022 16:23:41 -0300 Subject: [PATCH 21/24] Add debug info for map role loading --- packages/webapp/src/components/editor-page/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index bef42b0b..3ff8da81 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -36,7 +36,11 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { const fetchResult = fetchMapById(mapId); if (!fetchResult.isLoading) { if (fetchResult.error) { - throw new Error(`User coild not be loaded: ${JSON.stringify(fetchResult.error)}`); + throw new Error(`Map info could not be loaded: ${JSON.stringify(fetchResult.error)}`); + } + + if (!fetchResult.map) { + throw new Error(`Map info could not be loaded. Info not present: ${JSON.stringify(fetchResult)}`); } result = fetchResult.map.role === 'owner' ? 'edition-owner' : 'edition-editor'; } From b3843e7f8834c4afe308112acfff0c03ad6b13c9 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 15 Mar 2022 23:39:37 -0300 Subject: [PATCH 22/24] Add donations button --- packages/webapp/lang/de.json | 9 +++++ packages/webapp/lang/en.json | 9 +++++ packages/webapp/lang/es.json | 11 +++++- packages/webapp/lang/fr.json | 9 +++++ packages/webapp/lang/ru.json | 9 +++++ packages/webapp/lang/zh.json | 11 +++++- packages/webapp/src/compiled-lang/de.json | 18 ++++++++++ packages/webapp/src/compiled-lang/en.json | 18 ++++++++++ packages/webapp/src/compiled-lang/es.json | 20 ++++++++++- packages/webapp/src/compiled-lang/fr.json | 18 ++++++++++ packages/webapp/src/compiled-lang/ru.json | 18 ++++++++++ packages/webapp/src/compiled-lang/zh.json | 18 ++++++++++ .../src/components/layout/footer/index.tsx | 34 ++++++++++++++----- .../src/components/layout/footer/styled.ts | 9 +++-- 14 files changed, 197 insertions(+), 14 deletions(-) diff --git a/packages/webapp/lang/de.json b/packages/webapp/lang/de.json index 64d285a4..65cd0caa 100644 --- a/packages/webapp/lang/de.json +++ b/packages/webapp/lang/de.json @@ -500,5 +500,14 @@ }, "label.title": { "defaultMessage": "Etikett hinzufügen" + }, + "footer.donations": { + "defaultMessage": "Spenden" + }, + "footer.support": { + "defaultMessage": "Unterstützt" + }, + "footer.team": { + "defaultMessage": "Ausrüstung" } } \ No newline at end of file diff --git a/packages/webapp/lang/en.json b/packages/webapp/lang/en.json index b6dc8426..4f5c3321 100644 --- a/packages/webapp/lang/en.json +++ b/packages/webapp/lang/en.json @@ -167,6 +167,15 @@ "footer.others": { "defaultMessage": "Others" }, + "footer.support": { + "defaultMessage": "Support" + }, + "footer.team": { + "defaultMessage": "Our Team" + }, + "footer.donations": { + "defaultMessage": "Donations" + }, "footer.termsandconditions": { "defaultMessage": "Term And Conditions" }, diff --git a/packages/webapp/lang/es.json b/packages/webapp/lang/es.json index a46899fe..6e17c441 100644 --- a/packages/webapp/lang/es.json +++ b/packages/webapp/lang/es.json @@ -141,7 +141,16 @@ "defaultMessage": "El export a formatos de imagen (SVG, PNG, JPEG, PDF) solo está disponible en la barra de herramientas del editor." }, "footer.aboutus": { - "defaultMessage": "Sobre nosotros" + "defaultMessage": "Sobre Nosotros" + }, + "footer.donations": { + "defaultMessage": "Donaciones" + }, + "footer.support": { + "defaultMessage": "Soporte" + }, + "footer.team": { + "defaultMessage": "Equipo" }, "footer.contactus": { "defaultMessage": "Contáctenos" diff --git a/packages/webapp/lang/fr.json b/packages/webapp/lang/fr.json index 95b36f63..a6017fba 100644 --- a/packages/webapp/lang/fr.json +++ b/packages/webapp/lang/fr.json @@ -500,5 +500,14 @@ }, "label.title": { "defaultMessage": "Ajouter une étiquette" + }, + "footer.donations": { + "defaultMessage": "Des dons" + }, + "footer.support": { + "defaultMessage": "Service" + }, + "footer.team": { + "defaultMessage": "Equipe" } } \ No newline at end of file diff --git a/packages/webapp/lang/ru.json b/packages/webapp/lang/ru.json index 1f73adea..d4eaf445 100644 --- a/packages/webapp/lang/ru.json +++ b/packages/webapp/lang/ru.json @@ -473,5 +473,14 @@ }, "editor.try-welcome-description": { "defaultMessage": "Зарегистрируйтесь, чтобы создавать, делиться и публиковать майнд-карты бесплатно и без ограничений!" + }, + "footer.donations": { + "defaultMessage": "Пожертвования" + }, + "footer.support": { + "defaultMessage": "Услуги" + }, + "footer.team": { + "defaultMessage": "команда" } } \ No newline at end of file diff --git a/packages/webapp/lang/zh.json b/packages/webapp/lang/zh.json index ab4be629..d62ad359 100644 --- a/packages/webapp/lang/zh.json +++ b/packages/webapp/lang/zh.json @@ -500,5 +500,14 @@ }, "share.message": { "defaultMessage": "消息" + }, + "footer.support": { + "defaultMessage": "支持" + }, + "footer.team": { + "defaultMessage": "学期" + }, + "footer.donations": { + "defaultMessage": "捐款" } -} +} \ No newline at end of file diff --git a/packages/webapp/src/compiled-lang/de.json b/packages/webapp/src/compiled-lang/de.json index 8d7bd3be..2c1995c7 100644 --- a/packages/webapp/src/compiled-lang/de.json +++ b/packages/webapp/src/compiled-lang/de.json @@ -311,6 +311,12 @@ "value": "Kontaktiere uns" } ], + "footer.donations": [ + { + "type": 0, + "value": "Spenden" + } + ], "footer.faq": [ { "type": 0, @@ -341,6 +347,18 @@ "value": "Andere" } ], + "footer.support": [ + { + "type": 0, + "value": "Unterstützt" + } + ], + "footer.team": [ + { + "type": 0, + "value": "Ausrüstung" + } + ], "footer.termsandconditions": [ { "type": 0, diff --git a/packages/webapp/src/compiled-lang/en.json b/packages/webapp/src/compiled-lang/en.json index 048200d6..71d5c6d6 100644 --- a/packages/webapp/src/compiled-lang/en.json +++ b/packages/webapp/src/compiled-lang/en.json @@ -305,6 +305,12 @@ "value": "Contact Us" } ], + "footer.donations": [ + { + "type": 0, + "value": "Donations" + } + ], "footer.faq": [ { "type": 0, @@ -335,6 +341,18 @@ "value": "Others" } ], + "footer.support": [ + { + "type": 0, + "value": "Support" + } + ], + "footer.team": [ + { + "type": 0, + "value": "Our Team" + } + ], "footer.termsandconditions": [ { "type": 0, diff --git a/packages/webapp/src/compiled-lang/es.json b/packages/webapp/src/compiled-lang/es.json index 5c33da5f..17fbe91a 100644 --- a/packages/webapp/src/compiled-lang/es.json +++ b/packages/webapp/src/compiled-lang/es.json @@ -296,7 +296,7 @@ "footer.aboutus": [ { "type": 0, - "value": "Sobre nosotros" + "value": "Sobre Nosotros" } ], "footer.contactus": [ @@ -305,6 +305,12 @@ "value": "Contáctenos" } ], + "footer.donations": [ + { + "type": 0, + "value": "Donaciones" + } + ], "footer.faq": [ { "type": 0, @@ -335,6 +341,18 @@ "value": "Otros" } ], + "footer.support": [ + { + "type": 0, + "value": "Soporte" + } + ], + "footer.team": [ + { + "type": 0, + "value": "Equipo" + } + ], "footer.termsandconditions": [ { "type": 0, diff --git a/packages/webapp/src/compiled-lang/fr.json b/packages/webapp/src/compiled-lang/fr.json index ca5171f4..261da559 100644 --- a/packages/webapp/src/compiled-lang/fr.json +++ b/packages/webapp/src/compiled-lang/fr.json @@ -303,6 +303,12 @@ "value": "Nous contacter" } ], + "footer.donations": [ + { + "type": 0, + "value": "Des dons" + } + ], "footer.faq": [ { "type": 0, @@ -333,6 +339,18 @@ "value": "Autres" } ], + "footer.support": [ + { + "type": 0, + "value": "Service" + } + ], + "footer.team": [ + { + "type": 0, + "value": "Equipe" + } + ], "footer.termsandconditions": [ { "type": 0, diff --git a/packages/webapp/src/compiled-lang/ru.json b/packages/webapp/src/compiled-lang/ru.json index b34910a2..d382a1bc 100644 --- a/packages/webapp/src/compiled-lang/ru.json +++ b/packages/webapp/src/compiled-lang/ru.json @@ -305,6 +305,12 @@ "value": "Контакты" } ], + "footer.donations": [ + { + "type": 0, + "value": "Пожертвования" + } + ], "footer.faq": [ { "type": 0, @@ -335,6 +341,18 @@ "value": "Прочее" } ], + "footer.support": [ + { + "type": 0, + "value": "Услуги" + } + ], + "footer.team": [ + { + "type": 0, + "value": "команда" + } + ], "footer.termsandconditions": [ { "type": 0, diff --git a/packages/webapp/src/compiled-lang/zh.json b/packages/webapp/src/compiled-lang/zh.json index f2bdbe7f..209598e4 100644 --- a/packages/webapp/src/compiled-lang/zh.json +++ b/packages/webapp/src/compiled-lang/zh.json @@ -305,6 +305,12 @@ "value": "联系我们" } ], + "footer.donations": [ + { + "type": 0, + "value": "捐款" + } + ], "footer.faq": [ { "type": 0, @@ -335,6 +341,18 @@ "value": "其它" } ], + "footer.support": [ + { + "type": 0, + "value": "支持" + } + ], + "footer.team": [ + { + "type": 0, + "value": "学期" + } + ], "footer.termsandconditions": [ { "type": 0, diff --git a/packages/webapp/src/components/layout/footer/index.tsx b/packages/webapp/src/components/layout/footer/index.tsx index 48536609..acdd6e6e 100644 --- a/packages/webapp/src/components/layout/footer/index.tsx +++ b/packages/webapp/src/components/layout/footer/index.tsx @@ -16,6 +16,11 @@ const Footer = (): React.ReactElement => {

+
+ + + +
+ +
+

+ +

+
+ + + +
+
+ + + +
@@ -40,13 +60,11 @@ const Footer = (): React.ReactElement => {
- - - -
-
diff --git a/packages/webapp/src/components/layout/footer/styled.ts b/packages/webapp/src/components/layout/footer/styled.ts index a6abdf7a..dc19e089 100644 --- a/packages/webapp/src/components/layout/footer/styled.ts +++ b/packages/webapp/src/components/layout/footer/styled.ts @@ -4,10 +4,10 @@ import styled from 'styled-components'; export const StyledFooter = styled.footer` height: 250px; margin-top: 80px; - padding: 60px 40px 10px 50px; + padding: 30px 40px 10px 50px; background-color: #f9a826; display: grid; - grid-template-columns: 200px 1fr 1fr 3fr; + grid-template-columns: 200px 1fr 1fr 1fr 3fr; & a { font-size: 14px; @@ -34,9 +34,12 @@ export const StyledFooter = styled.footer` & div:nth-child(3) { grid-column: 3; } - & div:nth-child(4) { grid-column: 4; + } + + & div:nth-child(5) { + grid-column: 5; text-align: right; display: inline-block; visibility: visible; From f5600cbe6e366fd48a1d4088b8c1591802423a1a Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Mar 2022 22:01:37 -0300 Subject: [PATCH 23/24] Fix bug on errror resolution. --- packages/webapp/src/redux/clientSlice.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webapp/src/redux/clientSlice.ts b/packages/webapp/src/redux/clientSlice.ts index b15a765b..0ea10a33 100644 --- a/packages/webapp/src/redux/clientSlice.ts +++ b/packages/webapp/src/redux/clientSlice.ts @@ -57,8 +57,8 @@ export const fetchMapById = (id: number): MapLoadResult => { } // Seach for object... map = data?.find((m) => m.id == id); - if (map === null && !errorMsg) { - errorMsg = { msg: `Map with id ${id} could not be found. Please, reflesh the page` } + if (!map && !errorMsg) { + errorMsg = { msg: `Map with id ${id} could not be found. Please, reflesh the page. Map: ${JSON.stringify(data)}` } } } return { isLoading: isLoading, error: errorMsg, map: map }; From 8907452bc50e9ca9a850dfcfc604ac378d23c939 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 17 Mar 2022 15:41:32 -0300 Subject: [PATCH 24/24] Fix role resolution issue. --- packages/webapp/src/components/editor-page/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index 3ff8da81..ff561203 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -42,7 +42,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { if (!fetchResult.map) { throw new Error(`Map info could not be loaded. Info not present: ${JSON.stringify(fetchResult)}`); } - result = fetchResult.map.role === 'owner' ? 'edition-owner' : 'edition-editor'; + result = `edition-${fetchResult.map.role}`; } } return result;