Aam-Digital/ndb-core

View on GitHub
src/app/core/language/language.module.ts

Summary

Maintainability
A
40 mins
Test Coverage
A
100%
import { NgModule } from "@angular/core";
import { LanguageService } from "./language.service";
import { HTTP_INTERCEPTORS } from "@angular/common/http";
import { AcceptLanguageInterceptor } from "./accept-language.interceptor";

/**
 * Module that aids in the management and choice of translations/languages
 * <br/>
 * Use the {@link LanguageService} to get information about the currently
 * selected language, available languages and methods to change the language
 * <br/>
 * The {@link LanguageSelectComponent} is used to graphically offer a way of changing
 * the current language of the user
 */
@NgModule({
  providers: [
    {
      provide: HTTP_INTERCEPTORS,
      useClass: AcceptLanguageInterceptor,
      multi: true,
    },
  ],
})
export class LanguageModule {
  constructor(translationService: LanguageService) {
    translationService.initDefaultLanguage();
  }
}