aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-06 17:37:13 +0200
committerChocobozzz <me@florianbigard.com>2018-06-06 17:37:13 +0200
commit74b7c6d48e9ca377fe938c8134ed74b612e62ba0 (patch)
treecb848dec054a71669fef5ea3986bdd0d2c354248 /client/src/main.ts
parent7ce44a74a3b052190cfacd4bd5ee6b92cfc620ac (diff)
downloadPeerTube-74b7c6d48e9ca377fe938c8134ed74b612e62ba0.tar.gz
PeerTube-74b7c6d48e9ca377fe938c8134ed74b612e62ba0.tar.zst
PeerTube-74b7c6d48e9ca377fe938c8134ed74b612e62ba0.zip
Little i18n refractoring
Diffstat (limited to 'client/src/main.ts')
-rw-r--r--client/src/main.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/src/main.ts b/client/src/main.ts
index 19f45a3e3..061be17de 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -5,14 +5,17 @@ import { AppModule } from './app/app.module'
5import { environment } from './environments/environment' 5import { environment } from './environments/environment'
6 6
7import { hmrBootstrap } from './hmr' 7import { hmrBootstrap } from './hmr'
8import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
8 9
9let providers = [] 10let providers = []
10if (environment.production) { 11if (environment.production) {
11 enableProdMode() 12 enableProdMode()
12} 13}
13 14
14if (environment.production === false && window.location.search === '?lang=fr') { 15// Template translation, should be in the bootstrap step
15 const translations = require(`raw-loader!./locale/target/angular_fr.xml`) 16if (isOnDevLocale()) {
17 const locale = getDevLocale()
18 const translations = require(`raw-loader!./locale/target/angular_${locale}.xml`)
16 19
17 providers = [ 20 providers = [
18 { provide: TRANSLATIONS, useValue: translations }, 21 { provide: TRANSLATIONS, useValue: translations },