diff --git a/src/common/LibItem/LibItem.js b/src/common/LibItem/LibItem.js index 49c225c51..f8f0a5de6 100644 --- a/src/common/LibItem/LibItem.js +++ b/src/common/LibItem/LibItem.js @@ -4,29 +4,35 @@ const React = require('react'); const { useServices } = require('stremio/services'); const PropTypes = require('prop-types'); const MetaItem = require('stremio/common/MetaItem'); +const { t } = require('i18next'); const OPTIONS = [ - { label: 'Play', value: 'play' }, - { label: 'Details', value: 'details' }, - { label: 'Dismiss', value: 'dismiss' }, - { label: 'Remove', value: 'remove' }, + { label: 'LIBRARY_PLAY', value: 'play' }, + { label: 'LIBRARY_DETAILS', value: 'details' }, + { label: 'LIBRARY_RESUME_DISMISS', value: 'dismiss' }, + { label: 'LIBRARY_REMOVE', value: 'remove' }, ]; const LibItem = ({ _id, removable, ...props }) => { const { core } = useServices(); const options = React.useMemo(() => { - return OPTIONS.filter(({ value }) => { - switch (value) { - case 'play': - return props.deepLinks && typeof props.deepLinks.player === 'string'; - case 'details': - return props.deepLinks && (typeof props.deepLinks.metaDetailsVideos === 'string' || typeof props.deepLinks.metaDetailsStreams === 'string'); - case 'dismiss': - return typeof _id === 'string' && props.progress !== null && !isNaN(props.progress); - case 'remove': - return typeof _id === 'string' && removable; - } - }); + return OPTIONS + .filter(({ value }) => { + switch (value) { + case 'play': + return props.deepLinks && typeof props.deepLinks.player === 'string'; + case 'details': + return props.deepLinks && (typeof props.deepLinks.metaDetailsVideos === 'string' || typeof props.deepLinks.metaDetailsStreams === 'string'); + case 'dismiss': + return typeof _id === 'string' && props.progress !== null && !isNaN(props.progress); + case 'remove': + return typeof _id === 'string' && removable; + } + }) + .map((option) => ({ + ...option, + label: t(option.label) + })); }, [_id, removable, props.progress, props.deepLinks]); const optionOnSelect = React.useCallback((event) => { if (typeof props.optionOnSelect === 'function') { diff --git a/src/common/NavBar/HorizontalNavBar/HorizontalNavBar.js b/src/common/NavBar/HorizontalNavBar/HorizontalNavBar.js index 2d27f36fe..006983a9e 100644 --- a/src/common/NavBar/HorizontalNavBar/HorizontalNavBar.js +++ b/src/common/NavBar/HorizontalNavBar/HorizontalNavBar.js @@ -10,6 +10,7 @@ const useFullscreen = require('stremio/common/useFullscreen'); const SearchBar = require('./SearchBar'); const NavMenu = require('./NavMenu'); const styles = require('./styles'); +const { t } = require('i18next'); const HorizontalNavBar = React.memo(({ className, route, query, title, backButton, searchBar, addonsButton, fullscreenButton, navMenu, ...props }) => { const backButtonOnClick = React.useCallback(() => { @@ -54,7 +55,7 @@ const HorizontalNavBar = React.memo(({ className, route, query, title, backButto
{ addonsButton ? - : @@ -62,7 +63,7 @@ const HorizontalNavBar = React.memo(({ className, route, query, title, backButto } { fullscreenButton ? - : diff --git a/src/common/NavBar/HorizontalNavBar/NavMenu/NavMenuContent.js b/src/common/NavBar/HorizontalNavBar/NavMenu/NavMenuContent.js index 240a9ce89..a6c095224 100644 --- a/src/common/NavBar/HorizontalNavBar/NavMenu/NavMenuContent.js +++ b/src/common/NavBar/HorizontalNavBar/NavMenu/NavMenuContent.js @@ -48,7 +48,7 @@ const NavMenuContent = ({ onClick }) => { }} />
-
{profile.auth === null ? 'Anonymous user' : profile.auth.user.email}
+
{profile.auth === null ? t('ANONYMOUS_USER') : profile.auth.user.email}
{selectInputs.map((selectInput, index) => ( { addAddonModalOpen ? -
You can add an addon via an external link, which will appear under Installed addons.
+
{ t('ADD_ADDON_DESCRIPTION') }
diff --git a/src/routes/Addons/useSelectableInputs.js b/src/routes/Addons/useSelectableInputs.js index c823957b3..9eccc1807 100644 --- a/src/routes/Addons/useSelectableInputs.js +++ b/src/routes/Addons/useSelectableInputs.js @@ -1,10 +1,11 @@ // Copyright (C) 2017-2022 Smart code 203358507 +const { t } = require('i18next'); const React = require('react'); const mapSelectableInputs = (installedAddons, remoteAddons) => { const catalogSelect = { - title: 'Select catalog', + title: t('SELECT_CATALOG'), options: remoteAddons.selectable.catalogs .concat(installedAddons.selectable.catalogs) .map(({ name, deepLinks }) => ({ @@ -29,11 +30,11 @@ const mapSelectableInputs = (installedAddons, remoteAddons) => { } }; const typeSelect = { - title: 'Select type', + title: t('SELECT_TYPE'), options: installedAddons.selected !== null ? installedAddons.selectable.types.map(({ type, deepLinks }) => ({ value: deepLinks.addons, - label: type !== null ? type : 'All' + label: type !== null ? type : t('TYPE_ALL') })) : remoteAddons.selectable.types.map(({ type, deepLinks }) => ({ @@ -51,7 +52,7 @@ const mapSelectableInputs = (installedAddons, remoteAddons) => { renderLabelText: () => { return installedAddons.selected !== null ? installedAddons.selected.request.type === null ? - 'All' + t('TYPE_ALL') : installedAddons.selected.request.type : diff --git a/src/routes/Discover/useSelectableInputs.js b/src/routes/Discover/useSelectableInputs.js index aca15315c..5e466520c 100644 --- a/src/routes/Discover/useSelectableInputs.js +++ b/src/routes/Discover/useSelectableInputs.js @@ -14,7 +14,7 @@ const translateOption = (t, option, translateKeyPrefix = '') => { const mapSelectableInputs = (discover, t) => { const typeSelect = { - title: 'Select type', + title: t('SELECT_TYPE'), options: discover.selectable.types .map(({ type, deepLinks }) => ({ value: deepLinks.discover, @@ -32,7 +32,7 @@ const mapSelectableInputs = (discover, t) => { } }; const catalogSelect = { - title: 'Select catalog', + title: t('SELECT_CATALOG'), options: discover.selectable.catalogs .map(({ name, addon, deepLinks }) => ({ value: deepLinks.discover, diff --git a/src/routes/Library/useSelectableInputs.js b/src/routes/Library/useSelectableInputs.js index 8e2fa74ad..a566e3c40 100644 --- a/src/routes/Library/useSelectableInputs.js +++ b/src/routes/Library/useSelectableInputs.js @@ -14,11 +14,11 @@ const translateOption = (t, option, translateKeyPrefix = '') => { const mapSelectableInputs = (library, t) => { const typeSelect = { - title: 'Select type', + title: t('SELECT_TYPE'), options: library.selectable.types .map(({ type, deepLinks }) => ({ value: deepLinks.library, - label: type === null ? 'All' : translateOption(t, type, 'TYPE_') + label: type === null ? t('TYPE_ALL') : translateOption(t, type, 'TYPE_') })), selected: library.selectable.types .filter(({ selected }) => selected) @@ -28,7 +28,7 @@ const mapSelectableInputs = (library, t) => { } }; const sortSelect = { - title: 'Select sort', + title: t('SELECT_SORT'), options: library.selectable.sorts .map(({ sort, deepLinks }) => ({ value: deepLinks.library, diff --git a/src/routes/MetaDetails/StreamsList/StreamsList.js b/src/routes/MetaDetails/StreamsList/StreamsList.js index 5b8750d26..214c7e567 100644 --- a/src/routes/MetaDetails/StreamsList/StreamsList.js +++ b/src/routes/MetaDetails/StreamsList/StreamsList.js @@ -57,8 +57,8 @@ const StreamsList = ({ className, ...props }) => { options: [ { value: ALL_ADDONS_KEY, - label: 'All', - title: 'All' + label: t('ALL_ADDONS'), + title: t('ALL_ADDONS') }, ...Object.keys(streamsByAddon).map((transportUrl) => ({ value: transportUrl, diff --git a/src/routes/Player/ControlBar/ControlBar.js b/src/routes/Player/ControlBar/ControlBar.js index 63854a30a..af672369e 100644 --- a/src/routes/Player/ControlBar/ControlBar.js +++ b/src/routes/Player/ControlBar/ControlBar.js @@ -10,6 +10,7 @@ const SeekBar = require('./SeekBar'); const VolumeSlider = require('./VolumeSlider'); const styles = require('./styles'); const { useBinaryState } = require('stremio/common'); +const { t } = require('i18next'); const ControlBar = ({ className, @@ -122,18 +123,18 @@ const ControlBar = ({ onSeekRequested={onSeekRequested} />
- { nextVideo !== null ? - : null } -
-
Subtitles Variants
+
{ t('PLAYER_SUBTITLES_VARIANTS') }
{ subtitlesTracksForLanguage.length > 0 ?
@@ -217,7 +217,7 @@ const SubtitlesMenu = React.memo((props) => { :
- Subtitles are disabled + { t('PLAYER_SUBTITLES_DISABLED') }
} @@ -256,7 +256,7 @@ const SubtitlesMenu = React.memo((props) => { /> {
{ profile.auth !== null ? - : null }
{ profile.auth === null ?
-
: @@ -205,7 +205,7 @@ const Settings = () => { }
-
Interface language
+
{ t('SETTINGS_INTERFACE_LANGUAGE') }
{
@@ -228,7 +228,7 @@ const Settings = () => {
@@ -237,7 +237,7 @@ const Settings = () => {
@@ -504,7 +504,7 @@ const Settings = () => {
-
Toggle Subtitles Menu
+
{ t('SETTINGS_SHORTCUT_MENU_SUBTITLES') }
S @@ -512,7 +512,7 @@ const Settings = () => {
-
Toggle Info Menu
+
{ t('SETTINGS_SHORTCUT_MENU_INFO') }
I @@ -528,7 +528,7 @@ const Settings = () => {
-
Navigate Between Menus
+
{ t('SETTINGS_SHORTCUT_NAVIGATE_MENUS') }
1 @@ -538,7 +538,7 @@ const Settings = () => {
-
Go to Search
+
{ t('SETTINGS_SHORTCUT_GO_TO_SEARCH') }
0