diff options
Diffstat (limited to 'client/src/assets/player/peertube-player.ts')
-rw-r--r-- | client/src/assets/player/peertube-player.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/client/src/assets/player/peertube-player.ts b/client/src/assets/player/peertube-player.ts index b604097fa..9e37b75d2 100644 --- a/client/src/assets/player/peertube-player.ts +++ b/client/src/assets/player/peertube-player.ts | |||
@@ -12,7 +12,7 @@ import './peertube-videojs-plugin' | |||
12 | import './peertube-load-progress-bar' | 12 | import './peertube-load-progress-bar' |
13 | import { videojsUntyped } from './peertube-videojs-typings' | 13 | import { videojsUntyped } from './peertube-videojs-typings' |
14 | import { buildVideoEmbed, buildVideoLink, copyToClipboard } from './utils' | 14 | import { buildVideoEmbed, buildVideoLink, copyToClipboard } from './utils' |
15 | import { is18nLocale, isDefaultLocale } from '../../../../shared/models/i18n/i18n' | 15 | import { getCompleteLocale, is18nLocale, isDefaultLocale } from '../../../../shared/models/i18n/i18n' |
16 | 16 | ||
17 | // Change 'Playback Rate' to 'Speed' (smaller for our settings menu) | 17 | // Change 'Playback Rate' to 'Speed' (smaller for our settings menu) |
18 | videojsUntyped.getComponent('PlaybackRateMenuButton').prototype.controlText_ = 'Speed' | 18 | videojsUntyped.getComponent('PlaybackRateMenuButton').prototype.controlText_ = 'Speed' |
@@ -141,11 +141,13 @@ function addContextMenu (player: any, videoEmbedUrl: string) { | |||
141 | } | 141 | } |
142 | 142 | ||
143 | function loadLocale (serverUrl: string, videojs: any, locale: string) { | 143 | function loadLocale (serverUrl: string, videojs: any, locale: string) { |
144 | if (!is18nLocale(locale) || isDefaultLocale(locale)) return undefined | 144 | const completeLocale = getCompleteLocale(locale) |
145 | 145 | ||
146 | return fetch(serverUrl + '/client/locales/' + locale + '/player.json') | 146 | if (!is18nLocale(completeLocale) || isDefaultLocale(completeLocale)) return Promise.resolve(undefined) |
147 | |||
148 | return fetch(serverUrl + '/client/locales/' + completeLocale + '/player.json') | ||
147 | .then(res => res.json()) | 149 | .then(res => res.json()) |
148 | .then(json => videojs.addLanguage(locale, json)) | 150 | .then(json => videojs.addLanguage(completeLocale, json)) |
149 | } | 151 | } |
150 | 152 | ||
151 | export { | 153 | export { |