diff options
Diffstat (limited to 'client/src/main.ts')
-rw-r--r-- | client/src/main.ts | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/client/src/main.ts b/client/src/main.ts index e1a69e4a4..85c4c0672 100644 --- a/client/src/main.ts +++ b/client/src/main.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { enableProdMode } from '@angular/core' | 1 | import { enableProdMode, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular/core' |
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' | 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' |
3 | 3 | ||
4 | import { AppModule } from './app/app.module' | 4 | import { AppModule } from './app/app.module' |
@@ -6,12 +6,22 @@ import { environment } from './environments/environment' | |||
6 | 6 | ||
7 | import { hmrBootstrap } from './hmr' | 7 | import { hmrBootstrap } from './hmr' |
8 | 8 | ||
9 | let providers = [] | ||
9 | if (environment.production) { | 10 | if (environment.production) { |
10 | enableProdMode() | 11 | enableProdMode() |
11 | } | 12 | } |
12 | 13 | ||
14 | if (environment.production === false && window.location.search === '?lang=fr') { | ||
15 | const translations = require(`raw-loader!./locale/target/messages_fr.xml`) | ||
16 | |||
17 | providers = [ | ||
18 | { provide: TRANSLATIONS, useValue: translations }, | ||
19 | { provide: TRANSLATIONS_FORMAT, useValue: 'xlf' } | ||
20 | ] | ||
21 | } | ||
22 | |||
13 | const bootstrap = () => platformBrowserDynamic() | 23 | const bootstrap = () => platformBrowserDynamic() |
14 | .bootstrapModule(AppModule) | 24 | .bootstrapModule(AppModule, { providers }) |
15 | .then(bootstrapModule => { | 25 | .then(bootstrapModule => { |
16 | // TODO: Uncomment and remove unregistration when https://github.com/angular/angular/issues/21191 is fixed | 26 | // TODO: Uncomment and remove unregistration when https://github.com/angular/angular/issues/21191 is fixed |
17 | // TODO: Remove when https://github.com/angular/angular-cli/issues/8779 is fixed? | 27 | // TODO: Remove when https://github.com/angular/angular-cli/issues/8779 is fixed? |