From cc9b281ec91e11551943ef1300626db0e9733325 Mon Sep 17 00:00:00 2001
From: nh1000 <157875998+nh1000@users.noreply.github.com>
Date: Wed, 3 Apr 2024 21:07:06 +1100
Subject: [PATCH] Close #1058: Translate TTL to zh-CN (simplified Chinese)
(#1060)
---
README.md | 1 +
__tests__/__main__/user-preferences.js | 1 +
docs/README-zh-CN.md | 54 +++++++
locales/zh-CN/translation.json | 208 +++++++++++++++++++++++++
locales/zh-CN/translation.missing.json | 1 +
src/configs/app.config.js | 1 +
6 files changed, 266 insertions(+)
create mode 100644 docs/README-zh-CN.md
create mode 100644 locales/zh-CN/translation.json
create mode 100644 locales/zh-CN/translation.missing.json
diff --git a/README.md b/README.md
index 6a5f6f2e0..4c888035e 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,7 @@
+
diff --git a/__tests__/__main__/user-preferences.js b/__tests__/__main__/user-preferences.js
index 44194c4c5..4da67d287 100644
--- a/__tests__/__main__/user-preferences.js
+++ b/__tests__/__main__/user-preferences.js
@@ -504,6 +504,7 @@ describe('Preferences Main', () =>
assert.strictEqual(getLanguageName('th-TH'), 'ไทย');
assert.strictEqual(getLanguageName('tr-TR'), 'Türkçe');
assert.strictEqual(getLanguageName('uk-UA'), 'Українська');
+ assert.strictEqual(getLanguageName('zh-CN'), '简体中文');
assert.strictEqual(getLanguageName('zh-TW'), '繁體中文');
});
});
diff --git a/docs/README-zh-CN.md b/docs/README-zh-CN.md
new file mode 100644
index 000000000..8d0fb675e
--- /dev/null
+++ b/docs/README-zh-CN.md
@@ -0,0 +1,54 @@
+
+
+
+
让它来帮助你纪录工作时数,和提醒你是时候该走去开始享受真正的生活
+
+[timetoleave.app](https://timetoleave.app/)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+---
+
+纪录你今天开始工作的时间,程式会计算你何时应该离开办公室,包含你花费在午餐的时间。当时间到了,程式就会通知你。
+
+
+
+你可以设定喜好设定,叙述你的工作日子、一日里有多少小时你需要工作、并且你想不想被通知。
+
+
+
+你也可以加入豁免来移除你不需要工作的日子。
+
+
+
+## 如何安装 TTL
+
+Time to Leave 运行在 MacOS,Windows 和 Linux。你可以在[最新发布](https://github.com/thamara/time-to-leave/releases/latest)下载你想要的版本。
+
+## 如何运行 TTL 及向 TTL 贡献
+
+如果你想帮忙,请阅读我们的[作出贡献](../CONTRIBUTING.md)指引。
+你也可以参考我们的[开发指引](../DEVELOPMENT.md)以获得更多信息。
+
+## 保持联系!
+
+加入我们的[discord 频道](https://discord.gg/P3KkEF5)以讨论接下来的特色以及更多。
+
+## 鸣谢
+
+Icons 由[freepik](https://www.flaticon.com/authors/freepik)制作,来源自[www.flaticon.com](https://www.flaticon.com)。
+
+View Switch Icon 由[Pixel perfect](https://www.flaticon.com/authors/pixel-perfect)制作,来源自[www.flaticon.com](https://www.flaticon.com)。
diff --git a/locales/zh-CN/translation.json b/locales/zh-CN/translation.json
new file mode 100644
index 000000000..eef829a8f
--- /dev/null
+++ b/locales/zh-CN/translation.json
@@ -0,0 +1,208 @@
+{
+ "$BaseCalendar": {
+ "day-done-balance": "今日已全部完成,是日结余:",
+ "month-balance": "月份结余",
+ "month-balance-title": "本月结余会计算到今天为止,正结余代表你今天(或今个月余下的日子里)有额外的小时数不用工作。",
+ "overall-balance": "总体结余",
+ "overall-balance-title": "总体结余直到月尾或当前日子",
+ "switch-view": "切换视角"
+ },
+ "$DateUtil": {
+ "april": "四月",
+ "august": "八月",
+ "december": "十二月",
+ "february": "二月",
+ "fri": "五",
+ "january": "一月",
+ "july": "七月",
+ "june": "六月",
+ "march": "三月",
+ "may": "五月",
+ "mon": "一",
+ "november": "十一月",
+ "october": "十月",
+ "sat": "六",
+ "september": "九月",
+ "sun": "日",
+ "thu": "四",
+ "tue": "二",
+ "wed": "三"
+ },
+ "$FlexibleDayCalendar": {
+ "current-day": "回到当前日子",
+ "day-total": "日子总计",
+ "entry": "纪录",
+ "entry-removal-confirmation": "确定移除最后一行的纪录?",
+ "leave-by": "你应该在此时间离开:",
+ "next-day": "下一日",
+ "no": "否",
+ "not-a-working-day": "不是一个工作日",
+ "previous-day": "上一日",
+ "remove-entry": "移除纪录",
+ "waived-day": "已豁免日子",
+ "yes": "是"
+ },
+ "$FlexibleMonthCalendar": {
+ "add-waiver-day": "为此日增加豁免",
+ "current-month": "回到当前月份",
+ "day": "日",
+ "entry-removal-confirmation": "确定移除当日最后两行纪录吗",
+ "last-day-balance": "上一日已用结余",
+ "leave-by": "根据今天你的到达时间,你应在此时间离开",
+ "next-month": "下一个月",
+ "no": "否",
+ "on": "在",
+ "previous-month": "上一个月",
+ "remove-entry": "移除纪录",
+ "total": "总计",
+ "waived-day": "已豁免日子",
+ "working-days": "工作日数",
+ "working-days-title": "在这个月里有多少个工作日",
+ "yes": "是"
+ },
+ "$Menu": {
+ "about": "关于",
+ "all-clear": "全部已清除!",
+ "all-files": "所有文件",
+ "cancel": "删除",
+ "check-for-updates": "检查更新",
+ "clear-database": "清除资料库",
+ "confirm-clear-all-data": "确定清除所有资料?",
+ "confirm-import-db": "确定导入资料库?这会覆盖所有现有资料。",
+ "copy": "复制",
+ "could-not-be-loaded": "无法加载",
+ "cut": "剪下",
+ "database-export": "导出资料库",
+ "database-imported": "已导入资料库",
+ "database-migrated": "已转移资料库",
+ "database-was-exported": "已导出资料库",
+ "edit": "编辑",
+ "exit": "退出",
+ "export": "导出",
+ "export-database": "导出资料库",
+ "export-db-to-file": "导出资料库到文件",
+ "failed-entries": "纪录时发生错误",
+ "failed-migrating": "转移时发生错误",
+ "fresh-start": "重新开始",
+ "fresh-start-confirm": "确定要重新开始吗?",
+ "help": "帮助",
+ "import": "导入",
+ "import-database": "导入资料库",
+ "import-db-from-file": "从文件导入资料库",
+ "import-successful": "太好了!导入成功!",
+ "menu": "目录",
+ "migrate": "转移",
+ "migrate-calendar-to-flexible": "转移固定日历资料库到自由",
+ "migration-successful": "太好了!转移成功!",
+ "no-thanks": "不用了,谢谢",
+ "ok": "好的",
+ "paste": "贴上",
+ "preferences": "喜好设定",
+ "punch-time": "打卡时间",
+ "punched-time": "已打卡时间",
+ "quit": "退出",
+ "reload": "重新载入",
+ "report": "报告",
+ "select-all": "选择全部",
+ "send-feedback": "发送意见反馈",
+ "should-migrate-to-flexible": "其中一个此Time to Leave发布的新特性是拥有日历弹性条目数。\n\n这个新的查看方式使用了一个新的资料库格式。\n如需使用此功能,你可以转移你现有的资料库到新的格式或重新开始。",
+ "show-app": "显示程式",
+ "something-went-wrong": "出错了 :(",
+ "toggle-dev-tools": "切换开发者工具",
+ "ttl-github": "TTL GitHub",
+ "view": "查看",
+ "workday-waiver-manager": "工作日豁免管理员",
+ "yes-please": "好的,谢谢"
+ },
+ "$Notification": {
+ "punch-reminder": "别忘了打卡!",
+ "time-to-leave": "你还好吗?我想现在是时候离开了。",
+ "dismiss-for-today": "今天关功能"
+ },
+ "$Preferences": {
+ "allowRecurringNotifications": "允许定期通知",
+ "appBehavior": "程式特性",
+ "cadentStar": "彩虹渐变色",
+ "closeMinimizeToTray": "当按下关闭按钮时将程式最小化到任务栏",
+ "countTodayOnTotals": "把今天计算在总数内",
+ "dark": "深色",
+ "day": "日",
+ "fixed": "固定",
+ "flexible": "自由",
+ "fri": "五",
+ "hideNonWorkingDay": "隐藏非工作日(月份视角)",
+ "hours-per-day": "HH:mm",
+ "hoursPerDay": "小时每日",
+ "enablePrefillBreakTime": "启用休息时间的预填",
+ "breakTimeInterval": "休息间隔",
+ "language": "语言",
+ "light": "浅色",
+ "minimizeToTray": "当按下最小化按钮时将程式最小化到任务栏",
+ "minutesBetweenNotifications": "通知间隔分钟数",
+ "mon": "一",
+ "month": "月",
+ "notification": "通知",
+ "numberOfEntries": "纪录数量",
+ "overallBalanceStart": "总体结余开始日期",
+ "sat": "六",
+ "startOnLogin": "登入系统后自动启动程序",
+ "sun": "日",
+ "systemDefault": "系统默认",
+ "themes": "主题",
+ "thu": "四",
+ "title": "喜好设定",
+ "tue": "二",
+ "userPreferences": "用户喜好设定",
+ "view": "查看",
+ "wed": "三",
+ "workingDays": "工作日"
+ },
+ "$UpdateManager": {
+ "dismissBtn": "撤销",
+ "downloadBtn": "下载最新版本",
+ "old-version-msg": "你正在使用一个旧的 TTL 版本且正在错过一大堆很酷的功能!",
+ "remindBtn": "稍后提醒我",
+ "title": "TTL 检查更新",
+ "upto-date-msg": "你的 TTL 已更新到最新版本。"
+ },
+ "$WorkdayWaiver": {
+ "add-waiver": "加入豁免",
+ "already-have-waiver": "你已经有豁免",
+ "attention": "注意:利用豁免者在日子导入假期会覆盖豁免者。",
+ "city": "城市:",
+ "conflicts": "冲突?",
+ "country": "国家:",
+ "date": "日期",
+ "day": "日",
+ "delete-waiver-message": "确定删除此日豁免吗",
+ "end-date": "结束日期",
+ "end-date-cannot-be-less": "结束日期不能小于开始日期",
+ "from": "从",
+ "header-help": "当关闭此窗口时会使更改生效",
+ "holiday": "假日",
+ "hours": "小时",
+ "hours-waived": "已豁免小时数",
+ "import": "导入?",
+ "loaded-waivers-holidays": "已载入假日豁免。",
+ "nav-holiday": "假日",
+ "no": "否",
+ "no-working-days-on-range": "不能增加豁免,范围里并没有任何工作日。",
+ "on-working-day": "在工作日",
+ "reason": "原因",
+ "remove-waiver": "在新增一个之前移除他。",
+ "source-selected-holidays": "导入已选择假日",
+ "start-date": "开始日期",
+ "state": "状态:",
+ "title": "工作日豁免管理员",
+ "to": "至",
+ "waive": "豁免",
+ "waived-workday-list": "已豁免工作日列表",
+ "waiver-manager": "工作日豁免管理员",
+ "waiver-reason": "豁免原因",
+ "year": "年",
+ "yes": "是"
+ },
+ "$Generic": {
+ "hours-on-invalid": "this.setCustomValidity(\"请以有效的 24 小时格式输入时间,从 00:00 到 23:59\")"
+ }
+}
diff --git a/locales/zh-CN/translation.missing.json b/locales/zh-CN/translation.missing.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/locales/zh-CN/translation.missing.json
@@ -0,0 +1 @@
+{}
diff --git a/src/configs/app.config.js b/src/configs/app.config.js
index 4db135841..9894da557 100644
--- a/src/configs/app.config.js
+++ b/src/configs/app.config.js
@@ -27,6 +27,7 @@ const languages = {
'th-TH': 'ไทย',
'tr-TR':'Türkçe',
'uk-UA': 'Українська',
+ 'zh-CN': '简体中文',
'zh-TW': '繁體中文',
};