Translate Frontend InteractiveSearch

(cherry picked from commit efca70438899c2f22e2be060011b58325e4f4705)

Closes #9027
pull/9088/head
Stevie Robinson 1 year ago committed by Bogdan
parent 4c2fcef742
commit be20a9d116

@ -1,11 +1,12 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React, { Fragment } from 'react';
import Alert from 'Components/Alert'; import Alert from 'Components/Alert';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
import LoadingIndicator from 'Components/Loading/LoadingIndicator'; import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import Table from 'Components/Table/Table'; import Table from 'Components/Table/Table';
import TableBody from 'Components/Table/TableBody'; import TableBody from 'Components/Table/TableBody';
import { icons, kinds, sortDirections } from 'Helpers/Props'; import { icons, kinds, sortDirections } from 'Helpers/Props';
import getErrorMessage from 'Utilities/Object/getErrorMessage';
import translate from 'Utilities/String/translate'; import translate from 'Utilities/String/translate';
import InteractiveSearchRowConnector from './InteractiveSearchRowConnector'; import InteractiveSearchRowConnector from './InteractiveSearchRowConnector';
import styles from './InteractiveSearchContent.css'; import styles from './InteractiveSearchContent.css';
@ -128,36 +129,46 @@ function InteractiveSearchContent(props) {
onGrabPress onGrabPress
} = props; } = props;
const errorMessage = getErrorMessage(error);
return ( return (
<div> <div>
{ {
isFetching && isFetching ? <LoadingIndicator /> : null
<LoadingIndicator />
} }
{ {
!isFetching && !!error && !isFetching && error ?
<Alert kind={kinds.DANGER} className={styles.alert}> <Alert kind={kinds.DANGER} className={styles.alert}>
{translate('UnableToLoadResultsIntSearch')} {
</Alert> errorMessage ?
<Fragment>
{translate('InteractiveSearchResultsFailedErrorMessage', { message: errorMessage.charAt(0).toLowerCase() + errorMessage.slice(1) })}
</Fragment> :
translate('MovieSearchResultsLoadError')
}
</Alert> :
null
} }
{ {
!isFetching && isPopulated && !totalReleasesCount && !isFetching && isPopulated && !totalReleasesCount ?
<Alert kind={kinds.INFO} className={styles.alert}> <Alert kind={kinds.INFO} className={styles.alert}>
{translate('NoResultsFound')} {translate('NoResultsFound')}
</Alert> </Alert> :
null
} }
{ {
!!totalReleasesCount && isPopulated && !items.length && !!totalReleasesCount && isPopulated && !items.length ?
<Alert kind={kinds.WARNING} className={styles.alert}> <Alert kind={kinds.WARNING} className={styles.alert}>
{translate('AllResultsHiddenFilter')} {translate('AllResultsHiddenFilter')}
</Alert> </Alert> :
null
} }
{ {
isPopulated && !!items.length && isPopulated && !!items.length ?
<Table <Table
columns={columns} columns={columns}
sortKey={sortKey} sortKey={sortKey}
@ -180,14 +191,16 @@ function InteractiveSearchContent(props) {
}) })
} }
</TableBody> </TableBody>
</Table> </Table> :
null
} }
{ {
totalReleasesCount !== items.length && !!items.length && totalReleasesCount !== items.length && !!items.length ?
<Alert kind={kinds.INFO} className={styles.alert}> <Alert kind={kinds.INFO} className={styles.alert}>
{translate('SomeResultsHiddenFilter')} {translate('SomeResultsHiddenFilter')}
</Alert> </Alert> :
null
} }
</div> </div>
); );

@ -520,6 +520,7 @@
"InteractiveImportErrMovie": "Movie must be chosen for each selected file", "InteractiveImportErrMovie": "Movie must be chosen for each selected file",
"InteractiveImportErrQuality": "Quality must be chosen for each selected file", "InteractiveImportErrQuality": "Quality must be chosen for each selected file",
"InteractiveSearch": "Interactive Search", "InteractiveSearch": "Interactive Search",
"InteractiveSearchResultsFailedErrorMessage": "Search failed because its {message}. Try refreshing the movie info and verify the necessary information is present before searching again.",
"Interval": "Interval", "Interval": "Interval",
"InvalidFormat": "Invalid Format", "InvalidFormat": "Invalid Format",
"KeepAndUnmonitorMovie": "Keep and Unmonitor Movie", "KeepAndUnmonitorMovie": "Keep and Unmonitor Movie",
@ -667,6 +668,7 @@
"MovieMatchType": "Movie Match Type", "MovieMatchType": "Movie Match Type",
"MovieNaming": "Movie Naming", "MovieNaming": "Movie Naming",
"MovieOnly": "Movie Only", "MovieOnly": "Movie Only",
"MovieSearchResultsLoadError": "Unable to load results for this movie search. Try again later",
"MovieTitle": "Movie Title", "MovieTitle": "Movie Title",
"MovieTitleHelpText": "The title of the movie to exclude (can be anything meaningful)", "MovieTitleHelpText": "The title of the movie to exclude (can be anything meaningful)",
"MovieYear": "Movie Year", "MovieYear": "Movie Year",
@ -1217,7 +1219,6 @@
"UnableToLoadQualityProfiles": "Unable to load Quality Profiles", "UnableToLoadQualityProfiles": "Unable to load Quality Profiles",
"UnableToLoadRemotePathMappings": "Unable to load Remote Path Mappings", "UnableToLoadRemotePathMappings": "Unable to load Remote Path Mappings",
"UnableToLoadRestrictions": "Unable to load Restrictions", "UnableToLoadRestrictions": "Unable to load Restrictions",
"UnableToLoadResultsIntSearch": "Unable to load results for this movie search. Try again later",
"UnableToLoadRootFolders": "Unable to load root folders", "UnableToLoadRootFolders": "Unable to load root folders",
"UnableToLoadTags": "Unable to load Tags", "UnableToLoadTags": "Unable to load Tags",
"UnableToLoadTheCalendar": "Unable to load the calendar", "UnableToLoadTheCalendar": "Unable to load the calendar",

Loading…
Cancel
Save