فهرست منبع

Merge pull request #142 from RouRouX/dev

feat(locale): add zh locale
Ahmad Kholid 3 سال پیش
والد
کامیت
39d4336222
7فایلهای تغییر یافته به همراه489 افزوده شده و 11 حذف شده
  1. 1 0
      src/lib/dayjs.js
  2. 18 10
      src/locales/en/blocks.json
  3. 271 0
      src/locales/zh/blocks.json
  4. 54 0
      src/locales/zh/common.json
  5. 128 0
      src/locales/zh/newtab.json
  6. 13 0
      src/locales/zh/popup.json
  7. 4 1
      src/utils/shared.js

+ 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);
 

+ 18 - 10
src/locales/en/blocks.json

@@ -23,13 +23,21 @@
       "trigger": {
         "name": "Trigger",
         "description": "Block where the workflow will start executing",
-        "days": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
+        "days": [
+          "Sunday",
+          "Monday",
+          "Tuesday",
+          "Wednesday",
+          "Thursday",
+          "Friday",
+          "Saturday"
+        ],
         "useRegex": "Use regex",
         "shortcut": {
           "tootlip": "Record shortcut",
           "checkboxTitle": "Execute shortcut even when you're in an input element",
           "checkbox": "Active while in input",
-          "note": "Note: keyboard shortcut only working when you're on a webpage",
+          "note": "Note: keyboard shortcut only working when you're on a webpage"
         },
         "forms": {
           "triggerWorkflow": "Trigger workflow",
@@ -47,7 +55,7 @@
           "specific-day": "On a specific day",
           "visit-web": "When visit a website",
           "keyboard-shortcut": "Keyboard shortcut"
-        },
+        }
       },
       "active-tab": {
         "name": "Active tab",
@@ -68,7 +76,7 @@
         "incognito": {
           "text": "Set as incognito window",
           "note": "You must enable 'Allow in incognito' for this extension to use the option"
-        },
+        }
       },
       "go-back": {
         "name": "Go back",
@@ -116,7 +124,7 @@
         "intoView": "Scroll into view",
         "smooth": "Smooth scroll",
         "incScrollX": "Increment horizontal scroll",
-        "incScrollY": "Increment vertical scroll",
+        "incScrollY": "Increment vertical scroll"
       },
       "new-tab": {
         "name": "New tab",
@@ -161,7 +169,7 @@
       },
       "repeat-task": {
         "name": "Repeat task",
-        "description": "",
+        "description": ""
       },
       "javascript-code": {
         "name": "JavaScript code",
@@ -221,12 +229,12 @@
           "maxFile": "Max file size is 1MB",
           "options": {
             "firstRow": "Use the first row as keys"
-          },
+          }
         },
         "buttons": {
           "clear": "Clear data",
           "insert": "Insert data",
-          "import": "Import file",
+          "import": "Import file"
         },
         "maxLoop": {
           "title": "Max numbers of data to loop",
@@ -237,7 +245,7 @@
           "options": {
             "data-columns": "Data columns",
             "custom-data": "Custom data"
-          },
+          }
         }
       },
       "loop-breakpoint": {
@@ -256,7 +264,7 @@
         "windowTypes": {
           "main": "Main window",
           "iframe": "Iframe"
-        },
+        }
       }
     }
   }

+ 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": "选中",
+        "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": "超时 (毫秒)",
+          "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": "循环数据源",
+          "options": {
+            "data-columns": "数据列",
+            "custom-data": "自定义数据"
+          }
+        }
+      },
+      "loop-breakpoint": {
+        "name": "循环断点",
+        "description": "告诉循环数据单元在哪里停止"
+      },
+      "take-screenshot": {
+        "name": "截屏",
+        "description": "对当前活动选项卡截屏",
+        "imageQuality": "图像质量"
+      },
+      "switch-to": {
+        "name": "切换到",
+        "description": "在主窗口和iframe之间切换",
+        "iframeSelector": "iframe元素选择器",
+        "windowTypes": {
+          "main": "主窗口",
+          "iframe": "iframe"
+        }
+      }
+    }
+  }
+}

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

@@ -0,0 +1,54 @@
+{
+  "common": {
+    "dashboard": "主面板",
+    "workflow": "工作流 | 工作流",
+    "collection": "集合 | 集合",
+    "log": "日志 | 日志",
+    "block": "单元 | 单元",
+    "docs": "文档",
+    "search": "搜索",
+    "import": "导入",
+    "export": "导出",
+    "rename": "重命名",
+    "execute": "执行",
+    "delete": "删除",
+    "cancel": "取消",
+    "settings": "设置",
+    "options": "选项",
+    "confirm": "确认",
+    "name": "名称",
+    "all": "全部",
+    "add": "添加",
+    "save": "保存",
+    "data": "数据",
+    "stop": "停止",
+    "editor": "编辑器",
+    "running": "运行",
+    "globalData": "全局数据",
+    "fileName": "文件名",
+    "description": "描述",
+    "disable": "禁用",
+    "disabled": "已禁用",
+    "enable": "启用"
+  },
+  "message": {
+    "noBlock": "没有工作单元",
+    "noData": "没有数据可以展示",
+    "noTriggerBlock": "没有触发器",
+    "useDynamicData": "了解如何添加动态数据",
+    "delete": "确定要删除\"{name}\"?",
+    "empty": "哎呀……你好像没有任何项目",
+    "notSaved": "你真的要退出吗? 你有未保存的更改!",
+    "maxSizeExceeded": "文件大小超出了允许的最大值"
+  },
+  "sort": {
+    "sortBy": "排序方式",
+    "name": "名称",
+    "createdAt": "创建时间"
+  },
+  "logStatus": {
+    "stopped": "停止",
+    "error": "错误",
+    "success": "成功"
+  }
+}

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

@@ -0,0 +1,128 @@
+{
+  "home": {
+    "viewAll": "查看全部"
+  },
+  "settings": {
+    "language": {
+      "label": "语言",
+      "helpTranslate": "找不到你的语言? 帮忙翻译。",
+      "reloadPage": "重新加载页面生效"
+    }
+  },
+  "workflow": {
+    "import": "导入工作流",
+    "new": "新建工作流",
+    "delete": "删除工作流",
+    "name": "工作流名称",
+    "rename": "重命名工作流",
+    "add": "添加工作流",
+    "clickToEnable": "点击启用",
+    "dataColumns": {
+      "title": "数据列",
+      "placeholder": "搜索或者添加数据列",
+      "column": {
+        "name": "列名称",
+        "type": "数据类型"
+      }
+    },
+    "sidebar": {
+      "workflowIcon": "工作流图标"
+    },
+    "editor": {
+      "zoomIn": "缩小",
+      "zoomOut": "放大",
+      "resetZoom": "重置缩放",
+      "duplicate": "创建副本"
+    },
+    "settings": {
+      "onError": {
+        "title": "工作流出错",
+        "items": {
+          "keepRunning": "继续运行",
+          "stopWorkflow": "停止工作流"
+        }
+      },
+      "timeout": {
+        "title": "工作流超时 (毫秒)"
+      }
+    }
+  },
+  "collection": {
+    "description": "按顺序执行工作流",
+    "new": "新建集合",
+    "delete": "删除集合",
+    "add": "添加集合",
+    "rename": "重命名集合",
+    "flow": "流程",
+    "dragDropText": "拖放工作流或者单元到这里",
+    "options": {
+      "atOnce": {
+        "title": "一次执行集合中的所有工作流",
+        "description": "使用此选项时不会执行单元下的项目"
+      }
+    },
+    "globalData": {
+      "note": "这将覆盖工作流的全局数据"
+    }
+  },
+  "log": {
+    "goBack": "返回到\"{name}\"的日志",
+    "startedDate": "开始日期",
+    "duration": "持续时间",
+    "selectAll": "全选",
+    "deselectAll": "取消全选",
+    "deleteSelected": "删除选定的日志",
+    "types": {
+      "stop": "工作流已停止",
+      "finish": "完成"
+    },
+    "messages": {
+      "workflow-disabled": "工作流被禁用",
+      "stop-timeout": "工作流因超时而停止",
+      "no-iframe-id": "找不到\"{selector}\"选择的iframe",
+      "no-tab": "无法连接到选项卡,请在使用 \"{name}\" 单元之前使用 \"新建选项卡\" 或 \"活动选项卡\" 单元。"
+    },
+    "description": {
+      "text": "在{date}用了{duration}执行{status} ",
+      "status": {
+        "success": "成功",
+        "error": "失败",
+        "stopped": "停止"
+      }
+    },
+    "delete": {
+      "title": "删除日志",
+      "description": "你确定要删除选定的日志吗?"
+    },
+    "exportData": {
+      "title": "导出数据",
+      "types": {
+        "json": "JSON",
+        "csv": "CSV",
+        "plain-text": "Plain text"
+      }
+    },
+    "filter": {
+      "title": "筛选",
+      "byStatus": "按状态",
+      "byDate": {
+        "title": "按日期",
+        "items": {
+          "lastDay": "最近一天",
+          "last7Days": "最近7天",
+          "last30Days": "最近30天"
+        }
+      }
+    }
+  },
+  "components": {
+    "pagination": {
+      "text1": "显示",
+      "text2": "条 共{count}条",
+      "nextPage": "下一页",
+      "currentPage": "当前页",
+      "prevPage": "上一页",
+      "of": "共{page}页"
+    }
+  }
+}

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

@@ -0,0 +1,13 @@
+{
+  "home": {
+    "elementSelector": {
+      "name": "元素选择器",
+      "noAccess": "您没有权限访问此站点"
+    },
+    "workflow": {
+      "new": "新建工作流",
+      "rename": "重命名工作流",
+      "delete": "删除工作流"
+    }
+  }
+}

+ 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: '简体中文' },
+];