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/),
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

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

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

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

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

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

@ -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 currently
supported.
</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',
'pl',
'pt',
'tr'
'tr',
'zh'
];
export const UNKNOWN_KEY = 'UNKNOWN';

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

Loading…
Cancel
Save