mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-20 03:48:47 +00:00
feat: internationalization Bulgarian (#5998)
* Feature BG init * lint fix * Fix merge conflict * merge main branch add bg lang * reference centrally defined langs * refactor supportedLanguages --------- Co-authored-by: Livio Spring <[email protected]> Co-authored-by: Elio Bischof <[email protected]> Co-authored-by: Max Peintner <[email protected]> Co-authored-by: Elio Bischof <[email protected]>
This commit is contained in:
co-authored by
Livio Spring
Elio Bischof
Max Peintner
Elio Bischof
parent
7b69449207
commit
4378eb7cb5
@@ -2,6 +2,7 @@ import { DatePipe } from '@angular/common';
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import * as moment from 'moment';
|
||||
import { supportedLanguages } from 'src/app/utils/language';
|
||||
|
||||
@Pipe({
|
||||
name: 'localizedDate',
|
||||
@@ -22,9 +23,7 @@ export class LocalizedDatePipe implements PipeTransform {
|
||||
return moment(value).format(`${format}, HH:mm`);
|
||||
}
|
||||
} else {
|
||||
const lang = ['de', 'en', 'es', 'fr', 'it', 'ja', 'pl', 'zh'].includes(this.translateService.currentLang)
|
||||
? this.translateService.currentLang
|
||||
: 'en';
|
||||
const lang = supportedLanguages.includes(this.translateService.currentLang) ? this.translateService.currentLang : 'en';
|
||||
const datePipe: DatePipe = new DatePipe(lang);
|
||||
return datePipe.transform(value, pattern ?? 'mediumDate');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user