aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-05 15:01:45 +0200
committerChocobozzz <me@florianbigard.com>2018-06-05 15:02:27 +0200
commite309822b93d9b69f30cbe830ef3d09dfdb2c13b2 (patch)
tree41dbc3b3108ced7fdba4062974e568695c30e486 /client/src/main.ts
parentd4d5853e65e584ca51c718f8df590b987f981047 (diff)
downloadPeerTube-e309822b93d9b69f30cbe830ef3d09dfdb2c13b2.tar.gz
PeerTube-e309822b93d9b69f30cbe830ef3d09dfdb2c13b2.tar.zst
PeerTube-e309822b93d9b69f30cbe830ef3d09dfdb2c13b2.zip
Add form validator translations
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?