feat: internationalization Japanese (recreated) (#5513)

japanese translation

---------

Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
tharuta
2023-03-22 07:30:46 +01:00
committed by GitHub
co-authored by Max Peintner
parent 9b41758af0
commit a8fe15829e
27 changed files with 3822 additions and 74 deletions
+3 -3
View File
@@ -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);