Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Feature/setup chinese (#3220)
Thomas Kaul51203ec96ee1
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex fec72562e2..39cefd95ff 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### Addeddiff --git a/apps/api/src/assets/sitemap.xml b/apps/api/src/assets/sitemap.xmlindex 3aeadc0355..e527df8d0d 100644--- a/apps/api/src/assets/sitemap.xml+++ b/apps/api/src/assets/sitemap.xml@@ -1232,10 +1232,12 @@<loc>https://ghostfol.io/nl/veelgestelde-vragen</loc><lastmod>${currentDate}T00:00:00+00:00</lastmod></url>+ <!--<url><loc>https://ghostfol.io/pl</loc><lastmod>${currentDate}T00:00:00+00:00</lastmod></url>+ --><url><loc>https://ghostfol.io/pt</loc><lastmod>${currentDate}T00:00:00+00:00</lastmod>@@ -1296,4 +1298,10 @@<loc>https://ghostfol.io/tr</loc><lastmod>${currentDate}T00:00:00+00:00</lastmod></url>+ <!--+ <url>+ <loc>https://ghostfol.io/zh</loc>+ <lastmod>${currentDate}T00:00:00+00:00</lastmod>+ </url>+ --></urlset>diff --git a/apps/client/project.json b/apps/client/project.jsonindex 8d778bef4f..0cd576e16b 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.htmlindex 713eb1a94b..29541962ba 100644--- a/apps/client/src/app/app.component.html+++ b/apps/client/src/app/app.component.html@@ -163,6 +163,11 @@<a href="../tr" title="Ghostfolio in Türkçe">Türkçe</a></li>-->+ <!--+ <li>+ <a href="../zh" title="Ghostfolio in Chinese">Chinese</a>+ </li>+ --></ul></div></div>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.tsindex f176c0847d..c6d7f8e89c 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.htmlindex df423ba165..1ad24e22ea 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 @@<mat-option [value]="null" /><mat-option value="de">Deutsch</mat-option><mat-option value="en">English</mat-option>+ @if (user?.settings?.isExperimentalFeatures) {+ <mat-option value="zh"+ >Chinese (<ng-container i18n>Community</ng-container+ >)</mat-option+ >+ }<mat-option value="es">Español (<ng-container i18n>Community</ng-container>)</mat-option@@ -92,10 +98,12 @@>Nederlands (<ng-container i18n>Community</ng-container>)</mat-option>- <mat-option value="pl"- >Polski (<ng-container i18n>Community</ng-container- >)</mat-option- >+ @if (user?.settings?.isExperimentalFeatures) {+ <mat-option value="pl"+ >Polski (<ng-container i18n>Community</ng-container+ >)</mat-option+ >+ }<mat-option value="pt">Português (<ng-container i18n>Community</ng-container>)</mat-optiondiff --git a/apps/client/src/app/pages/features/features-page.html b/apps/client/src/app/pages/features/features-page.htmlindex 01fce0f001..16a126b51b 100644--- a/apps/client/src/app/pages/features/features-page.html+++ b/apps/client/src/app/pages/features/features-page.html@@ -240,8 +240,8 @@<div class="flex-grow-1"><h4 i18n>Multi-Language</h4><p class="m-0">- Use Ghostfolio in multiple languages: English, Dutch, French,- German, Italian,+ Use Ghostfolio in multiple languages: English,+ <!-- Chinese, -->Dutch, French, German, Italian,<!-- Polish, -->Portuguese, Spanish and Turkish are currentlysupported.</p>diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlfnew file mode 100644index 0000000000..f1e528dd06--- /dev/null+++ b/apps/client/src/locales/messages.zh.xlf@@ -0,0 +1,6 @@+<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">+ <file source-language="en" target-language="zh" datatype="plaintext" original="ng2.template">+ <body>+ </body>+ </file>+</xliff>diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.tsindex 3bbe0ff8c0..293f77488f 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.tsindex b49589aab7..e03ea1a1ff 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;