Translate Frontend Parse modal

This commit is contained in:
Stevie Robinson 2023-08-18 14:21:14 +02:00 committed by Mark McDowall
parent 2166e4dce4
commit c14fd2b4a3
4 changed files with 31 additions and 23 deletions

View File

@ -9,6 +9,7 @@ import PageContentBody from 'Components/Page/PageContentBody';
import { icons } from 'Helpers/Props'; import { icons } from 'Helpers/Props';
import { clear, fetch } from 'Store/Actions/parseActions'; import { clear, fetch } from 'Store/Actions/parseActions';
import getErrorMessage from 'Utilities/Object/getErrorMessage'; import getErrorMessage from 'Utilities/Object/getErrorMessage';
import translate from 'Utilities/String/translate';
import ParseResult from './ParseResult'; import ParseResult from './ParseResult';
import parseStateSelector from './parseStateSelector'; import parseStateSelector from './parseStateSelector';
import styles from './Parse.css'; import styles from './Parse.css';
@ -50,7 +51,7 @@ function Parse() {
); );
return ( return (
<PageContent title="Parse"> <PageContent title={translate('Parse')}>
<PageContentBody> <PageContentBody>
<div className={styles.inputContainer}> <div className={styles.inputContainer}>
<div className={styles.inputIconContainer}> <div className={styles.inputIconContainer}>
@ -76,7 +77,7 @@ function Parse() {
{!isFetching && !!error ? ( {!isFetching && !!error ? (
<div className={styles.message}> <div className={styles.message}>
<div className={styles.helpText}> <div className={styles.helpText}>
Error parsing, please try again. {translate('ParseModalErrorParsing')}
</div> </div>
<div>{getErrorMessage(error)}</div> <div>{getErrorMessage(error)}</div>
</div> </div>
@ -84,7 +85,7 @@ function Parse() {
{!isFetching && title && !error && !item.parsedEpisodeInfo ? ( {!isFetching && title && !error && !item.parsedEpisodeInfo ? (
<div className={styles.message}> <div className={styles.message}>
Unable to parse the provided title, please try again. {translate('ParseModalUnableToParse')}
</div> </div>
) : null} ) : null}
@ -95,12 +96,9 @@ function Parse() {
{title ? null : ( {title ? null : (
<div className={styles.message}> <div className={styles.message}>
<div className={styles.helpText}> <div className={styles.helpText}>
Enter a release title in the input above {translate('ParseModalHelpText')}
</div>
<div>
Sonarr will attempt to parse the title and show you details about
it
</div> </div>
<div>{translate('ParseModalHelpTextDetails')}</div>
</div> </div>
)} )}
</PageContentBody> </PageContentBody>

View File

@ -86,7 +86,7 @@ function ParseModalContent(props: ParseModalContentProps) {
{!isFetching && !!error ? ( {!isFetching && !!error ? (
<div className={styles.message}> <div className={styles.message}>
<div className={styles.helpText}> <div className={styles.helpText}>
Error parsing, please try again. {translate('ParseModalErrorParsing')}
</div> </div>
<div>{getErrorMessage(error)}</div> <div>{getErrorMessage(error)}</div>
</div> </div>
@ -94,7 +94,7 @@ function ParseModalContent(props: ParseModalContentProps) {
{!isFetching && title && !error && !item.parsedEpisodeInfo ? ( {!isFetching && title && !error && !item.parsedEpisodeInfo ? (
<div className={styles.message}> <div className={styles.message}>
Unable to parse the provided title, please try again. {translate('ParseModalUnableToParse')}
</div> </div>
) : null} ) : null}
@ -105,12 +105,9 @@ function ParseModalContent(props: ParseModalContentProps) {
{title ? null : ( {title ? null : (
<div className={styles.message}> <div className={styles.message}>
<div className={styles.helpText}> <div className={styles.helpText}>
Enter a release title in the input above {translate('ParseModalHelpText')}
</div>
<div>
Sonarr will attempt to parse the title and show you details about
it
</div> </div>
<div>{translate('ParseModalHelpTextDetails')}</div>
</div> </div>
)} )}
</ModalBody> </ModalBody>

View File

@ -117,22 +117,22 @@ function ParseResult(props: ParseResultProps) {
<div className={styles.column}> <div className={styles.column}>
<ParseResultItem <ParseResultItem
title={translate('Special')} title={translate('Special')}
data={special ? 'True' : 'False'} data={special ? translate('True') : translate('False')}
/> />
<ParseResultItem <ParseResultItem
title={translate('FullSeason')} title={translate('FullSeason')}
data={fullSeason ? 'True' : 'False'} data={fullSeason ? translate('True') : translate('False')}
/> />
<ParseResultItem <ParseResultItem
title={translate('MultiSeason')} title={translate('MultiSeason')}
data={isMultiSeason ? 'True' : 'False'} data={isMultiSeason ? translate('True') : translate('False')}
/> />
<ParseResultItem <ParseResultItem
title={translate('PartialSeason')} title={translate('PartialSeason')}
data={isPartialSeason ? 'True' : 'False'} data={isPartialSeason ? translate('True') : translate('False')}
/> />
</div> </div>
</div> </div>
@ -149,14 +149,14 @@ function ParseResult(props: ParseResultProps) {
title={translate('Proper')} title={translate('Proper')}
data={ data={
quality.revision.version > 1 && !quality.revision.isRepack quality.revision.version > 1 && !quality.revision.isRepack
? 'True' ? translate('True')
: '-' : '-'
} }
/> />
<ParseResultItem <ParseResultItem
title={translate('Repack')} title={translate('Repack')}
data={quality.revision.isRepack ? 'True' : '-'} data={quality.revision.isRepack ? translate('True') : '-'}
/> />
</div> </div>
@ -170,7 +170,7 @@ function ParseResult(props: ParseResultProps) {
<ParseResultItem <ParseResultItem
title={translate('Real')} title={translate('Real')}
data={quality.revision.real ? 'True' : '-'} data={quality.revision.real ? translate('True') : '-'}
/> />
</div> </div>
</div> </div>
@ -228,7 +228,13 @@ function ParseResult(props: ParseResultProps) {
<ParseResultItem <ParseResultItem
title={translate('CustomFormats')} title={translate('CustomFormats')}
data={<EpisodeFormats formats={customFormats} />} data={
customFormats && customFormats.length > 0 ? (
<EpisodeFormats formats={customFormats} />
) : (
'-'
)
}
/> />
<ParseResultItem <ParseResultItem

View File

@ -447,6 +447,7 @@
"FailedToLoadTranslationsFromApi": "Failed to load translations from API", "FailedToLoadTranslationsFromApi": "Failed to load translations from API",
"FailedToLoadUiSettingsFromApi": "Failed to load UI settings from API", "FailedToLoadUiSettingsFromApi": "Failed to load UI settings from API",
"FailedToUpdateSettings": "Failed to update settings", "FailedToUpdateSettings": "Failed to update settings",
"False": "False",
"FeatureRequests": "Feature Requests", "FeatureRequests": "Feature Requests",
"File": "File", "File": "File",
"FileBrowser": "File Browser", "FileBrowser": "File Browser",
@ -829,6 +830,11 @@
"OverrideGrabNoSeries": "Series must be selected", "OverrideGrabNoSeries": "Series must be selected",
"PackageVersion": "Package Version", "PackageVersion": "Package Version",
"PackageVersionInfo": "{packageVersion} by {packageAuthor}", "PackageVersionInfo": "{packageVersion} by {packageAuthor}",
"Parse": "Parse",
"ParseModalErrorParsing": "Error parsing, please try again.",
"ParseModalHelpText": "Enter a release title in the input above",
"ParseModalHelpTextDetails": "Sonarr will attempt to parse the title and show you details about it",
"ParseModalUnableToParse": "Unable to parse the provided title, please try again.",
"PartialSeason": "Partial Season", "PartialSeason": "Partial Season",
"Password": "Password", "Password": "Password",
"Path": "Path", "Path": "Path",
@ -1212,6 +1218,7 @@
"TotalRecords": "Total records: {totalRecords}", "TotalRecords": "Total records: {totalRecords}",
"TotalSpace": "Total Space", "TotalSpace": "Total Space",
"Trace": "Trace", "Trace": "Trace",
"True": "True",
"TvdbId": "TVDB ID", "TvdbId": "TVDB ID",
"TvdbIdExcludeHelpText": "The TVDB ID of the series to exclude", "TvdbIdExcludeHelpText": "The TVDB ID of the series to exclude",
"Twitter": "Twitter", "Twitter": "Twitter",