I am trying to use ng2-translate to show userName in different languages.
My LoginComponent looks like the one below:
import { Component } from '@angular/core';
import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate';
@Component({
selector: 'login-app',
templateUrl: './app/components/html/login.component.html',
pipes: [TranslatePipe]
})
export class LoginComponent {
userName: string;
constructor(private _translate: TranslateService) {
this.initializeTranslateServiceConfig();
}
initializeTranslateServiceConfig() {
var userLang = navigator.language || navigator.userLanguage;
this._translate.use(userLang);
}
}
My template login.component.html has a label which displays the userName
<label for="userName">{{"User Name" | translate}}</label>
I have different .json files to support the translations.
Now I am changing the language settings of Chrome, Firefox and IE11. It works perfectly for Chrome and Firefox but not for IE11. :(
Can anybody please tell me what could be the problem and the possible solution?
Thanks,
Debopam