]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/main.ts
Fix description/comments max width
[github/Chocobozzz/PeerTube.git] / client / src / main.ts
index 19f45a3e309bf46b9c0963841a63487a4ac6d901..f456e89c5d799e6097ae1a78a5b11468bb24a6ed 100644 (file)
@@ -5,14 +5,18 @@ import { AppModule } from './app/app.module'
 import { environment } from './environments/environment'
 
 import { hmrBootstrap } from './hmr'
+import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
+import { buildFileLocale } from '../../shared'
 
 let providers = []
 if (environment.production) {
   enableProdMode()
 }
 
-if (environment.production === false && window.location.search === '?lang=fr') {
-  const translations = require(`raw-loader!./locale/target/angular_fr.xml`)
+// Template translation, should be in the bootstrap step
+if (isOnDevLocale()) {
+  const locale = buildFileLocale(getDevLocale())
+  const translations = require(`raw-loader!./locale/target/angular_${locale}.xml`)
 
   providers = [
     { provide: TRANSLATIONS, useValue: translations },