Translate Frontend InteractiveSearch

(cherry picked from commit efca70438899c2f22e2be060011b58325e4f4705)

Closes #9027
This commit is contained in:
Stevie Robinson 2023-08-15 09:18:35 +02:00 committed by Bogdan
parent 4c2fcef742
commit be20a9d116
2 changed files with 29 additions and 15 deletions

View File

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

View File

@ -520,6 +520,7 @@
"InteractiveImportErrMovie": "Movie must be chosen for each selected file",
"InteractiveImportErrQuality": "Quality must be chosen for each selected file",
"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",
"InvalidFormat": "Invalid Format",
"KeepAndUnmonitorMovie": "Keep and Unmonitor Movie",
@ -667,6 +668,7 @@
"MovieMatchType": "Movie Match Type",
"MovieNaming": "Movie Naming",
"MovieOnly": "Movie Only",
"MovieSearchResultsLoadError": "Unable to load results for this movie search. Try again later",
"MovieTitle": "Movie Title",
"MovieTitleHelpText": "The title of the movie to exclude (can be anything meaningful)",
"MovieYear": "Movie Year",
@ -1217,7 +1219,6 @@
"UnableToLoadQualityProfiles": "Unable to load Quality Profiles",
"UnableToLoadRemotePathMappings": "Unable to load Remote Path Mappings",
"UnableToLoadRestrictions": "Unable to load Restrictions",
"UnableToLoadResultsIntSearch": "Unable to load results for this movie search. Try again later",
"UnableToLoadRootFolders": "Unable to load root folders",
"UnableToLoadTags": "Unable to load Tags",
"UnableToLoadTheCalendar": "Unable to load the calendar",