From 13da7c70c8691ed86541b45303f555c8767ba08e Mon Sep 17 00:00:00 2001 From: filesite Date: Wed, 25 Jun 2025 12:26:57 +0800 Subject: [PATCH] add lang for zh --- i18n.mjs | 6 +- i18n/zh.json | 39 +++++++++++ public/en-us/index.html | 2 +- public/index.html | 2 +- public/template/index.html | 2 +- public/zh/index.html | 133 +++++++++++++++++++++---------------- test/i18n.test.mjs | 23 ++++++- 7 files changed, 140 insertions(+), 67 deletions(-) create mode 100644 i18n/zh.json diff --git a/i18n.mjs b/i18n.mjs index 5f73e3c..1cee5db 100644 --- a/i18n.mjs +++ b/i18n.mjs @@ -46,7 +46,7 @@ class I18N { const _self = this; const langFiles = await _self.getLangFiles(); - //console.log('Lang json files', langFiles); + console.log('Lang json files', langFiles); if (langFiles && langFiles.length > 0) { try { @@ -79,12 +79,12 @@ class I18N { //判断语言代码格式是否符合国际标准 isIosLangCode(lang) { - return /^[a-z]{2}(?:\-[a-z]{2})$/i.test(lang); + return /^[a-z]{2}(\-[a-z]{2})?$/i.test(lang); } //判断是否是语言包文件 isIosLangFile(filename) { - return /^[a-z]{2}(?:\-[a-z]{2})\.json$/i.test(filename); + return /^[a-z]{2}(\-[a-z]{2})?\.json$/i.test(filename); } //更新语言包文件内容,合并新的数据到已有内容中 diff --git a/i18n/zh.json b/i18n/zh.json new file mode 100644 index 0000000..c66f813 --- /dev/null +++ b/i18n/zh.json @@ -0,0 +1,39 @@ +{ + "HeroUnion - Open source web crawler union.": "HeroUnion - 开源网络爬虫联盟。", + "HeroUnion.website": "HeroUnion.website", + "HeroUnion - Open source web crawler union": "HeroUnion - 开源网络爬虫联盟", + "HeroUnion Stats": "HeroUnion状态", + "It's running": "正在运行", + "Tasks Stats": "任务状态", + "Last": "上次", + "Waiting": "等待中", + "Running": "正在运行", + "Total": "总计", + "Done": "已完成", + "Failed": "失败", + "Notify Stats": "通知状态", + "Bot Stats": "机器人状态", + "Idle": "空闲", + "Busy": "繁忙", + "Offline": "离线", + "JSON Data": "JSON数据", + "Covenant of the Alliance": "联盟盟约", + "Please abide by the following conventions and stick to it for a better tomorrow for yourself and the whole society!": "为了您自己和整个社会更美好的明天,请遵守以下约定并坚持下去!", + "Comply with local/national laws and regulations": "遵守当地/国家法律法规", + "Data that requires login or VIP status to access will not be crawled": "需要登录或VIP身份才能访问的数据将不会被抓取", + "Data that is explicitly prohibited from being collected by the target website will not be crawled": "目标网站明确禁止收集的数据将不会被抓取", + "The commercial core data of the target website is not crawled": "目标网站的商业核心数据将不会被抓取", + "Low concurrency, low frequency, does not affect the normal operation of the target website": "低并发、低频率,不影响目标网站的正常运行", + "Bots": "机器人", + "HeroUnion App": "HeroUnion App", + "HeroUnion download": "HeroUnion下载", + "HeroBot download": "HeroBot下载", + "HeroUnion is only responsible for the scheduling of crawlers and tasks.": "HeroUnion仅负责爬虫和任务的调度。", + "The contracts supported by crawlers and the specific content of tasks have nothing to do with the alliance.": "爬虫支持的合约及任务的具体内容与联盟无关。", + "Website monitor": "网站监控", + "Web Scraper": "网页爬虫", + "Disclaimer": "免责声明", + "Information protected by law will not be crawled": "受法律保护的信息将不会被抓取", + "for example": "例如", + "personal privacy data mobile phone number, ID number, etc.": "个人隐私数据、手机号码、身份证号码等。" +} \ No newline at end of file diff --git a/public/en-us/index.html b/public/en-us/index.html index c3692e7..aa540d4 100644 --- a/public/en-us/index.html +++ b/public/en-us/index.html @@ -6,7 +6,7 @@ HeroUnion - Open source web crawler union. - + -

HeroUnion英雄联盟 - 开源的网络爬虫联盟

+

HeroUnion - 开源网络爬虫联盟


-

- English - 简体中文 -

+
+ + +
-

HeroUnion联盟状态 - 已运行...

+

HeroUnion状态 正在运行 ...

-

任务状态(最近...

+

任务状态 (上次 ...)

... @@ -61,16 +69,16 @@ ... - +
... - + ... - + ... @@ -79,15 +87,15 @@
-

任务通知状态(最近...

+

通知状态 (上次 ...)

... - + ... - + ... @@ -95,11 +103,11 @@
-

爬虫状态

+

机器人状态

... - + ... @@ -118,70 +126,77 @@

JSON数据

...
-

HeroUnion联盟公约

-

请大家遵守以下公约,为自己、也为全社会有更好的明天一起坚持!

+

联盟盟约

+

为了您自己和整个社会更美好的明天,请遵守以下约定并坚持下去!

    -
  • 遵守本地/本国法律、法规
  • -
  • 受法律保护的信息不爬(例如:个人隐私数据手机号码、身份证号码等等)
  • -
  • 需要登录,或需要VIP身份才能访问的数据不爬
  • -
  • 目标网站明确禁止采集的数据不爬
  • -
  • 目标网站商业核心数据不爬
  • -
  • 低并发,低频率,不影响目标网站正常运行
  • +
  • 遵守当地/国家法律法规
  • +
  • 受法律保护的信息将不会被抓取 (例如: 个人隐私数据、手机号码、身份证号码等。)
  • +
  • 需要登录或VIP身份才能访问的数据将不会被抓取
  • +
  • 目标网站明确禁止收集的数据将不会被抓取
  • +
  • 目标网站的商业核心数据将不会被抓取
  • +
  • 低并发、低频率,不影响目标网站的正常运行
-

Hero爬虫列表

-
- -
+

机器人

+
...
-

HeroUnion应用

+

HeroUnion App

-

HeroUnion源码下载

+

HeroUnion下载

https://github.com/filesite-io/herounion

-

HeroBot - Machete Hero源码下载

+

HeroBot下载

https://github.com/filesite-io/machete_hero

- 免责申明: -
HeroUnion英雄联盟只负责爬虫和任务的调度,爬虫所支持的合约以及任务具体内容与联盟无关。 + 免责声明: +
HeroUnion仅负责爬虫和任务的调度。 + 爬虫支持的合约及任务的具体内容与联盟无关。

©copyright HeroUnion.Website