mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-15 02:15:14 +00:00
feat: internationalization Polish (#5117)
* Add Polish translations * Add references to Polish translations in files * Make a consistent translation of languages in Chinese translation * Add missing language references to fr, it and zh * Translation corrections * Add missing language references to zh * Translation corrections * add latest translation keys * Translation corrections and addition of some new ones * translate auth requests exhausted * add new untranslated keys * Translation corrections, fix indentation --------- Co-authored-by: Elio Bischof <[email protected]>
This commit is contained in:
@@ -262,15 +262,15 @@ export class AppComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
private setLanguage(): void {
|
||||
this.translate.addLangs(['en', 'de', 'zh']);
|
||||
this.translate.addLangs(['en', 'de', 'fr', 'it', '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|it|zh/) ? cropped : 'en';
|
||||
const fallbackLang = cropped.match(/en|de|fr|it|pl|zh/) ? cropped : 'en';
|
||||
|
||||
const lang = userprofile?.human?.profile?.preferredLanguage.match(/en|de|it|zh/)
|
||||
const lang = userprofile?.human?.profile?.preferredLanguage.match(/en|de|fr|it|pl|zh/)
|
||||
? userprofile.human.profile?.preferredLanguage
|
||||
: fallbackLang;
|
||||
this.translate.use(lang);
|
||||
|
||||
@@ -4,6 +4,7 @@ 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 localePl from '@angular/common/locales/pl';
|
||||
import localeEn from '@angular/common/locales/en';
|
||||
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
||||
import { MatNativeDateModule } from '@angular/material/core';
|
||||
@@ -66,6 +67,8 @@ registerLocaleData(localeFr);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/fr.json'));
|
||||
registerLocaleData(localeIt);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/it.json'));
|
||||
registerLocaleData(localePl);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/pl.json'));
|
||||
registerLocaleData(localeEn);
|
||||
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/en.json'));
|
||||
|
||||
|
||||
@@ -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'];
|
||||
public LOCALES: string[] = ['en', 'de', 'it', 'fr', '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'];
|
||||
public LOCALES: string[] = ['en', 'de', 'it', 'fr', 'pl', 'zh'];
|
||||
private sub: Subscription = new Subscription();
|
||||
public canWrite$: Observable<boolean> = this.authService.isAllowed([
|
||||
this.serviceType === PolicyComponentServiceType.ADMIN
|
||||
|
||||
@@ -59,7 +59,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'];
|
||||
public languages: string[] = ['de', 'en', 'it', 'fr', 'pl', 'zh'];
|
||||
|
||||
public policy?: PasswordComplexityPolicy.AsObject;
|
||||
public usePassword: boolean = false;
|
||||
|
||||
@@ -44,7 +44,7 @@ function passwordConfirmValidator(c: AbstractControl): any {
|
||||
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'];
|
||||
public languages: string[] = ['de', 'en', 'it', 'fr', 'pl', 'zh'];
|
||||
public selected: CountryPhoneCode | undefined;
|
||||
public countryPhoneCodes: CountryPhoneCode[] = [];
|
||||
public userForm!: UntypedFormGroup;
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import { formatPhone } from 'src/app/utils/formatPhone';
|
||||
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', 'zh'];
|
||||
public languages: string[] = ['de', 'en', 'fr', 'it', 'pl', 'zh'];
|
||||
|
||||
private subscription: Subscription = new Subscription();
|
||||
|
||||
|
||||
@@ -42,7 +42,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'];
|
||||
public languages: string[] = ['de', 'en', 'it', 'fr', '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', 'zh'].includes(this.translateService.currentLang)
|
||||
const lang = ['de', 'en', 'fr', 'it', 'pl', 'zh'].includes(this.translateService.currentLang)
|
||||
? this.translateService.currentLang
|
||||
: 'en';
|
||||
const datePipe: DatePipe = new DatePipe(lang);
|
||||
|
||||
Reference in New Issue
Block a user