diff --git a/src/components/Audios.vue b/src/components/Audios.vue index fb50b5144..1efb20bc5 100644 --- a/src/components/Audios.vue +++ b/src/components/Audios.vue @@ -37,6 +37,7 @@ import '@skjnldsv/vue-plyr/dist/vue-plyr.css' import logger from '../services/logger.js' import { preloadMedia } from '../services/mediaPreloader' +import { plyrTranslations } from '../utils/plyrTranslations' const VuePlyr = () => import(/* webpackChunkName: 'plyr' */'@skjnldsv/vue-plyr') @@ -66,6 +67,7 @@ export default { blankVideo: '/blank.aac', controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'settings'], loadSprite: false, + i18n: plyrTranslations, } }, }, diff --git a/src/components/Videos.vue b/src/components/Videos.vue index 2cf1b261d..52e394e68 100644 --- a/src/components/Videos.vue +++ b/src/components/Videos.vue @@ -48,6 +48,7 @@ import logger from '../services/logger.js' import { findLivePhotoPeerFromName } from '../utils/livePhotoUtils' import { getPreviewIfAny } from '../utils/previewUtils' import { preloadMedia } from '../services/mediaPreloader.js' +import { plyrTranslations } from '../utils/plyrTranslations' const VuePlyr = () => import(/* webpackChunkName: 'plyr' */'@skjnldsv/vue-plyr') @@ -88,6 +89,7 @@ export default { blankVideo, controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', 'fullscreen'], loadSprite: false, + i18n: plyrTranslations, fullscreen: { iosNative: true, }, diff --git a/src/utils/plyrTranslations.ts b/src/utils/plyrTranslations.ts new file mode 100644 index 000000000..d2e0d3429 --- /dev/null +++ b/src/utils/plyrTranslations.ts @@ -0,0 +1,51 @@ +/** + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import { translate as t } from '@nextcloud/l10n' + +/** + * Plyr `i18n` option so the player controls and menus + * (e.g. the settings/speed dropdown) are translated. + * + * Plyr ships English defaults only; passing this map makes it use the + * Nextcloud translations instead. + */ +export const plyrTranslations: Record = { + restart: t('viewer', 'Restart'), + rewind: t('viewer', 'Rewind {seektime}s'), + play: t('viewer', 'Play'), + pause: t('viewer', 'Pause'), + fastForward: t('viewer', 'Forward {seektime}s'), + seek: t('viewer', 'Seek'), + seekLabel: t('viewer', '{currentTime} of {duration}'), + played: t('viewer', 'Played'), + buffered: t('viewer', 'Buffered'), + currentTime: t('viewer', 'Current time'), + duration: t('viewer', 'Duration'), + volume: t('viewer', 'Volume'), + mute: t('viewer', 'Mute'), + unmute: t('viewer', 'Unmute'), + enableCaptions: t('viewer', 'Enable captions'), + disableCaptions: t('viewer', 'Disable captions'), + download: t('viewer', 'Download'), + enterFullscreen: t('viewer', 'Enter fullscreen'), + exitFullscreen: t('viewer', 'Exit fullscreen'), + frameTitle: t('viewer', 'Player for {title}'), + captions: t('viewer', 'Captions'), + settings: t('viewer', 'Settings'), + pip: t('viewer', 'PIP'), + menuBack: t('viewer', 'Go back to previous menu'), + speed: t('viewer', 'Speed'), + normal: t('viewer', 'Normal'), + quality: t('viewer', 'Quality'), + loop: t('viewer', 'Loop'), + start: t('viewer', 'Start'), + end: t('viewer', 'End'), + all: t('viewer', 'All'), + reset: t('viewer', 'Reset'), + disabled: t('viewer', 'Disabled'), + enabled: t('viewer', 'Enabled'), + advertisement: t('viewer', 'Ad'), +}