Browse Source

feat(locale): add zh locale

RouRouX 3 years ago
parent
commit
0d6f230505

+ 1 - 0
src/lib/dayjs.js

@@ -1,5 +1,6 @@
 import dayjs from 'dayjs';
 import relativeTime from 'dayjs/plugin/relativeTime';
+import 'dayjs/locale/zh';
 
 dayjs.extend(relativeTime);
 

+ 271 - 0
src/locales/zh/blocks.json

@@ -0,0 +1,271 @@
+{
+  "collection": {
+    "blocks": {
+      "export-result": {
+        "name": "导出结果",
+        "description": "将结果导出为JSON"
+      }
+    }
+  },
+  "workflow": {
+    "blocks": {
+      "base": {
+        "selector": "元素选择器",
+        "markElement": {
+          "title": "一个元素如果之前被标记过,则不再标记",
+          "text": "标记元素"
+        },
+        "multiple": {
+          "title": "选择多个元素",
+          "text": "选择多个元素"
+        }
+      },
+      "trigger": {
+        "name": "触发器",
+        "description": "工作流从这里开始执行",
+        "days": [
+          "星期日",
+          "星期一",
+          "星期二",
+          "星期三",
+          "星期四",
+          "星期五",
+          "星期六"
+        ],
+        "useRegex": "使用正则表达式",
+        "shortcut": {
+          "tootlip": "录制快捷键",
+          "checkboxTitle": "即使在输入框中也执行快捷键",
+          "checkbox": "在输入框中执行快捷键",
+          "note": "提示: 键盘快捷键仅在您访问网页时有效"
+        },
+        "forms": {
+          "triggerWorkflow": "触发工作流",
+          "interval": "间隔 (分钟)",
+          "delay": "延迟 (分钟)",
+          "date": "日期",
+          "time": "时间",
+          "url": "网址 或 正则表达式",
+          "shortcut": "快捷键"
+        },
+        "items": {
+          "manual": "手动",
+          "interval": "一定时间间隔",
+          "date": "在特定日期",
+          "specific-day": "在特定的星期几",
+          "visit-web": "当你访问一个网页",
+          "keyboard-shortcut": "键盘快捷键"
+        }
+      },
+      "active-tab": {
+        "name": "活动选项卡",
+        "description": "将您所在的当前选项卡设置为活动选项卡"
+      },
+      "new-window": {
+        "name": "新窗口",
+        "description": "创建一个新窗口",
+        "windowState": {
+          "placeholder": "窗口状态",
+          "options": {
+            "normal": "标准",
+            "minimized": "最小化",
+            "maximized": "最大化",
+            "fullscreen": "全屏"
+          }
+        },
+        "incognito": {
+          "text": "设为无痕窗口",
+          "note": "您必须为此扩展程序启用“允许隐身”才能使用该选项"
+        }
+      },
+      "go-back": {
+        "name": "返回",
+        "description": "返回上一个页面"
+      },
+      "forward-page": {
+        "name": "前进",
+        "description": "前进到下一页"
+      },
+      "close-tab": {
+        "name": "关闭选项卡",
+        "description": "",
+        "activeTab": "关闭活动选项卡",
+        "url": "网址 或 匹配模式"
+      },
+      "event-click": {
+        "name": "点击元素",
+        "description": ""
+      },
+      "delay": {
+        "name": "延迟",
+        "description": "在执行下一个块之前添加延迟"
+      },
+      "get-text": {
+        "name": "获取文本",
+        "description": "从元素中获取文本",
+        "prefixText": {
+          "placeholder": "文本前缀",
+          "title": "为文本添加前缀"
+        },
+        "suffixText": {
+          "placeholder": "文本后缀",
+          "title": "为文本添加后缀"
+        }
+      },
+      "export-data": {
+        "name": "导出数据",
+        "description": "导出工作流数据列"
+      },
+      "element-scroll": {
+        "name": "滚动元素",
+        "description": "",
+        "scrollY": "垂直滚动",
+        "scrollX": "水平滚动",
+        "intoView": "滚动到视图中",
+        "smooth": "平滑滚动",
+        "incScrollX": "递增水平滚动",
+        "incScrollY": "递增垂直滚动"
+      },
+      "new-tab": {
+        "name": "新建选项卡",
+        "description": "",
+        "activeTab": "设置为活动选项卡",
+        "tabToGroup": "添加到选项卡组",
+        "updatePrevTab": {
+          "title": "使用之前打开的新选项卡而不是创建一个选项卡",
+          "text": "更新之前打开的选项卡"
+        }
+      },
+      "link": {
+        "name": "链接",
+        "description": "打开链接元素"
+      },
+      "attribute-value": {
+        "name": "属性值",
+        "description": "获取一个元素属性的值",
+        "forms": {
+          "name": "属性名称",
+          "checkbox": "保存数据",
+          "column": "选择列"
+        }
+      },
+      "forms": {
+        "name": "表单",
+        "description": "",
+        "selected": "Selected",
+        "type": "表单类型",
+        "text-field": {
+          "name": "文本框",
+          "value": "值",
+          "clearValue": "清除表单值",
+          "delay": {
+            "placeholder": "延迟",
+            "label": "输入延迟(ms)(0为禁用)"
+          }
+        },
+        "select": { "name": "下拉列表" },
+        "radio": { "name": "单选框" },
+        "checkbox": { "name": "复选框" }
+      },
+      "repeat-task": {
+        "name": "重复任务",
+        "description": ""
+      },
+      "javascript-code": {
+        "name": "JavaScript 代码",
+        "description": "在网页中执行你的 javascript 代码",
+        "modal": "JavaScript 代码",
+        "availabeFuns": "可用的函数:",
+        "timeout": {
+          "placeholder": "超时",
+          "title": "Javascript代码执行超时"
+        }
+      },
+      "trigger-event": {
+        "name": "触发事件",
+        "description": "",
+        "selectEvent": "选择事件"
+      },
+      "conditions": {
+        "name": "条件",
+        "description": "条件单元"
+      },
+      "element-exists": {
+        "name": "元素存在",
+        "description": "检查元素是否存在",
+        "selector": "元素选择器",
+        "tryFor": {
+          "title": "检查元素是否存在",
+          "label": "检查"
+        },
+        "timeout": {
+          "label": "超时 (ms)",
+          "title": "每次检查元素的超时时间"
+        }
+      },
+      "webhook": {
+        "name": "Webhook",
+        "description": "Webhook 允许通知外部服务",
+        "url": "接收POST请求的URL",
+        "contentType": "选择content type",
+        "buttons": {
+          "header": "添加请求头"
+        },
+        "timeout": {
+          "placeholder": "超时",
+          "title": "Http请求执行超时(ms)"
+        },
+        "tabs": {
+          "headers": "Headers",
+          "body": "Content body"
+        }
+      },
+      "loop-data": {
+        "name": "循环数据",
+        "description": "遍历数据列或你的自定义数据",
+        "loopId": "循环 ID",
+        "modal": {
+          "fileTooLarge": "文件太大无法编辑",
+          "maxFile": "最大文件大小为 1MB",
+          "options": {
+            "firstRow": "使用第一个 row 作为 keys"
+          }
+        },
+        "buttons": {
+          "clear": "清除数据",
+          "insert": "插入数据",
+          "import": "导出文件"
+        },
+        "maxLoop": {
+          "title": "循环数据的最大值",
+          "label": "循环数据的最大值(0为禁用)"
+        },
+        "loopThrough": {
+          "placeholder": "Loop through",
+          "options": {
+            "data-columns": "Data columns",
+            "custom-data": "Custom data"
+          }
+        }
+      },
+      "loop-breakpoint": {
+        "name": "Loop breakpoint",
+        "description": "To tell where loop data block must stop"
+      },
+      "take-screenshot": {
+        "name": "Take screenshot",
+        "description": "Take a screenshot of current active tab",
+        "imageQuality": "Image quality"
+      },
+      "switch-to": {
+        "name": "Switch frame",
+        "description": "Switch between main window and iframe",
+        "iframeSelector": "Iframe element selector",
+        "windowTypes": {
+          "main": "Main window",
+          "iframe": "Iframe"
+        }
+      }
+    }
+  }
+}

+ 54 - 0
src/locales/zh/common.json

@@ -0,0 +1,54 @@
+{
+  "common": {
+    "dashboard": "Dashboard",
+    "workflow": "Workflow | Workflows",
+    "collection": "Collection | Collections",
+    "log": "Log | Logs",
+    "block": "Block | Blocks",
+    "docs": "Documentation",
+    "search": "Search",
+    "import": "Import",
+    "export": "Export",
+    "rename": "Rename",
+    "execute": "Execute",
+    "delete": "Delete",
+    "cancel": "Cancel",
+    "settings": "Settings",
+    "options": "Options",
+    "confirm": "Confirm",
+    "name": "Name",
+    "all": "All",
+    "add": "Add",
+    "save": "Save",
+    "data": "data",
+    "stop": "Stop",
+    "editor": "Editor",
+    "running": "Running",
+    "globalData": "Global data",
+    "fileName": "File name",
+    "description": "Description",
+    "disable": "Disable",
+    "disabled": "Disabled",
+    "enable": "Enable",
+  },
+  "message": {
+    "noBlock": "No block",
+    "noData": "No data to show",
+    "noTriggerBlock": "Can't find a trigger block",
+    "useDynamicData": "Learn how to add dynamic data",
+    "delete": "Are you sure want to delete \"{name}\"?",
+    "empty": "Oppss... It's looks like you don't have any items",
+    "notSaved": "Do you really want to leave? you have unsaved changes!",
+    "maxSizeExceeded": "The file size is the exceeded maximum allowed",
+  },
+  "sort": {
+    "sortBy": "Sort by",
+    "name": "Name",
+    "createdAt": "Created date"
+  },
+  "logStatus": {
+    "stopped": "stopped",
+    "error": "error",
+    "success": "success"
+  },
+}

+ 128 - 0
src/locales/zh/newtab.json

@@ -0,0 +1,128 @@
+{
+  "home": {
+    "viewAll": "View all"
+  },
+  "settings": {
+    "language": {
+      "label": "Language",
+      "helpTranslate": "Can't find your language? Help translate.",
+      "reloadPage": "Reload the page to take effect"
+    },
+  },
+  "workflow": {
+    "import": "Import workflow",
+    "new": "New workflow",
+    "delete": "Delete workflow",
+    "name": "Workflow name",
+    "rename": "Rename workflow",
+    "add": "Add workflow",
+    "clickToEnable": "Click to enable",
+    "dataColumns": {
+      "title": "Data columns",
+      "placeholder": "Search or add column",
+      "column": {
+        "name": "Column name",
+        "type": "Data type"
+      }
+    },
+    "sidebar": {
+      "workflowIcon": "Workflow icon"
+    },
+    "editor": {
+      "zoomIn": "Zoom in",
+      "zoomOut": "Zoom out",
+      "resetZoom": "Reset zoom",
+      "duplicate": "Duplicate"
+    },
+    "settings": {
+      "onError": {
+        "title": "On workflow error",
+        "items": {
+          "keepRunning": "Keep running",
+          "stopWorkflow": "Stop workflow"
+        }
+      },
+      "timeout": {
+        "title": "Workflow timeout (milliseconds)"
+      }
+    }
+  },
+  "collection": {
+    "description": "Execute your workflows in sequence",
+    "new": "New collection",
+    "delete": "Delete collection",
+    "add": "Add collection",
+    "rename": "Rename collection",
+    "flow": "Flow",
+    "dragDropText": "Drop a workflow or block in here",
+    "options": {
+      "atOnce": {
+        "title": "Execute all workflows in the collection at once",
+        "description": "Block not gonna executed when using this option"
+      }
+    },
+    "globalData": {
+      "note": "This will overwrite the global data of the workflow"
+    }
+  },
+  "log": {
+    "goBack": "Go back to \"{name}\" log",
+    "startedDate": "Started date",
+    "duration": "Duration",
+    "selectAll": "Select all",
+    "deselectAll": "Deselect all",
+    "deleteSelected": "Delete selected logs",
+    "types": {
+      "stop": "Workflow is stopped",
+      "finish": "Finish"
+    },
+    "messages": {
+      "workflow-disabled": "Workflow is disabled",
+      "stop-timeout": "Workflow is stopped because of timeout",
+      "no-iframe-id": "Can't find Frame ID for the frame element with \"{selector}\" selector",
+      "no-tab": "Can't connect to a tab, use \"New tab\" or \"Active tab\" block before using the \"{name}\" block."
+    },
+    "description": {
+      "text": "{status} on {date} in {duration}",
+      "status": {
+        "success": "Succeeded",
+        "error": "Failed",
+        "stopped": "Stopped"
+      }
+    },
+    "delete": {
+      "title": "Delete log",
+      "description": "Are you sure want to delete all the selected logs?"
+    },
+    "exportData": {
+      "title": "Export data",
+      "types": {
+        "json": "JSON",
+        "csv": "CSV",
+        "plain-text": "Plain text"
+      },
+    },
+    "filter": {
+      "title": "Filter",
+      "byStatus": "By status",
+      "byDate": {
+        "title": "By date",
+        "items": {
+          "lastDay": "Last day",
+          "last7Days": "Last seven days",
+          "last30Days": "Last thirty days",
+        }
+      },
+    },
+  },
+  "components": {
+    "pagination": {
+      "text1": "Showing",
+      "text2": "items out of {count}",
+      "nextPage": "Next page",
+      "currentPage": "Current page",
+      "prevPage": "Previous page",
+      "of": "of {page}"
+    }
+  },
+}

+ 13 - 0
src/locales/zh/popup.json

@@ -0,0 +1,13 @@
+{
+  "home": {
+    "elementSelector": {
+      "name": "Element selector",
+      "noAccess": "Don't have access to this site"
+    },
+    "workflow": {
+      "new": "New workflow",
+      "rename": "Rename workflow",
+      "delete": "Delete workflow"
+    },
+  }
+}

+ 4 - 1
src/utils/shared.js

@@ -527,4 +527,7 @@ export const contentTypes = [
   { name: 'application/x-www-form-urlencoded', value: 'form' },
 ];
 
-export const supportLocales = [{ id: 'en', name: 'English' }];
+export const supportLocales = [
+  { id: 'en', name: 'English' },
+  { id: 'zh', name: '简体中文' },
+];