Feature/setup chinese (#3220)

* Set up chinese

* Update changelog
pull/3221/head^2
Thomas Kaul 3 months ago committed by GitHub
parent a2277dea2c
commit 51203ec96e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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/), 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). 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 ## 2.69.0 - 2024-03-30
### Added ### Added

@ -1232,10 +1232,12 @@
<loc>https://ghostfol.io/nl/veelgestelde-vragen</loc> <loc>https://ghostfol.io/nl/veelgestelde-vragen</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod> <lastmod>${currentDate}T00:00:00+00:00</lastmod>
</url> </url>
<!--
<url> <url>
<loc>https://ghostfol.io/pl</loc> <loc>https://ghostfol.io/pl</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod> <lastmod>${currentDate}T00:00:00+00:00</lastmod>
</url> </url>
-->
<url> <url>
<loc>https://ghostfol.io/pt</loc> <loc>https://ghostfol.io/pt</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod> <lastmod>${currentDate}T00:00:00+00:00</lastmod>
@ -1296,4 +1298,10 @@
<loc>https://ghostfol.io/tr</loc> <loc>https://ghostfol.io/tr</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod> <lastmod>${currentDate}T00:00:00+00:00</lastmod>
</url> </url>
<!--
<url>
<loc>https://ghostfol.io/zh</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod>
</url>
-->
</urlset> </urlset>

@ -72,6 +72,10 @@
"baseHref": "/tr/", "baseHref": "/tr/",
"localize": ["tr"] "localize": ["tr"]
}, },
"development-zh": {
"baseHref": "/zh/",
"localize": ["zh"]
},
"production": { "production": {
"fileReplacements": [ "fileReplacements": [
{ {
@ -190,6 +194,9 @@
"development-tr": { "development-tr": {
"buildTarget": "client:build:development-tr" "buildTarget": "client:build:development-tr"
}, },
"development-zh": {
"buildTarget": "client:build:development-zh"
},
"production": { "production": {
"buildTarget": "client:build:production" "buildTarget": "client:build:production"
} }
@ -209,7 +216,8 @@
"messages.nl.xlf", "messages.nl.xlf",
"messages.pl.xlf", "messages.pl.xlf",
"messages.pt.xlf", "messages.pt.xlf",
"messages.tr.xlf" "messages.tr.xlf",
"messages.zh.xlf"
] ]
} }
}, },
@ -260,6 +268,10 @@
"tr": { "tr": {
"baseHref": "/tr/", "baseHref": "/tr/",
"translation": "apps/client/src/locales/messages.tr.xlf" "translation": "apps/client/src/locales/messages.tr.xlf"
},
"zh": {
"baseHref": "/zh/",
"translation": "apps/client/src/locales/messages.zh.xlf"
} }
}, },
"sourceLocale": "en" "sourceLocale": "en"

@ -163,6 +163,11 @@
<a href="../tr" title="Ghostfolio in Türkçe">Türkçe</a> <a href="../tr" title="Ghostfolio in Türkçe">Türkçe</a>
</li> </li>
--> -->
<!--
<li>
<a href="../zh" title="Ghostfolio in Chinese">Chinese</a>
</li>
-->
</ul> </ul>
</div> </div>
</div> </div>

@ -48,7 +48,8 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit {
'nl', 'nl',
'pl', 'pl',
'pt', 'pt',
'tr' 'tr',
'zh'
]; ];
public user: User; public user: User;

@ -76,6 +76,12 @@
<mat-option [value]="null" /> <mat-option [value]="null" />
<mat-option value="de">Deutsch</mat-option> <mat-option value="de">Deutsch</mat-option>
<mat-option value="en">English</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" <mat-option value="es"
>Español (<ng-container i18n>Community</ng-container >Español (<ng-container i18n>Community</ng-container
>)</mat-option >)</mat-option
@ -92,10 +98,12 @@
>Nederlands (<ng-container i18n>Community</ng-container >Nederlands (<ng-container i18n>Community</ng-container
>)</mat-option >)</mat-option
> >
@if (user?.settings?.isExperimentalFeatures) {
<mat-option value="pl" <mat-option value="pl"
>Polski (<ng-container i18n>Community</ng-container >Polski (<ng-container i18n>Community</ng-container
>)</mat-option >)</mat-option
> >
}
<mat-option value="pt" <mat-option value="pt"
>Português (<ng-container i18n>Community</ng-container >Português (<ng-container i18n>Community</ng-container
>)</mat-option >)</mat-option

@ -240,8 +240,8 @@
<div class="flex-grow-1"> <div class="flex-grow-1">
<h4 i18n>Multi-Language</h4> <h4 i18n>Multi-Language</h4>
<p class="m-0"> <p class="m-0">
Use Ghostfolio in multiple languages: English, Dutch, French, Use Ghostfolio in multiple languages: English,
German, Italian, <!-- Chinese, -->Dutch, French, German, Italian,
<!-- Polish, -->Portuguese, Spanish and Turkish are currently <!-- Polish, -->Portuguese, Spanish and Turkish are currently
supported. supported.
</p> </p>

@ -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>

@ -137,7 +137,8 @@ export const SUPPORTED_LANGUAGE_CODES = [
'nl', 'nl',
'pl', 'pl',
'pt', 'pt',
'tr' 'tr',
'zh'
]; ];
export const UNKNOWN_KEY = 'UNKNOWN'; export const UNKNOWN_KEY = 'UNKNOWN';

@ -11,7 +11,7 @@ import {
parseISO, parseISO,
subDays subDays
} from 'date-fns'; } 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 { ghostfolioScraperApiSymbolPrefix, locale } from './config';
import { Benchmark, UniqueAsset } from './interfaces'; import { Benchmark, UniqueAsset } from './interfaces';
@ -178,6 +178,8 @@ export function getDateFnsLocale(aLanguageCode: string) {
return pt; return pt;
} else if (aLanguageCode === 'tr') { } else if (aLanguageCode === 'tr') {
return tr; return tr;
} else if (aLanguageCode === 'zh') {
return zhCN;
} }
return undefined; return undefined;

Loading…
Cancel
Save