mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-11 00:25:12 +00:00
feat: internationalization Japanese (recreated) (#5513)
japanese translation --------- Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
@@ -267,15 +267,15 @@ export class AppComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
private setLanguage(): void {
|
||||
this.translate.addLangs(['en', 'de', 'fr', 'it', 'pl', 'zh']);
|
||||
this.translate.addLangs(['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh']);
|
||||
this.translate.setDefaultLang('en');
|
||||
|
||||
this.authService.user.subscribe((userprofile) => {
|
||||
if (userprofile) {
|
||||
const cropped = navigator.language.split('-')[0] ?? 'en';
|
||||
const fallbackLang = cropped.match(/en|de|fr|it|pl|zh/) ? cropped : 'en';
|
||||
const fallbackLang = cropped.match(/de|en|fr|it|ja|pl|zh/) ? cropped : 'en';
|
||||
|
||||
const lang = userprofile?.human?.profile?.preferredLanguage.match(/en|de|fr|it|pl|zh/)
|
||||
const lang = userprofile?.human?.profile?.preferredLanguage.match(/de|en|fr|it|ja|pl|zh/)
|
||||
? userprofile.human.profile?.preferredLanguage
|
||||
: fallbackLang;
|
||||
this.translate.use(lang);
|
||||
|
||||
@@ -4,6 +4,7 @@ import localeDe from '@angular/common/locales/de';
|
||||
import localeEn from '@angular/common/locales/en';
|
||||
import localeFr from '@angular/common/locales/fr';
|
||||
import localeIt from '@angular/common/locales/it';
|
||||
import localeJa from '@angular/common/locales/ja';
|
||||
import localePl from '@angular/common/locales/pl';
|
||||
import localeZh from '@angular/common/locales/zh';
|
||||
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
||||
@@ -61,16 +62,18 @@ import { ToastService } from './services/toast.service';
|
||||
|
||||
registerLocaleData(localeDe);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/de.json'));
|
||||
registerLocaleData(localeZh);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/zh.json'));
|
||||
registerLocaleData(localeEn);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/en.json'));
|
||||
registerLocaleData(localeFr);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/fr.json'));
|
||||
registerLocaleData(localeIt);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/it.json'));
|
||||
registerLocaleData(localeJa);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/ja.json'));
|
||||
registerLocaleData(localePl);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/pl.json'));
|
||||
registerLocaleData(localeEn);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/en.json'));
|
||||
registerLocaleData(localeZh);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/zh.json'));
|
||||
|
||||
export class WebpackTranslateLoader implements TranslateLoader {
|
||||
getTranslation(lang: string): Observable<any> {
|
||||
|
||||
@@ -109,7 +109,7 @@ export class LoginTextsComponent implements OnInit, OnDestroy {
|
||||
@Input() public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT;
|
||||
|
||||
public KeyNamesArray: string[] = KeyNamesArray;
|
||||
public LOCALES: string[] = ['en', 'de', 'it', 'fr', 'pl', 'zh'];
|
||||
public LOCALES: string[] = ['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh'];
|
||||
|
||||
private sub: Subscription = new Subscription();
|
||||
|
||||
|
||||
@@ -441,7 +441,7 @@ export class MessageTextsComponent implements OnInit, OnDestroy {
|
||||
};
|
||||
|
||||
public locale: string = 'en';
|
||||
public LOCALES: string[] = ['en', 'de', 'it', 'fr', 'pl', 'zh'];
|
||||
public LOCALES: string[] = ['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh'];
|
||||
private sub: Subscription = new Subscription();
|
||||
public canWrite$: Observable<boolean> = this.authService.isAllowed([
|
||||
this.serviceType === PolicyComponentServiceType.ADMIN
|
||||
|
||||
@@ -45,7 +45,7 @@ export class OrgCreateComponent {
|
||||
public pwdForm?: UntypedFormGroup;
|
||||
|
||||
public genders: Gender[] = [Gender.GENDER_FEMALE, Gender.GENDER_MALE, Gender.GENDER_UNSPECIFIED];
|
||||
public languages: string[] = ['de', 'en', 'it', 'fr', 'pl', 'zh'];
|
||||
public languages: string[] = ['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh'];
|
||||
|
||||
public policy?: PasswordComplexityPolicy.AsObject;
|
||||
public usePassword: boolean = false;
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
export class UserCreateComponent implements OnInit, OnDestroy {
|
||||
public user: AddHumanUserRequest.AsObject = new AddHumanUserRequest().toObject();
|
||||
public genders: Gender[] = [Gender.GENDER_FEMALE, Gender.GENDER_MALE, Gender.GENDER_UNSPECIFIED];
|
||||
public languages: string[] = ['de', 'en', 'it', 'fr', 'pl', 'zh'];
|
||||
public languages: string[] = ['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh'];
|
||||
public selected: CountryPhoneCode | undefined;
|
||||
public countryPhoneCodes: CountryPhoneCode[] = [];
|
||||
public userForm!: UntypedFormGroup;
|
||||
|
||||
+1
-1
@@ -33,7 +33,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', 'fr', 'it', 'pl', 'zh'];
|
||||
public languages: string[] = ['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh'];
|
||||
|
||||
private subscription: Subscription = new Subscription();
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export class UserDetailComponent implements OnInit {
|
||||
public user!: User.AsObject;
|
||||
public metadata: Metadata.AsObject[] = [];
|
||||
public genders: Gender[] = [Gender.GENDER_MALE, Gender.GENDER_FEMALE, Gender.GENDER_DIVERSE];
|
||||
public languages: string[] = ['de', 'en', 'it', 'fr', 'pl', 'zh'];
|
||||
public languages: string[] = ['de', 'en', 'it', 'fr', 'ja', 'pl', 'zh'];
|
||||
|
||||
public ChangeType: any = ChangeType;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export class LocalizedDatePipe implements PipeTransform {
|
||||
return moment(value).format(`${format}, HH:mm`);
|
||||
}
|
||||
} else {
|
||||
const lang = ['de', 'en', 'fr', 'it', 'pl', 'zh'].includes(this.translateService.currentLang)
|
||||
const lang = ['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh'].includes(this.translateService.currentLang)
|
||||
? this.translateService.currentLang
|
||||
: 'en';
|
||||
const datePipe: DatePipe = new DatePipe(lang);
|
||||
|
||||
Reference in New Issue
Block a user