From 8f0ae1a91799b29253dceb44ef759e6e961ae920 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 24 Sep 2018 18:15:31 +0100 Subject: [PATCH] [ACA-1812] i18n workaround for non-supported langs (#665) --- src/app/app.component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b1f2e17a7..fa097e73e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -29,7 +29,8 @@ import { AuthenticationService, FileUploadErrorEvent, PageTitleService, - UploadService + UploadService, + TranslationService } from '@alfresco/adf-core'; import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; @@ -64,10 +65,16 @@ export class AppComponent implements OnInit { private alfrescoApiService: AlfrescoApiService, private authenticationService: AuthenticationService, private uploadService: UploadService, - private extensions: AppExtensionService + private extensions: AppExtensionService, + private translationService: TranslationService ) {} ngOnInit() { + // workaround for https://github.com/ngx-translate/core/issues/575 + this.translationService.translate.getTranslation('en').subscribe(() => { + this.translationService.translate.setDefaultLang('en'); + }); + this.alfrescoApiService.getInstance().on('error', error => { if (error.status === 401) { if (!this.authenticationService.isLoggedIn()) {