diff --git a/CHANGELOG.md b/CHANGELOG.md index fec72562e..39cefd95f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Set up the language localization for Chinese (`zh`) + ## 2.69.0 - 2024-03-30 ### Added diff --git a/apps/api/src/assets/sitemap.xml b/apps/api/src/assets/sitemap.xml index 3aeadc035..e527df8d0 100644 --- a/apps/api/src/assets/sitemap.xml +++ b/apps/api/src/assets/sitemap.xml @@ -1232,10 +1232,12 @@ https://ghostfol.io/nl/veelgestelde-vragen ${currentDate}T00:00:00+00:00 + https://ghostfol.io/pt ${currentDate}T00:00:00+00:00 @@ -1296,4 +1298,10 @@ https://ghostfol.io/tr ${currentDate}T00:00:00+00:00 + diff --git a/apps/client/project.json b/apps/client/project.json index 8d778bef4..0cd576e16 100644 --- a/apps/client/project.json +++ b/apps/client/project.json @@ -72,6 +72,10 @@ "baseHref": "/tr/", "localize": ["tr"] }, + "development-zh": { + "baseHref": "/zh/", + "localize": ["zh"] + }, "production": { "fileReplacements": [ { @@ -190,6 +194,9 @@ "development-tr": { "buildTarget": "client:build:development-tr" }, + "development-zh": { + "buildTarget": "client:build:development-zh" + }, "production": { "buildTarget": "client:build:production" } @@ -209,7 +216,8 @@ "messages.nl.xlf", "messages.pl.xlf", "messages.pt.xlf", - "messages.tr.xlf" + "messages.tr.xlf", + "messages.zh.xlf" ] } }, @@ -260,6 +268,10 @@ "tr": { "baseHref": "/tr/", "translation": "apps/client/src/locales/messages.tr.xlf" + }, + "zh": { + "baseHref": "/zh/", + "translation": "apps/client/src/locales/messages.zh.xlf" } }, "sourceLocale": "en" diff --git a/apps/client/src/app/app.component.html b/apps/client/src/app/app.component.html index 713eb1a94..29541962b 100644 --- a/apps/client/src/app/app.component.html +++ b/apps/client/src/app/app.component.html @@ -163,6 +163,11 @@ Türkçe --> + diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts index f176c0847..c6d7f8e89 100644 --- a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts +++ b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts @@ -48,7 +48,8 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit { 'nl', 'pl', 'pt', - 'tr' + 'tr', + 'zh' ]; public user: User; diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.html b/apps/client/src/app/components/user-account-settings/user-account-settings.html index df423ba16..1ad24e22e 100644 --- a/apps/client/src/app/components/user-account-settings/user-account-settings.html +++ b/apps/client/src/app/components/user-account-settings/user-account-settings.html @@ -76,6 +76,12 @@ Deutsch English + @if (user?.settings?.isExperimentalFeatures) { + Chinese (Community) + } Español (Community)Nederlands (Community) - Polski (Community) + @if (user?.settings?.isExperimentalFeatures) { + Polski (Community) + } Português (Community)

Multi-Language

- Use Ghostfolio in multiple languages: English, Dutch, French, - German, Italian, + Use Ghostfolio in multiple languages: English, + Dutch, French, German, Italian, Portuguese, Spanish and Turkish are currently supported.

diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf new file mode 100644 index 000000000..f1e528dd0 --- /dev/null +++ b/apps/client/src/locales/messages.zh.xlf @@ -0,0 +1,6 @@ + + + + + + diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.ts index 3bbe0ff8c..293f77488 100644 --- a/libs/common/src/lib/config.ts +++ b/libs/common/src/lib/config.ts @@ -137,7 +137,8 @@ export const SUPPORTED_LANGUAGE_CODES = [ 'nl', 'pl', 'pt', - 'tr' + 'tr', + 'zh' ]; export const UNKNOWN_KEY = 'UNKNOWN'; diff --git a/libs/common/src/lib/helper.ts b/libs/common/src/lib/helper.ts index b49589aab..e03ea1a1f 100644 --- a/libs/common/src/lib/helper.ts +++ b/libs/common/src/lib/helper.ts @@ -11,7 +11,7 @@ import { parseISO, subDays } from 'date-fns'; -import { de, es, fr, it, nl, pl, pt, tr } from 'date-fns/locale'; +import { de, es, fr, it, nl, pl, pt, tr, zhCN } from 'date-fns/locale'; import { ghostfolioScraperApiSymbolPrefix, locale } from './config'; import { Benchmark, UniqueAsset } from './interfaces'; @@ -178,6 +178,8 @@ export function getDateFnsLocale(aLanguageCode: string) { return pt; } else if (aLanguageCode === 'tr') { return tr; + } else if (aLanguageCode === 'zh') { + return zhCN; } return undefined;