mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-03 12:52:16 +00:00
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:
co-authored by
Silvan
Max Peintner
parent
5052aa1c12
commit
8ab85afd15
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user