Skip to content

Commit

Permalink
Add Chinese and Japanese translation
Browse files Browse the repository at this point in the history
Based on commit 3a6756e

Resolves #35
Resolves #34
Co-authored-by: Thomas Dietrich <[email protected]>
  • Loading branch information
Small-tailqwq authored and ThomDietrich committed Mar 27, 2023
1 parent c1e42e3 commit c2e201d
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Supported options for the `language` setting:
- `he` Hebrew
- `hu` Hungarian
- `is` Icelandic
- `ja` Japanese
- `it` Italian
- `lt` Lithuanian
- `nb` Norwegian (Bokmål)
Expand All @@ -133,6 +134,8 @@ Supported options for the `language` setting:
- `sv` Swedish
- `tr` Turkish
- `uk` Ukrainian
- `zh-Hans` Chinese, simplified
- `zh-Hant` Chinese, traditional

## Known Issues

Expand Down
12 changes: 12 additions & 0 deletions src/assets/localization/languages/ja.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"azimuth": "方位角",
"dawn": "明け方",
"dusk": "",
"elevation": "仰俯角",
"noon": "太陽の正午",
"sunrise": "日出",
"sunset": "日沒",
"errors": {
"SunIntegrationNotFound": "インテグレーション Sun は検索できません"
}
}
12 changes: 12 additions & 0 deletions src/assets/localization/languages/zh-Hans.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"azimuth": "方位角",
"dawn": "拂晓",
"dusk": "傍晚",
"elevation": "仰角",
"noon": "日中",
"sunrise": "日出",
"sunset": "日落",
"errors": {
"SunIntegrationNotFound": "未搜索到集成 Sun"
}
}
12 changes: 12 additions & 0 deletions src/assets/localization/languages/zh-Hant.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"azimuth": "方位",
"dawn": "黎明",
"dusk": "黃昏",
"elevation": "仰角",
"noon": "日正當中",
"sunrise": "日昇",
"sunset": "日落",
"errors": {
"SunIntegrationNotFound": "沒有找到整合 Sun"
}
}
6 changes: 5 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import he from './assets/localization/languages/he.json'
import hu from './assets/localization/languages/hu.json'
import is from './assets/localization/languages/is.json'
import it from './assets/localization/languages/it.json'
import ja from './assets/localization/languages/ja.json'
import lt from './assets/localization/languages/lt.json'
import nb from './assets/localization/languages/nb.json'
import nl from './assets/localization/languages/nl.json'
Expand All @@ -25,6 +26,9 @@ import sl from './assets/localization/languages/sl.json'
import sv from './assets/localization/languages/sv.json'
import tr from './assets/localization/languages/tr.json'
import uk from './assets/localization/languages/uk.json'
import zh_Hans from './assets/localization/languages/zh-Hans.json'
import zh_Hant from './assets/localization/languages/zh-Hant.json'

import { IHorizonCardConfig, THorizonCardI18NKeys, THorizonCardTimes, TSunInfo } from './types'

export class Constants {
Expand Down Expand Up @@ -83,7 +87,7 @@ export class Constants {
}

static readonly LOCALIZATION_LANGUAGES: Record<string, THorizonCardI18NKeys> = {
bg, ca, cs, da, de, en, es, et, fi, fr, he, hu, is, it, lt, nb, nl, nn, pl, 'pt-BR': ptBR, ro, ru, sk, sl, sv, tr, uk
bg, ca, cs, da, de, en, es, et, fi, fr, he, hu, is, it, ja, lt, nb, nl, nn, pl, 'pt-BR': ptBR, ro, ru, sk, sl, sv, tr, uk, 'zh-Hans': zh_Hans, 'zh-Hant': zh_Hant
}

static readonly FALLBACK_LOCALIZATION = en
Expand Down

0 comments on commit c2e201d

Please sign in to comment.