diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-16 11:11:20 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-16 11:11:20 +0200 |
commit | 95d5113575ffe7872861352fec0adc35bbd8754d (patch) | |
tree | 581ad51f75928d359c3a4faf53d05227747fd4d5 | |
parent | 3dfa84940273619ae00f11a5f419a5e4876b2f53 (diff) | |
download | PeerTube-95d5113575ffe7872861352fec0adc35bbd8754d.tar.gz PeerTube-95d5113575ffe7872861352fec0adc35bbd8754d.tar.zst PeerTube-95d5113575ffe7872861352fec0adc35bbd8754d.zip |
Translate player according to the interface lang
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 3 | ||||
-rw-r--r-- | client/src/assets/player/peertube-player.ts | 5 | ||||
-rwxr-xr-x | scripts/build/client.sh | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 5fba1b12d..0909b13f5 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -407,7 +407,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
407 | peertubeLink: false, | 407 | peertubeLink: false, |
408 | poster: this.video.previewUrl, | 408 | poster: this.video.previewUrl, |
409 | startTime, | 409 | startTime, |
410 | theaterMode: true | 410 | theaterMode: true, |
411 | language: this.localeId | ||
411 | }) | 412 | }) |
412 | 413 | ||
413 | if (this.videojsLocaleLoaded === false) { | 414 | if (this.videojsLocaleLoaded === false) { |
diff --git a/client/src/assets/player/peertube-player.ts b/client/src/assets/player/peertube-player.ts index 1b1ec7a68..0b9303a73 100644 --- a/client/src/assets/player/peertube-player.ts +++ b/client/src/assets/player/peertube-player.ts | |||
@@ -35,6 +35,7 @@ function getVideojsOptions (options: { | |||
35 | startTime: number | string | 35 | startTime: number | string |
36 | theaterMode: boolean, | 36 | theaterMode: boolean, |
37 | videoCaptions: VideoJSCaption[], | 37 | videoCaptions: VideoJSCaption[], |
38 | language?: string, | ||
38 | controls?: boolean, | 39 | controls?: boolean, |
39 | muted?: boolean, | 40 | muted?: boolean, |
40 | loop?: boolean | 41 | loop?: boolean |
@@ -74,6 +75,10 @@ function getVideojsOptions (options: { | |||
74 | }) | 75 | }) |
75 | } | 76 | } |
76 | 77 | ||
78 | if (options.language && !isDefaultLocale(options.language)) { | ||
79 | Object.assign(videojsOptions, { language: options.language }) | ||
80 | } | ||
81 | |||
77 | return videojsOptions | 82 | return videojsOptions |
78 | } | 83 | } |
79 | 84 | ||
diff --git a/scripts/build/client.sh b/scripts/build/client.sh index 3d1d0234e..a0277da01 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh | |||
@@ -16,6 +16,12 @@ post_build_hook () { | |||
16 | rmdir "./src/locale/pending_target/" | 16 | rmdir "./src/locale/pending_target/" |
17 | } | 17 | } |
18 | 18 | ||
19 | # Previous build failed | ||
20 | if [ ! -f client/src/locale/target/angular_fr_FR.xml ]; then | ||
21 | git checkout -- client/src/locale/target/ | ||
22 | rm -r client/src/locale/pending_target/ | ||
23 | fi | ||
24 | |||
19 | cd client | 25 | cd client |
20 | 26 | ||
21 | rm -rf ./dist ./compiled | 27 | rm -rf ./dist ./compiled |