]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Translate player according to the interface lang
authorChocobozzz <me@florianbigard.com>
Thu, 16 Aug 2018 09:11:20 +0000 (11:11 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 16 Aug 2018 09:11:20 +0000 (11:11 +0200)
client/src/app/videos/+video-watch/video-watch.component.ts
client/src/assets/player/peertube-player.ts
scripts/build/client.sh

index 5fba1b12d4204826aa851ce4abb472a636fd3c2d..0909b13f58ba10f3a5a9c31dfacb6ae62164e358 100644 (file)
@@ -407,7 +407,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
       peertubeLink: false,
       poster: this.video.previewUrl,
       startTime,
-      theaterMode: true
+      theaterMode: true,
+      language: this.localeId
     })
 
     if (this.videojsLocaleLoaded === false) {
index 1b1ec7a68933fde60690961683a03c63d0a1d48e..0b9303a730505ddc08a88da4563c5dbc132bac9e 100644 (file)
@@ -35,6 +35,7 @@ function getVideojsOptions (options: {
   startTime: number | string
   theaterMode: boolean,
   videoCaptions: VideoJSCaption[],
+  language?: string,
   controls?: boolean,
   muted?: boolean,
   loop?: boolean
@@ -74,6 +75,10 @@ function getVideojsOptions (options: {
     })
   }
 
+  if (options.language && !isDefaultLocale(options.language)) {
+    Object.assign(videojsOptions, { language: options.language })
+  }
+
   return videojsOptions
 }
 
index 3d1d0234e79d84ec40f803ca9649f442efa31d83..a0277da01c658f4e2e9f0a1f8771167029e3f4b1 100755 (executable)
@@ -16,6 +16,12 @@ post_build_hook () {
   rmdir "./src/locale/pending_target/"
 }
 
+# Previous build failed
+if [ ! -f client/src/locale/target/angular_fr_FR.xml ]; then
+    git checkout -- client/src/locale/target/
+    rm -r client/src/locale/pending_target/
+fi
+
 cd client
 
 rm -rf ./dist ./compiled