mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
👽 add missing translation support
This commit is contained in:
parent
90323c28c7
commit
91101f2326
@ -27,9 +27,21 @@ import {VotingChoiceComponent} from './pages/voting-choice/voting-choice.compone
|
||||
import {PasswordComponent} from './pages/password/password.component';
|
||||
import {HomeComponent} from './pages/home/home.component';
|
||||
import {HttpClient, HttpClientModule} from '@angular/common/http';
|
||||
import {TranslateLoader, TranslateModule, TranslateService} from '@ngx-translate/core';
|
||||
import {
|
||||
MissingTranslationHandler,
|
||||
MissingTranslationHandlerParams,
|
||||
TranslateLoader,
|
||||
TranslateModule,
|
||||
TranslateService
|
||||
} from '@ngx-translate/core';
|
||||
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
|
||||
|
||||
export class MyMissingTranslationHandler implements MissingTranslationHandler {
|
||||
handle(params: MissingTranslationHandlerParams) {
|
||||
return 'some value';
|
||||
}
|
||||
}
|
||||
|
||||
registerLocaleData(localeFr, 'fr');
|
||||
|
||||
export function HttpLoaderFactory(http: HttpClient) {
|
||||
@ -64,6 +76,11 @@ export function HttpLoaderFactory(http: HttpClient) {
|
||||
BrowserModule,
|
||||
AppRoutingModule,
|
||||
TranslateModule.forRoot({
|
||||
missingTranslationHandler: {
|
||||
provide: MissingTranslationHandler,
|
||||
useClass: MyMissingTranslationHandler,
|
||||
},
|
||||
useDefaultLang: false,
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: HttpLoaderFactory,
|
||||
|
Loading…
Reference in New Issue
Block a user