aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/main.ts')
-rw-r--r--client/src/main.ts14
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 @@
1import { enableProdMode } from '@angular/core' 1import { enableProdMode, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular/core'
2import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' 2import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
3 3
4import { AppModule } from './app/app.module' 4import { AppModule } from './app/app.module'
@@ -6,12 +6,22 @@ import { environment } from './environments/environment'
6 6
7import { hmrBootstrap } from './hmr' 7import { hmrBootstrap } from './hmr'
8 8
9let providers = []
9if (environment.production) { 10if (environment.production) {
10 enableProdMode() 11 enableProdMode()
11} 12}
12 13
14if (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
13const bootstrap = () => platformBrowserDynamic() 23const 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?