From c5b7705a6f948bafed60201dffd76a1fdab3cade Mon Sep 17 00:00:00 2001 From: Yigong Hu Date: Sat, 23 Nov 2024 12:51:11 +0000 Subject: [PATCH 1/3] add: Chinese translation --- src/translations/day_name.toml | 11 ++++++++++- src/translations/month_name.toml | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/translations/day_name.toml b/src/translations/day_name.toml index e6c5457..54080be 100644 --- a/src/translations/day_name.toml +++ b/src/translations/day_name.toml @@ -50,4 +50,13 @@ 4 = "חמישי" 5 = "שישי" 6 = "שבת" -7 = "ראשון" \ No newline at end of file +7 = "ראשון" + +[zh] +1 = "星期一" +2 = "星期二" +3 = "星期三" +4 = "星期四" +5 = "星期五" +6 = "星期六" +7 = "星期天" diff --git a/src/translations/month_name.toml b/src/translations/month_name.toml index ca245d9..ce2fb97 100644 --- a/src/translations/month_name.toml +++ b/src/translations/month_name.toml @@ -80,4 +80,18 @@ 9 = "ספטמבר" 10 = "אוקטובר" 11 = "נובמבר" -12 = "דצמבר" \ No newline at end of file +12 = "דצמבר" + +[zh] +1 = "一月" +2 = "二月" +3 = "三月" +4 = "四月" +5 = "五月" +6 = "六月" +7 = "七月" +8 = "八月" +9 = "九月" +10 = "十月" +11 = "十一月" +12 = "十二月" From 8d0a380cea31089745709db5edbff66e0fe087f5 Mon Sep 17 00:00:00 2001 From: Yigong Hu Date: Sat, 23 Nov 2024 21:07:44 +0000 Subject: [PATCH 2/3] add: tests for Chinese translation --- tests/test_formats.typ | 5 ++++- tests/test_translations.typ | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_formats.typ b/tests/test_formats.typ index fe66908..15b4bda 100644 --- a/tests/test_formats.typ +++ b/tests/test_formats.typ @@ -32,4 +32,7 @@ #assert(custom-date-format(hebrew_date, "day, ה-DD לmonth, YYYY", "he") == "שבת, ה-23 לנובמבר, 2024") #let hebrew_date = datetime(year: 2024, month: 12, day: 7) -#assert(custom-date-format(hebrew_date, "day, ה-DD לmonth, YYYY", "he") == "שבת, ה-07 לדצמבר, 2024") \ No newline at end of file +#assert(custom-date-format(hebrew_date, "day, ה-DD לmonth, YYYY", "he") == "שבת, ה-07 לדצמבר, 2024") + +#let chinese_date = datetime(year: 2024, month: 5, day: 23) +#assert(custom-date-format(chinese_date, "YYYY 年MMM DD 日 day", "zh") == "2024 年一月 11 日 星期四") \ No newline at end of file diff --git a/tests/test_translations.typ b/tests/test_translations.typ index b1f06ba..477e979 100644 --- a/tests/test_translations.typ +++ b/tests/test_translations.typ @@ -12,3 +12,5 @@ #assert(month-name(1, "pt") == "janeiro") #assert(day-name(7, "he") == "ראשון") #assert(month-name(1, "he") == "ינואר") +#assert(day-name(1, "zh", true) == "星期一") +#assert(month-name(1, "zh", true) == "一月") \ No newline at end of file From a48a9a95ac857dbcd269189d08fc416c7a3b14fb Mon Sep 17 00:00:00 2001 From: Yigong Hu Date: Sat, 23 Nov 2024 21:24:17 +0000 Subject: [PATCH 3/3] fix: test formats in Chinese --- tests/test_formats.typ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_formats.typ b/tests/test_formats.typ index 15b4bda..1df1ba1 100644 --- a/tests/test_formats.typ +++ b/tests/test_formats.typ @@ -35,4 +35,4 @@ #assert(custom-date-format(hebrew_date, "day, ה-DD לmonth, YYYY", "he") == "שבת, ה-07 לדצמבר, 2024") #let chinese_date = datetime(year: 2024, month: 5, day: 23) -#assert(custom-date-format(chinese_date, "YYYY 年MMM DD 日 day", "zh") == "2024 年一月 11 日 星期四") \ No newline at end of file +#assert(custom-date-format(chinese_date, "YYYY 年MMMM DD 日,day", "zh") == "2024 年五月 11 日,星期四") \ No newline at end of file