diff --git a/package-lock.json b/package-lock.json index b8f306ea2..ecd739a55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "react-i18next": "^12.1.1", "react-is": "18.2.0", "spatial-navigation-polyfill": "git+https://git@github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6", - "stremio-translations": "git+https://git@github.com/Stremio/stremio-translations.git#ef047329f5bcb0a8f96008fca05c68b449b34cb1", + "stremio-translations": "git+https://git@github.com/Stremio/stremio-translations.git#f55fe0d7dfe33bd6be461b4430cba2319afd1d8e", "url": "0.11.0" }, "devDependencies": { @@ -12847,9 +12847,9 @@ } }, "node_modules/stremio-translations": { - "version": "1.43.15", - "resolved": "git+https://git@github.com/Stremio/stremio-translations.git#ef047329f5bcb0a8f96008fca05c68b449b34cb1", - "integrity": "sha512-cG1GZIbCy2xWQpyYXJvlvnkWLtMBypL+BhMFJmC9LRHteAmJU++t37b5Wc6Sm1IbWoXqG508Tc9YfQ28bHTzaQ==", + "version": "1.43.16", + "resolved": "git+https://git@github.com/Stremio/stremio-translations.git#f55fe0d7dfe33bd6be461b4430cba2319afd1d8e", + "integrity": "sha512-yCFQSjZ1R/xjbHiPb7UZnWUFNu5YQq6vsdzSQZ1DGizwGnERxUvRwyzh8a1tlNOEyjZoZyI4cqdbv/LHRGCqbA==", "license": "MIT" }, "node_modules/string_decoder": { @@ -24508,9 +24508,9 @@ "dev": true }, "stremio-translations": { - "version": "git+https://git@github.com/Stremio/stremio-translations.git#ef047329f5bcb0a8f96008fca05c68b449b34cb1", - "integrity": "sha512-cG1GZIbCy2xWQpyYXJvlvnkWLtMBypL+BhMFJmC9LRHteAmJU++t37b5Wc6Sm1IbWoXqG508Tc9YfQ28bHTzaQ==", - "from": "stremio-translations@git+https://git@github.com/Stremio/stremio-translations.git#ef047329f5bcb0a8f96008fca05c68b449b34cb1" + "version": "git+https://git@github.com/Stremio/stremio-translations.git#f55fe0d7dfe33bd6be461b4430cba2319afd1d8e", + "integrity": "sha512-yCFQSjZ1R/xjbHiPb7UZnWUFNu5YQq6vsdzSQZ1DGizwGnERxUvRwyzh8a1tlNOEyjZoZyI4cqdbv/LHRGCqbA==", + "from": "stremio-translations@git+https://git@github.com/Stremio/stremio-translations.git#f55fe0d7dfe33bd6be461b4430cba2319afd1d8e" }, "string_decoder": { "version": "1.1.1", diff --git a/package.json b/package.json index 908ce279a..f592272bb 100755 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "react-i18next": "^12.1.1", "react-is": "18.2.0", "spatial-navigation-polyfill": "git+https://git@github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6", - "stremio-translations": "git+https://git@github.com/Stremio/stremio-translations.git#ef047329f5bcb0a8f96008fca05c68b449b34cb1", + "stremio-translations": "git+https://git@github.com/Stremio/stremio-translations.git#f55fe0d7dfe33bd6be461b4430cba2319afd1d8e", "url": "0.11.0" }, "devDependencies": { 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