This library was generated with Angular CLI version 13.0.0.
Service to set locale and language. Languange supported: ['it','en']
npm i @geosdi/ngx-language-translate --save
It depends on :
"@angular/common": ">=13.0.0",
"@angular/core": ">=13.0.0",
"@ngx-translate/core": ">=14.0.0",
"@ngx-translate/http-loader": ">=7.0.0",
"typescript": ">=4.4.4"
in AppModule ad providers:
{
provide: LOCALE_ID,
deps: [NgxLanguageTranslate],
useFactory: (languageService: NgxLanguageTranslate) => languageService.locale
}
Method | action |
---|---|
registerLocale(lang: string): void | change language and locale |
locale(): string | return current locale |
lang(): string | return current lang |