diff --git a/src/routes/Player/OptionsMenu/OptionsMenu.js b/src/routes/Player/OptionsMenu/OptionsMenu.js index 6e3736691..a367cb997 100644 --- a/src/routes/Player/OptionsMenu/OptionsMenu.js +++ b/src/routes/Player/OptionsMenu/OptionsMenu.js @@ -3,12 +3,14 @@ const React = require('react'); const PropTypes = require('prop-types'); const classnames = require('classnames'); +const { useTranslation } = require('react-i18next'); const { useToast } = require('stremio/common'); const { useServices } = require('stremio/services'); const Option = require('./Option'); const styles = require('./styles'); const OptionsMenu = ({ className, stream, playbackDevices }) => { + const { t } = useTranslation(); const { core } = useServices(); const toast = useToast(); const [streamingUrl, downloadUrl] = React.useMemo(() => { @@ -29,7 +31,7 @@ const OptionsMenu = ({ className, stream, playbackDevices }) => { toast.show({ type: 'success', title: 'Copied', - message: 'Stream link was copied to your clipboard', + message: t('PLAYER_COPY_STREAM_SUCCESS'), timeout: 3000 }); }) @@ -37,8 +39,8 @@ const OptionsMenu = ({ className, stream, playbackDevices }) => { console.error(e); toast.show({ type: 'error', - title: 'Error', - message: `Failed to copy stream link: ${streamingUrl || downloadUrl}`, + title: t('Error'), + message: `${t('PLAYER_COPY_STREAM_ERROR')}: ${streamingUrl || downloadUrl}`, timeout: 3000 }); }); @@ -72,7 +74,7 @@ const OptionsMenu = ({ className, stream, playbackDevices }) => { streamingUrl || downloadUrl ? @@ -83,7 +85,7 @@ const OptionsMenu = ({ className, stream, playbackDevices }) => { streamingUrl || downloadUrl ? @@ -95,7 +97,7 @@ const OptionsMenu = ({ className, stream, playbackDevices }) => { { + const { t } = useTranslation(); const { chromecast, shell, core } = useServices(); const [forceTranscoding, maxAudioChannels] = React.useMemo(() => { return [ @@ -124,7 +126,7 @@ const Player = ({ urlParams, queryParams }) => { } else { toast.show({ type: 'error', - title: 'Error', + title: t('ERROR'), message: error.message, timeout: 3000 }); @@ -133,16 +135,16 @@ const Player = ({ urlParams, queryParams }) => { const onSubtitlesTrackLoaded = React.useCallback(() => { toast.show({ type: 'success', - title: 'Subtitles loaded', - message: 'Embedded subtitles loaded', + title: t('PLAYER_SUBTITLES_LOADED'), + message: t('PLAYER_SUBTITLES_LOADED_EMBEDDED'), timeout: 3000 }); }, []); const onExtraSubtitlesTrackLoaded = React.useCallback((track) => { toast.show({ type: 'success', - title: 'Subtitles loaded', - message: track.exclusive ? 'Exclusice subtitles loaded' : `Subtitles from ${track.origin} loaded`, + title: t('PLAYER_SUBTITLES_LOADED'), + message: track.exclusive ? t('PLAYER_SUBTITLES_LOADED_EXCLUSIVE') : t('PLAYER_SUBTITLES_LOADED_ORIGIN', { origin: track.origin }), timeout: 3000 }); }, []); @@ -597,9 +599,9 @@ const Player = ({ urlParams, queryParams }) => { {error.message} { player.selected !== null ? - + - Open in external player + {t('PLAYER_OPEN_IN_EXTERNAL')} : null