diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-06 17:37:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-06 17:37:13 +0200 |
commit | 74b7c6d48e9ca377fe938c8134ed74b612e62ba0 (patch) | |
tree | cb848dec054a71669fef5ea3986bdd0d2c354248 /client/src/main.ts | |
parent | 7ce44a74a3b052190cfacd4bd5ee6b92cfc620ac (diff) | |
download | PeerTube-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.ts | 7 |
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' | |||
5 | import { environment } from './environments/environment' | 5 | import { environment } from './environments/environment' |
6 | 6 | ||
7 | import { hmrBootstrap } from './hmr' | 7 | import { hmrBootstrap } from './hmr' |
8 | import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' | ||
8 | 9 | ||
9 | let providers = [] | 10 | let providers = [] |
10 | if (environment.production) { | 11 | if (environment.production) { |
11 | enableProdMode() | 12 | enableProdMode() |
12 | } | 13 | } |
13 | 14 | ||
14 | if (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`) | 16 | if (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 }, |