2020-06-12 19:17:39 +02:00
|
|
|
import { CommonModule, registerLocaleData } from '@angular/common';
|
2020-04-14 11:28:33 +02:00
|
|
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
2020-05-12 19:16:23 +02:00
|
|
|
import localeEn from '@angular/common/locales/en';
|
|
|
|
import localeFr from '@angular/common/locales/fr';
|
2020-04-14 11:28:33 +02:00
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import { FormsModule } from '@angular/forms';
|
2020-04-22 12:56:18 +02:00
|
|
|
import { BrowserModule, Title } from '@angular/platform-browser';
|
2020-04-14 11:28:33 +02:00
|
|
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
2019-10-01 16:39:29 +02:00
|
|
|
import {
|
2020-04-21 10:50:26 +02:00
|
|
|
MissingTranslationHandler,
|
|
|
|
MissingTranslationHandlerParams,
|
|
|
|
TranslateLoader,
|
|
|
|
TranslateModule,
|
|
|
|
TranslateService,
|
2019-10-01 16:39:29 +02:00
|
|
|
} from '@ngx-translate/core';
|
2020-04-14 11:28:33 +02:00
|
|
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
|
|
import { ClipboardModule } from 'ngx-clipboard';
|
|
|
|
import { MarkdownModule } from 'ngx-markdown';
|
2020-04-22 12:56:18 +02:00
|
|
|
import { NgxWebstorageModule } from 'ngx-webstorage';
|
2019-11-22 10:18:09 +01:00
|
|
|
|
2020-04-22 12:56:18 +02:00
|
|
|
import { environment } from '../environments/environment';
|
2020-04-14 11:28:33 +02:00
|
|
|
import { AppRoutingModule } from './app-routing.module';
|
|
|
|
import { AppComponent } from './app.component';
|
2020-04-22 12:56:18 +02:00
|
|
|
import { CoreModule } from './core/core.module';
|
|
|
|
import { SharedModule } from './shared/shared.module';
|
2021-02-04 18:54:30 +01:00
|
|
|
import { CguComponent } from './features/shared/components/ui/static-pages/cgu/cgu.component';
|
|
|
|
import { LegalComponent } from './features/shared/components/ui/static-pages/legal/legal.component';
|
|
|
|
import { PrivacyComponent } from './features/shared/components/ui/static-pages/privacy/privacy.component';
|
2021-02-08 11:32:58 +01:00
|
|
|
import { CipheringComponent } from './features/shared/components/ui/static-pages/ciphering/ciphering.component';
|
2020-05-12 19:16:23 +02:00
|
|
|
registerLocaleData(localeEn, 'en-EN');
|
|
|
|
registerLocaleData(localeFr, 'fr-FR');
|
2019-08-12 14:40:33 +02:00
|
|
|
|
2019-10-01 16:39:29 +02:00
|
|
|
export class MyMissingTranslationHandler implements MissingTranslationHandler {
|
2020-04-22 12:56:18 +02:00
|
|
|
public handle(params: MissingTranslationHandlerParams): string {
|
|
|
|
return `MISSING TRANSLATION FOR [${params.key}]`;
|
2020-04-21 10:50:26 +02:00
|
|
|
}
|
2019-10-01 16:39:29 +02:00
|
|
|
}
|
2019-08-12 14:40:33 +02:00
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
2020-04-21 10:50:26 +02:00
|
|
|
return new TranslateHttpLoader(http);
|
2019-10-01 15:43:37 +02:00
|
|
|
}
|
2019-08-09 13:38:51 +02:00
|
|
|
|
|
|
|
@NgModule({
|
2021-02-08 11:32:58 +01:00
|
|
|
declarations: [AppComponent, CguComponent, LegalComponent, PrivacyComponent, CipheringComponent],
|
2020-04-21 10:50:26 +02:00
|
|
|
imports: [
|
2020-04-22 12:56:18 +02:00
|
|
|
AppRoutingModule,
|
|
|
|
BrowserAnimationsModule,
|
|
|
|
BrowserModule,
|
2020-04-21 10:50:26 +02:00
|
|
|
ClipboardModule,
|
|
|
|
CommonModule,
|
2020-04-22 12:56:18 +02:00
|
|
|
CoreModule,
|
|
|
|
FormsModule,
|
|
|
|
HttpClientModule,
|
2020-04-21 10:50:26 +02:00
|
|
|
MarkdownModule.forRoot(),
|
2020-04-22 12:56:18 +02:00
|
|
|
NgxWebstorageModule.forRoot({ prefix: environment.localStorage.key }),
|
|
|
|
SharedModule,
|
2020-04-21 10:50:26 +02:00
|
|
|
TranslateModule.forRoot({
|
2020-11-05 14:39:01 +01:00
|
|
|
defaultLanguage: 'FR',
|
2020-04-21 10:50:26 +02:00
|
|
|
loader: {
|
|
|
|
provide: TranslateLoader,
|
|
|
|
useFactory: HttpLoaderFactory,
|
|
|
|
deps: [HttpClient],
|
|
|
|
},
|
2020-04-22 12:56:18 +02:00
|
|
|
missingTranslationHandler: {
|
|
|
|
provide: MissingTranslationHandler,
|
|
|
|
useClass: MyMissingTranslationHandler,
|
|
|
|
},
|
2020-11-05 14:39:01 +01:00
|
|
|
useDefaultLang: true,
|
2020-04-21 10:50:26 +02:00
|
|
|
}),
|
|
|
|
],
|
2020-06-12 19:17:39 +02:00
|
|
|
providers: [Title, TranslateService],
|
2020-04-21 10:50:26 +02:00
|
|
|
bootstrap: [AppComponent],
|
2019-08-09 13:38:51 +02:00
|
|
|
})
|
2020-04-14 11:28:33 +02:00
|
|
|
export class AppModule {}
|