ng add @angular/localize
Hello World
import { LocaleService } from '@angular/core';
constructor(private localeService: LocaleService) { }
ngOnInit() {
const browserLang = this.localeService.getLocaleId();
console.log(`Browser language: ${browserLang}`);
}
import { LOCALE_ID } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
constructor(private translateService: TranslateService) { }
ngOnInit() {
const browserLang = this.translateService.getBrowserCultureLang();
console.log(`Browser language: ${browserLang}`);
this.translateService.use(browserLang);
}