feat: internationalization Chinese (#4222)

* feat: internationalization chinese

* typo: optimize the semantic expression of copywriting

* Update internal/api/ui/login/static/i18n/zh.yaml

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/it.json

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/en.json

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/zh.json

Co-authored-by: Silvan <[email protected]>

* Update internal/api/ui/login/static/i18n/zh.yaml

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/it.json

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/it.json

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/fr.json

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/en.json

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/en.json

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/fr.json

Co-authored-by: Silvan <[email protected]>

* Update console/src/assets/i18n/fr.json

Co-authored-by: Silvan <[email protected]>

* minor: add Chinese to other language file

* Update console/src/app/app.module.ts

Co-authored-by: Max Peintner <[email protected]>

* Update console/src/app/app.module.ts

Co-authored-by: Max Peintner <[email protected]>

Co-authored-by: Silvan <[email protected]>
Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
George
2022-09-08 15:15:31 +02:00
committed by GitHub
co-authored by Silvan Max Peintner
parent 5052aa1c12
commit 8ab85afd15
17 changed files with 3259 additions and 23 deletions
+3 -3
View File
@@ -271,16 +271,16 @@ export class AppComponent implements OnDestroy {
}
private setLanguage(): void {
this.translate.addLangs(['en', 'de']);
this.translate.addLangs(['en', 'de', 'zh']);
this.translate.setDefaultLang('en');
this.authService.user.subscribe((userprofile) => {
if (userprofile) {
// this.user = userprofile;
const cropped = navigator.language.split('-')[0] ?? 'en';
const fallbackLang = cropped.match(/en|de|it/) ? cropped : 'en';
const fallbackLang = cropped.match(/en|de|it|zh/) ? cropped : 'en';
const lang = userprofile?.human?.profile?.preferredLanguage.match(/en|de|it/)
const lang = userprofile?.human?.profile?.preferredLanguage.match(/en|de|it|zh/)
? userprofile.human.profile?.preferredLanguage
: fallbackLang;
this.translate.use(lang);