diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9d01af91..21388c45 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -73,23 +73,35 @@ export class AppComponent implements OnInit, OnDestroy this._translateService.use('en'); /** - * If you are using a language other than the default one, i.e. Turkish in - * this case, you may encounter an issue where some of the components - * are not actually being translated. In that case, switch the default language - * back and forth to overcome this issue. - * This is related to Angular Translate module and it's a temporary fix while - * we are moving the multi language implementation over to the Angular's core - * language service. + * ------------------------------------------------------------------ + * ngxTranslate Fix Start + * ------------------------------------------------------------------ + * If you are using a language other than the default one, i.e. Turkish in this case, + * you may encounter an issue where some of the components are not actually being + * translated when your app first initialized. + * + * This is related to ngxTranslate module and below there is a temporary fix while we + * are moving the multi language implementation over to the Angular's core language + * service. **/ + // Set the default language to 'en' and then back to 'tr'. + // '.use' cannot be used here as ngxTranslate won't switch to a language that's already + // been selected and there is no way to force it, so we overcome the issue by switching + // the default language back and forth. /** - // Set the default language to 'en' and then back to 'tr' to fix the translation issues setTimeout(() => { this._translateService.setDefaultLang('en'); this._translateService.setDefaultLang('tr'); }); */ + /** + * ------------------------------------------------------------------ + * ngxTranslate Fix End + * ------------------------------------------------------------------ + */ + // Add is-mobile class to the body if the platform is mobile if ( this._platform.ANDROID || this._platform.IOS ) {