Skip to content

Commit

Permalink
feat: Zitadel translated into Spanish (#5634)
Browse files Browse the repository at this point in the history
* feat: spanish translation in progress

* feat: 85% of translated strings

* feat: spanish translation 95% done

* fix: fix some typos

* fix: add missing translations for recent commits

* Apply suggestions from code review

Co-authored-by: Livio Spring <livio.a@gmail.com>

---------

Co-authored-by: Elio Bischof <elio@zitadel.com>
Co-authored-by: Livio Spring <livio.a@gmail.com>
  • Loading branch information
3 people committed Apr 14, 2023
1 parent 8745c87 commit d140f93
Show file tree
Hide file tree
Showing 30 changed files with 3,894 additions and 35 deletions.
6 changes: 3 additions & 3 deletions console/src/app/app.component.ts
Expand Up @@ -267,15 +267,15 @@ export class AppComponent implements OnDestroy {
}

private setLanguage(): void {
this.translate.addLangs(['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh']);
this.translate.addLangs(['de', 'en', 'es', '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(/de|en|fr|it|ja|pl|zh/) ? cropped : 'en';
const fallbackLang = cropped.match(/de|en|es|fr|it|ja|pl|zh/) ? cropped : 'en';

const lang = userprofile?.human?.profile?.preferredLanguage.match(/de|en|fr|it|ja|pl|zh/)
const lang = userprofile?.human?.profile?.preferredLanguage.match(/de|en|es|fr|it|ja|pl|zh/)
? userprofile.human.profile?.preferredLanguage
: fallbackLang;
this.translate.use(lang);
Expand Down
3 changes: 3 additions & 0 deletions console/src/app/app.module.ts
Expand Up @@ -2,6 +2,7 @@ import { CommonModule, registerLocaleData } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';
import localeDe from '@angular/common/locales/de';
import localeEn from '@angular/common/locales/en';
import localeEs from '@angular/common/locales/es';
import localeFr from '@angular/common/locales/fr';
import localeIt from '@angular/common/locales/it';
import localeJa from '@angular/common/locales/ja';
Expand Down Expand Up @@ -64,6 +65,8 @@ registerLocaleData(localeDe);
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/de.json'));
registerLocaleData(localeEn);
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/en.json'));
registerLocaleData(localeEs);
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/es.json'));
registerLocaleData(localeFr);
i18nIsoCountries.registerLocale(require('i18n-iso-countries/langs/fr.json'));
registerLocaleData(localeIt);
Expand Down
Expand Up @@ -109,7 +109,7 @@ export class LoginTextsComponent implements OnInit, OnDestroy {
@Input() public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT;

public KeyNamesArray: string[] = KeyNamesArray;
public LOCALES: string[] = ['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh'];
public LOCALES: string[] = ['de', 'en', 'es', 'fr', 'it', 'ja', 'pl', 'zh'];

private sub: Subscription = new Subscription();

Expand Down
Expand Up @@ -441,7 +441,7 @@ export class MessageTextsComponent implements OnInit, OnDestroy {
};

public locale: string = 'en';
public LOCALES: string[] = ['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh'];
public LOCALES: string[] = ['de', 'en', 'es', 'fr', 'it', 'ja', 'pl', 'zh'];
private sub: Subscription = new Subscription();
public canWrite$: Observable<boolean> = this.authService.isAllowed([
this.serviceType === PolicyComponentServiceType.ADMIN
Expand Down
2 changes: 1 addition & 1 deletion console/src/app/pages/org-create/org-create.component.ts
Expand Up @@ -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', 'fr', 'it', 'ja', 'pl', 'zh'];
public languages: string[] = ['de', 'en', 'es', 'fr', 'it', 'ja', 'pl', 'zh'];

public policy?: PasswordComplexityPolicy.AsObject;
public usePassword: boolean = false;
Expand Down
Expand Up @@ -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', 'fr', 'it', 'ja', 'pl', 'zh'];
public languages: string[] = ['de', 'en', 'es', 'fr', 'it', 'ja', 'pl', 'zh'];
public selected: CountryPhoneCode | undefined;
public countryPhoneCodes: CountryPhoneCode[] = [];
public userForm!: UntypedFormGroup;
Expand Down
Expand Up @@ -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', 'ja', 'pl', 'zh'];
public languages: string[] = ['de', 'en', 'es', 'fr', 'it', 'ja', 'pl', 'zh'];

private subscription: Subscription = new Subscription();

Expand Down
Expand Up @@ -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', 'ja', 'pl', 'zh'];
public languages: string[] = ['de', 'en', 'es', 'it', 'fr', 'ja', 'pl', 'zh'];

public ChangeType: any = ChangeType;

Expand Down
Expand Up @@ -22,7 +22,7 @@ export class LocalizedDatePipe implements PipeTransform {
return moment(value).format(`${format}, HH:mm`);
}
} else {
const lang = ['de', 'en', 'fr', 'it', 'ja', 'pl', 'zh'].includes(this.translateService.currentLang)
const lang = ['de', 'en', 'es', 'fr', 'it', 'ja', 'pl', 'zh'].includes(this.translateService.currentLang)
? this.translateService.currentLang
: 'en';
const datePipe: DatePipe = new DatePipe(lang);
Expand Down
3 changes: 3 additions & 0 deletions console/src/assets/i18n/de.json
Expand Up @@ -1019,6 +1019,7 @@
"LANGUAGE": {
"de": "Deutsch",
"en": "English",
"es": "Español",
"fr": "Français",
"it": "Italiano",
"ja": "日本語",
Expand Down Expand Up @@ -1217,6 +1218,7 @@
"LOCALES": {
"de": "Deutsch",
"en": "English",
"es": "Español",
"fr": "Français",
"it": "Italiano",
"ja": "日本語",
Expand Down Expand Up @@ -2078,6 +2080,7 @@
"LANGUAGES": {
"de": "Deutsch",
"en": "English",
"es": "Español",
"fr": "Français",
"it": "Italiano",
"ja": "日本語",
Expand Down
9 changes: 8 additions & 1 deletion console/src/assets/i18n/en.json
Expand Up @@ -1020,6 +1020,7 @@
"LANGUAGE": {
"de": "Deutsch",
"en": "English",
"es": "Español",
"fr": "Français",
"it": "Italiano",
"ja": "日本語",
Expand Down Expand Up @@ -1149,6 +1150,10 @@
"MAXSIZEEXCEEDED": "Maximum size of 524kB exceeded.",
"NOSVGSUPPORTED": "SVG are not supported!",
"FONTINLOGINONLY": "The font is currently only displayed in the login interface.",
"BACKGROUNDCOLOR": "Background color",
"PRIMARYCOLOR": "Primary color",
"WARNCOLOR": "Warning color",
"FONTCOLOR": "Font color",
"VIEWS": {
"PREVIEW": "Preview",
"CURRENT": "Current Configuration"
Expand Down Expand Up @@ -1209,11 +1214,12 @@
"RESET_TITLE": "Restore Default Values",
"RESET_DESCRIPTION": "You are about to restore all default values. All changes you have made will be permanently deleted. Do you really want to continue?",
"UNSAVED_TITLE": "Continue without saving?",
"UNSAVED_DESCRIPTION": "Your have made changes without saving. Do you want to save now?",
"UNSAVED_DESCRIPTION": "You have made changes without saving. Do you want to save now?",
"LOCALE": "Locale Code",
"LOCALES": {
"de": "Deutsch",
"en": "English",
"es": "Español",
"fr": "Français",
"it": "Italiano",
"ja": "日本語",
Expand Down Expand Up @@ -2071,6 +2077,7 @@
"LANGUAGES": {
"de": "Deutsch",
"en": "English",
"es": "Español",
"fr": "Français",
"it": "Italiano",
"ja": "日本語",
Expand Down

1 comment on commit d140f93

@vercel
Copy link

@vercel vercel bot commented on d140f93 Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./

docs-git-main-zitadel.vercel.app
zitadel-docs.vercel.app
docs-zitadel.vercel.app

Please sign in to comment.