mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:37:31 +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 <silvan.reusser@gmail.com> * Update console/src/assets/i18n/it.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update console/src/assets/i18n/en.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update console/src/assets/i18n/zh.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update internal/api/ui/login/static/i18n/zh.yaml Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update console/src/assets/i18n/it.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update console/src/assets/i18n/it.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update console/src/assets/i18n/fr.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update console/src/assets/i18n/en.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update console/src/assets/i18n/en.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update console/src/assets/i18n/fr.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update console/src/assets/i18n/fr.json Co-authored-by: Silvan <silvan.reusser@gmail.com> * minor: add Chinese to other language file * Update console/src/app/app.module.ts Co-authored-by: Max Peintner <max@caos.ch> * Update console/src/app/app.module.ts Co-authored-by: Max Peintner <max@caos.ch> Co-authored-by: Silvan <silvan.reusser@gmail.com> Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
@@ -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);
|
||||
|
@@ -1,6 +1,10 @@
|
||||
import { CommonModule, registerLocaleData } from '@angular/common';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import localeDe from '@angular/common/locales/de';
|
||||
import localeZh from '@angular/common/locales/zh';
|
||||
import localeFr from '@angular/common/locales/fr';
|
||||
import localeIt from '@angular/common/locales/it';
|
||||
import localeEn from '@angular/common/locales/en';
|
||||
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
||||
import { MatNativeDateModule } from '@angular/material/core';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
@@ -55,6 +59,10 @@ import { ThemeService } from './services/theme.service';
|
||||
import { ToastService } from './services/toast.service';
|
||||
|
||||
registerLocaleData(localeDe);
|
||||
registerLocaleData(localeZh);
|
||||
registerLocaleData(localeFr);
|
||||
registerLocaleData(localeIt);
|
||||
registerLocaleData(localeEn);
|
||||
|
||||
export class WebpackTranslateLoader implements TranslateLoader {
|
||||
getTranslation(lang: string): Observable<any> {
|
||||
|
@@ -25,7 +25,7 @@ import { EditDialogComponent, EditDialogType } from './edit-dialog/edit-dialog.c
|
||||
export class AuthUserDetailComponent implements OnDestroy {
|
||||
public user?: User.AsObject;
|
||||
public genders: Gender[] = [Gender.GENDER_MALE, Gender.GENDER_FEMALE, Gender.GENDER_DIVERSE];
|
||||
public languages: string[] = ['de', 'en', 'it'];
|
||||
public languages: string[] = ['de', 'en', 'fr', 'it', 'zh'];
|
||||
|
||||
private subscription: Subscription = new Subscription();
|
||||
|
||||
|
@@ -22,11 +22,8 @@ export class LocalizedDatePipe implements PipeTransform {
|
||||
return moment(value).format(`${format}, HH:mm`);
|
||||
}
|
||||
} else {
|
||||
const lang = this.translateService.currentLang === ('de' || 'it' || 'en') ? this.translateService.currentLang : 'en';
|
||||
const datePipe: DatePipe = new DatePipe(
|
||||
lang,
|
||||
// ['de', 'it', 'en'].includes(this.translateService.currentLang) ? this.translateService.currentLang : 'en',
|
||||
);
|
||||
const lang = ['de', 'en', 'fr', 'it', 'zh'].includes(this.translateService.currentLang) ? this.translateService.currentLang : 'en';
|
||||
const datePipe: DatePipe = new DatePipe(lang);
|
||||
return datePipe.transform(value, pattern ?? 'mediumDate');
|
||||
}
|
||||
}
|
||||
|
@@ -892,7 +892,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "Chinese"
|
||||
},
|
||||
"SMTP": {
|
||||
"TITLE": "SMTP Einstellungen",
|
||||
@@ -1072,7 +1073,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "Chinese"
|
||||
},
|
||||
"KEYS": {
|
||||
"emailVerificationDoneText": "Email Verification erfolgreich",
|
||||
@@ -1817,7 +1819,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "Chinese"
|
||||
},
|
||||
"MEMBER": {
|
||||
"ADD": "Manager hinzufügen",
|
||||
|
@@ -892,7 +892,8 @@
|
||||
"de": "Deutsch",
|
||||
"it": "Italiano",
|
||||
"en": "English",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "简体中文"
|
||||
},
|
||||
"SMTP": {
|
||||
"TITLE": "SMTP Settings",
|
||||
@@ -1072,7 +1073,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "简体中文"
|
||||
},
|
||||
"KEYS": {
|
||||
"emailVerificationDoneText": "Email verification done",
|
||||
@@ -1520,9 +1522,9 @@
|
||||
"DEACTIVATE": "Deactivate",
|
||||
"ACTIVATE": "Activate",
|
||||
"DELETE": "Delete",
|
||||
"DELETE_TITLE": "Delete Idp",
|
||||
"DELETE_TITLE": "Delete IDP",
|
||||
"DELETE_DESCRIPTION": "You are about to delete an identity provider. The resulting changes are irrevocable. Do you really want to do this?",
|
||||
"DELETE_SELECTION_TITLE": "Delete Idp",
|
||||
"DELETE_SELECTION_TITLE": "Delete IDP",
|
||||
"DELETE_SELECTION_DESCRIPTION": "You are about to delete an identity provider. The resulting changes are irrevocable. Do you really want to do this?",
|
||||
"EMPTY": "No IDP available",
|
||||
"OIDC": {
|
||||
@@ -1817,7 +1819,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "简体中文"
|
||||
},
|
||||
"MEMBER": {
|
||||
"ADD": "Add a Manager",
|
||||
|
@@ -892,7 +892,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "简体中文"
|
||||
},
|
||||
"SMTP": {
|
||||
"TITLE": "Paramètres SMTP",
|
||||
@@ -1072,7 +1073,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "简体中文"
|
||||
},
|
||||
"KEYS": {
|
||||
"emailVerificationDoneText": "Vérification de l'email effectuée",
|
||||
@@ -1817,7 +1819,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "简体中文"
|
||||
},
|
||||
"MEMBER": {
|
||||
"ADD": "Ajouter un manager",
|
||||
|
@@ -892,7 +892,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "简体中文"
|
||||
},
|
||||
"SMTP": {
|
||||
"TITLE": "Impostazioni SMTP",
|
||||
@@ -1072,7 +1073,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "简体中文"
|
||||
},
|
||||
"KEYS": {
|
||||
"emailVerificationDoneText": "Verifica dell'e-mail terminata con successo.",
|
||||
@@ -1817,7 +1819,8 @@
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"it": "Italiano",
|
||||
"fr": "Français"
|
||||
"fr": "Français",
|
||||
"zh": "简体中文"
|
||||
},
|
||||
"MEMBER": {
|
||||
"ADD": "Aggiungi un manager",
|
||||
|
1895
console/src/assets/i18n/zh.json
Normal file
1895
console/src/assets/i18n/zh.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user