diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-05 15:01:45 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-05 15:02:27 +0200 |
commit | e309822b93d9b69f30cbe830ef3d09dfdb2c13b2 (patch) | |
tree | 41dbc3b3108ced7fdba4062974e568695c30e486 /client/src/main.ts | |
parent | d4d5853e65e584ca51c718f8df590b987f981047 (diff) | |
download | PeerTube-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.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? |