From 3c5caa07718804f7bc2c615069d0332f6f6437e6 Mon Sep 17 00:00:00 2001 From: ko_teiru Date: Sat, 25 Jun 2022 22:19:36 +0800 Subject: [PATCH 1/5] Add Simplified Chinese and Traditional Chinese --- src/assets/localization/languages/zh-Hans.json | 12 ++++++++++++ src/assets/localization/languages/zh-Hant.json | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/assets/localization/languages/zh-Hans.json create mode 100644 src/assets/localization/languages/zh-Hant.json diff --git a/src/assets/localization/languages/zh-Hans.json b/src/assets/localization/languages/zh-Hans.json new file mode 100644 index 0000000..8a7c20d --- /dev/null +++ b/src/assets/localization/languages/zh-Hans.json @@ -0,0 +1,12 @@ +{ + "Azimuth": "方位角", + "Dawn": "拂晓", + "Dusk": "傍晚", + "Elevation": "仰角", + "Noon": "日中", + "Sunrise": "日出", + "Sunset": "日落", + "errors": { + "SunIntegrationNotFound": "未搜索到集成 Sun" + } +} diff --git a/src/assets/localization/languages/zh-Hant.json b/src/assets/localization/languages/zh-Hant.json new file mode 100644 index 0000000..c2dc4d9 --- /dev/null +++ b/src/assets/localization/languages/zh-Hant.json @@ -0,0 +1,12 @@ +{ + "Azimuth": "方位", + "Dawn": "黎明", + "Dusk": "黃昏", + "Elevation": "仰角", + "Noon": "日正當中", + "Sunrise": "日昇", + "Sunset": "日落", + "errors": { + "SunIntegrationNotFound": "沒有找到整合 Sun" + } +} From 60b0f37bbdf7979f605a62d9f62568233654ae8e Mon Sep 17 00:00:00 2001 From: ko_teiru Date: Sat, 25 Jun 2022 22:35:48 +0800 Subject: [PATCH 2/5] Set up new languages --- README.md | 2 +- src/constants.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 77fbbad..c921cca 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Note: If you get an error similar to this `Custom element doesn't exist` you wil | timeFormat | `'12h'`/`'24h'` | Displayed time format | Locale based on Home assistant language | | title | `string` | Card title | Doesn't display a title by default | | -(1) Supported languages: `da`, `de`, `en`, `es`, `et`, `fi`, `fr`, `hu`, `it`, `nl`, `pl`, `pt-BR`, `ru`, `sl`, `sv` +(1) Supported languages: `da`, `de`, `en`, `es`, `et`, `fi`, `fr`, `hu`, `it`, `nl`, `pl`, `pt-BR`, `ru`, `sl`, `sv`, `zh-Hans`, `zh-Hant` ## Known issues - Home assistant seems to provide next events instead today's one diff --git a/src/constants.ts b/src/constants.ts index 746463c..1dcf8f2 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -13,6 +13,8 @@ import ptBR from './assets/localization/languages/pt-BR.json' import ru from './assets/localization/languages/ru.json' import sl from './assets/localization/languages/sl.json' import sv from './assets/localization/languages/sv.json' +import zh_Hans from './assets/localization/languages/zh-Hans.json' +import zh_Hant from './assets/localization/languages/zh-Hant.json' import { TSunCardConfig, TSunCardTexts } from './types' export class Constants { @@ -33,7 +35,7 @@ export class Constants { static readonly HORIZON_Y = 108 static readonly LOCALIZATION_LANGUAGES: Record = { - da, de, en, es, et, fi, fr, hu, it, nl, pl, 'pt-BR': ptBR, ru, sl, sv + da, de, en, es, et, fi, fr, hu, it, nl, pl, 'pt-BR': ptBR, ru, sl, sv, 'zh-Hans': zh_Hans, 'zh_Hant': zh_Hant } static readonly SUN_RADIUS = 17 } From 4d59cf19c4a23f68af24a144a3f6df03efaf0787 Mon Sep 17 00:00:00 2001 From: Small-tailqwq <56996438+Small-tailqwq@users.noreply.github.com> Date: Sun, 26 Jun 2022 14:27:10 +0800 Subject: [PATCH 3/5] Bug fix Bug fix --- src/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index 1dcf8f2..f0537ba 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -35,7 +35,7 @@ export class Constants { static readonly HORIZON_Y = 108 static readonly LOCALIZATION_LANGUAGES: Record = { - da, de, en, es, et, fi, fr, hu, it, nl, pl, 'pt-BR': ptBR, ru, sl, sv, 'zh-Hans': zh_Hans, 'zh_Hant': zh_Hant + da, de, en, es, et, fi, fr, hu, it, nl, pl, 'pt-BR': ptBR, ru, sl, sv, 'zh-Hans': zh_Hans, 'zh-Hant': zh_Hant } static readonly SUN_RADIUS = 17 } From cce4e2f1fd6762c71a1b0d9b6cc25f1d9b6e0d0e Mon Sep 17 00:00:00 2001 From: ko_teiru Date: Sun, 26 Jun 2022 15:11:21 +0800 Subject: [PATCH 4/5] Add Japanese --- README.md | 2 +- src/assets/localization/languages/ja.json | 12 +++++++++++ .../localization/languages/zh-Hans.json | 20 +++++++++---------- .../localization/languages/zh-Hant.json | 20 +++++++++---------- src/constants.ts | 3 ++- 5 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 src/assets/localization/languages/ja.json diff --git a/README.md b/README.md index c921cca..cd93937 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Note: If you get an error similar to this `Custom element doesn't exist` you wil | timeFormat | `'12h'`/`'24h'` | Displayed time format | Locale based on Home assistant language | | title | `string` | Card title | Doesn't display a title by default | | -(1) Supported languages: `da`, `de`, `en`, `es`, `et`, `fi`, `fr`, `hu`, `it`, `nl`, `pl`, `pt-BR`, `ru`, `sl`, `sv`, `zh-Hans`, `zh-Hant` +(1) Supported languages: `da`, `de`, `en`, `es`, `et`, `fi`, `fr`, `hu`, `it`, `ja`, `nl`, `pl`, `pt-BR`, `ru`, `sl`, `sv`, `zh-Hans`, `zh-Hant` ## Known issues - Home assistant seems to provide next events instead today's one diff --git a/src/assets/localization/languages/ja.json b/src/assets/localization/languages/ja.json new file mode 100644 index 0000000..8208b45 --- /dev/null +++ b/src/assets/localization/languages/ja.json @@ -0,0 +1,12 @@ +{ + "Azimuth": "方位角", + "Dawn": "明け方", + "Dusk": "夕", + "Elevation": "仰俯角", + "Noon": "日中", + "Sunrise": "日出", + "Sunset": "日沒", + "errors": { + "SunIntegrationNotFound": "インテグレーション Sun は検索できません" + } +} diff --git a/src/assets/localization/languages/zh-Hans.json b/src/assets/localization/languages/zh-Hans.json index 8a7c20d..ea38e35 100644 --- a/src/assets/localization/languages/zh-Hans.json +++ b/src/assets/localization/languages/zh-Hans.json @@ -1,12 +1,12 @@ { - "Azimuth": "方位角", - "Dawn": "拂晓", - "Dusk": "傍晚", - "Elevation": "仰角", - "Noon": "日中", - "Sunrise": "日出", - "Sunset": "日落", - "errors": { - "SunIntegrationNotFound": "未搜索到集成 Sun" - } + "Azimuth": "方位角", + "Dawn": "拂晓", + "Dusk": "傍晚", + "Elevation": "仰角", + "Noon": "日中", + "Sunrise": "日出", + "Sunset": "日落", + "errors": { + "SunIntegrationNotFound": "未搜索到集成 Sun" + } } diff --git a/src/assets/localization/languages/zh-Hant.json b/src/assets/localization/languages/zh-Hant.json index c2dc4d9..df3b027 100644 --- a/src/assets/localization/languages/zh-Hant.json +++ b/src/assets/localization/languages/zh-Hant.json @@ -1,12 +1,12 @@ { - "Azimuth": "方位", - "Dawn": "黎明", - "Dusk": "黃昏", - "Elevation": "仰角", - "Noon": "日正當中", - "Sunrise": "日昇", - "Sunset": "日落", - "errors": { - "SunIntegrationNotFound": "沒有找到整合 Sun" - } + "Azimuth": "方位", + "Dawn": "黎明", + "Dusk": "黃昏", + "Elevation": "仰角", + "Noon": "日正當中", + "Sunrise": "日昇", + "Sunset": "日落", + "errors": { + "SunIntegrationNotFound": "沒有找到整合 Sun" + } } diff --git a/src/constants.ts b/src/constants.ts index 1dcf8f2..e16916b 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -7,6 +7,7 @@ import fi from './assets/localization/languages/fi.json' import fr from './assets/localization/languages/fr.json' import hu from './assets/localization/languages/hu.json' import it from './assets/localization/languages/it.json' +import ja from './assets/localization/languages/ja.json' import nl from './assets/localization/languages/nl.json' import pl from './assets/localization/languages/pl.json' import ptBR from './assets/localization/languages/pt-BR.json' @@ -35,7 +36,7 @@ export class Constants { static readonly HORIZON_Y = 108 static readonly LOCALIZATION_LANGUAGES: Record = { - da, de, en, es, et, fi, fr, hu, it, nl, pl, 'pt-BR': ptBR, ru, sl, sv, 'zh-Hans': zh_Hans, 'zh_Hant': zh_Hant + da, de, en, es, et, fi, fr, hu, it, nl, pl, 'pt-BR': ptBR, ru, sl, sv, 'zh-Hans': zh_Hans, 'zh-Hant': zh_Hant, ja } static readonly SUN_RADIUS = 17 } From 3a6756e2a4e964aa4bf74235ee478d03a09d1998 Mon Sep 17 00:00:00 2001 From: ko_teiru Date: Sun, 26 Jun 2022 15:18:34 +0800 Subject: [PATCH 5/5] Correction of vocabulary --- src/assets/localization/languages/ja.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/localization/languages/ja.json b/src/assets/localization/languages/ja.json index 8208b45..cc2545d 100644 --- a/src/assets/localization/languages/ja.json +++ b/src/assets/localization/languages/ja.json @@ -3,7 +3,7 @@ "Dawn": "明け方", "Dusk": "夕", "Elevation": "仰俯角", - "Noon": "日中", + "Noon": "太陽の正午", "Sunrise": "日出", "Sunset": "日沒", "errors": {