Is there a way to get the current used language in a controller (without $translateProvider)?
Couldn't find anything in the $translate service.
Is there a way to get the current used language in a controller (without $translateProvider)?
Couldn't find anything in the $translate service.
Maybe is not related but could be useful. In angular2+ the way to access to the current language is
...
import { TranslateService } from '@ngx-translate/core';
export class MyComponent implements OnInit {
constructor(private translate: TranslateService) {}
ngOnInit() {
translate.use('it');
const currentLang = this.translate.currentLang;
}
}
` import { TranslateService } from '@ngx-translate/core';
export class MyComponent implements OnInit { constructor(private translate: TranslateService) { translate.setDefaultLang('en'); }`