Update app.component.ts

This commit is contained in:
dtalens 2022-10-25 12:43:26 +02:00 committed by GitHub
commit cf4d28a87b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@ export class AppComponent implements OnInit {
private readonly identity: IdentityService, private readonly identity: IdentityService,
@Inject(DOCUMENT) private document: Document) { @Inject(DOCUMENT) private document: Document) {
this.translate.addLangs(["da", "de", "en", "es", "fr", "it", "hu", "nl", "no", "pl", "pt", "sk", "sv", "bg", "ru", "cs", "zh"]); this.translate.addLangs(["ca", "da", "de", "en", "es", "fr", "it", "hu", "nl", "no", "pl", "pt", "sk", "sv", "bg", "ru", "cs", "zh"]);
if (this.authService.loggedIn()) { if (this.authService.loggedIn()) {
this.identity.getAccessToken().subscribe(x => this.accessToken = x); this.identity.getAccessToken().subscribe(x => this.accessToken = x);
@ -81,7 +81,7 @@ export class AppComponent implements OnInit {
// See if we can match the supported langs with the current browser lang // See if we can match the supported langs with the current browser lang
const browserLang: string = translate.getBrowserLang(); const browserLang: string = translate.getBrowserLang();
this.translate.use(browserLang.match(/da|de|en|es|fr|it|hu|nl|no|pl|pt|sk|sv|bg|ru|cs|zh/) ? browserLang : "en"); this.translate.use(browserLang.match(/ca|da|de|en|es|fr|it|hu|nl|no|pl|pt|sk|sv|bg|ru|cs|zh/) ? browserLang : "en");
} }