mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-24 22:36:19 -04:00
Translate frontend series pages
This commit is contained in:
+34
-18
@@ -11,12 +11,28 @@ import ModalFooter from 'Components/Modal/ModalFooter';
|
||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
||||
import { inputTypes } from 'Helpers/Props';
|
||||
import { setSeriesOverviewOption } from 'Store/Actions/seriesIndexActions';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import selectOverviewOptions from '../selectOverviewOptions';
|
||||
|
||||
const posterSizeOptions = [
|
||||
{ key: 'small', value: 'Small' },
|
||||
{ key: 'medium', value: 'Medium' },
|
||||
{ key: 'large', value: 'Large' },
|
||||
{
|
||||
key: 'small',
|
||||
get value() {
|
||||
return translate('Small');
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'medium',
|
||||
get value() {
|
||||
return translate('Medium');
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'large',
|
||||
get value() {
|
||||
return translate('Large');
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
interface SeriesIndexOverviewOptionsModalContentProps {
|
||||
@@ -53,12 +69,12 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
|
||||
return (
|
||||
<ModalContent onModalClose={onModalClose}>
|
||||
<ModalHeader>Overview Options</ModalHeader>
|
||||
<ModalHeader>{translate('OverviewOptions')}</ModalHeader>
|
||||
|
||||
<ModalBody>
|
||||
<Form>
|
||||
<FormGroup>
|
||||
<FormLabel>Poster Size</FormLabel>
|
||||
<FormLabel>{translate('PosterSize')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.SELECT}
|
||||
@@ -70,19 +86,19 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Detailed Progress Bar</FormLabel>
|
||||
<FormLabel>{translate('DetailedProgressBar')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="detailedProgressBar"
|
||||
value={detailedProgressBar}
|
||||
helpText="Show text on progress bar"
|
||||
helpText={translate('DetailedProgressBarHelpText')}
|
||||
onChange={onOverviewOptionChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Monitored</FormLabel>
|
||||
<FormLabel>{translate('ShowMonitored')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
@@ -93,7 +109,7 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Network</FormLabel>
|
||||
<FormLabel>{translate('ShowNetwork')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
@@ -104,7 +120,7 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Quality Profile</FormLabel>
|
||||
<FormLabel>{translate('ShowQualityProfile')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
@@ -115,7 +131,7 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Previous Airing</FormLabel>
|
||||
<FormLabel>{translate('ShowPreviousAiring')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
@@ -126,7 +142,7 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Date Added</FormLabel>
|
||||
<FormLabel>{translate('ShowDateAdded')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
@@ -137,7 +153,7 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Season Count</FormLabel>
|
||||
<FormLabel>{translate('ShowSeasonCount')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
@@ -148,7 +164,7 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Path</FormLabel>
|
||||
<FormLabel>{translate('ShowPath')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
@@ -159,7 +175,7 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Size on Disk</FormLabel>
|
||||
<FormLabel>{translate('ShowSizeOnDisk')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
@@ -170,13 +186,13 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Search</FormLabel>
|
||||
<FormLabel>{translate('ShowSearch')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="showSearchAction"
|
||||
value={showSearchAction}
|
||||
helpText="Show search button on hover"
|
||||
helpText={translate('ShowSearchHelpText')}
|
||||
onChange={onOverviewOptionChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
@@ -184,7 +200,7 @@ function SeriesIndexOverviewOptionsModalContent(
|
||||
</ModalBody>
|
||||
|
||||
<ModalFooter>
|
||||
<Button onPress={onModalClose}>Close</Button>
|
||||
<Button onPress={onModalClose}>{translate('Close')}</Button>
|
||||
</ModalFooter>
|
||||
</ModalContent>
|
||||
);
|
||||
|
||||
@@ -15,6 +15,7 @@ import SeriesPoster from 'Series/SeriesPoster';
|
||||
import { executeCommand } from 'Store/Actions/commandActions';
|
||||
import dimensions from 'Styles/Variables/dimensions';
|
||||
import fonts from 'Styles/Variables/fonts';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import createSeriesIndexItemSelector from '../createSeriesIndexItemSelector';
|
||||
import selectOverviewOptions from './selectOverviewOptions';
|
||||
import SeriesIndexOverviewInfo from './SeriesIndexOverviewInfo';
|
||||
@@ -27,7 +28,7 @@ const columnPaddingSmallScreen = parseInt(
|
||||
const defaultFontSize = parseInt(fonts.defaultFontSize);
|
||||
const lineHeight = parseFloat(fonts.lineHeight);
|
||||
|
||||
// Hardcoded height beased on line-height of 32 + bottom margin of 10.
|
||||
// Hardcoded height based on line-height of 32 + bottom margin of 10.
|
||||
// Less side-effecty than using react-measure.
|
||||
const TITLE_HEIGHT = 42;
|
||||
|
||||
@@ -144,7 +145,7 @@ function SeriesIndexOverview(props: SeriesIndexOverviewProps) {
|
||||
) : null}
|
||||
|
||||
{status === 'ended' && (
|
||||
<div className={styles.ended} title="Ended" />
|
||||
<div className={styles.ended} title={translate('Ended')} />
|
||||
)}
|
||||
|
||||
<Link className={styles.link} style={elementStyle} to={link}>
|
||||
@@ -181,7 +182,7 @@ function SeriesIndexOverview(props: SeriesIndexOverviewProps) {
|
||||
<div className={styles.actions}>
|
||||
<SpinnerIconButton
|
||||
name={icons.REFRESH}
|
||||
title="Refresh series"
|
||||
title={translate('RefreshSeries')}
|
||||
isSpinning={isRefreshingSeries}
|
||||
onPress={onRefreshPress}
|
||||
/>
|
||||
@@ -189,7 +190,7 @@ function SeriesIndexOverview(props: SeriesIndexOverviewProps) {
|
||||
{overviewOptions.showSearchAction ? (
|
||||
<SpinnerIconButton
|
||||
name={icons.SEARCH}
|
||||
title="Search for monitored episodes"
|
||||
title={translate('SearchForMonitoredEpisodes')}
|
||||
isSpinning={isSearchingSeries}
|
||||
onPress={onSearchPress}
|
||||
/>
|
||||
@@ -197,7 +198,7 @@ function SeriesIndexOverview(props: SeriesIndexOverviewProps) {
|
||||
|
||||
<IconButton
|
||||
name={icons.EDIT}
|
||||
title="Edit Series"
|
||||
title={translate('EditSeries')}
|
||||
onPress={onEditSeriesPress}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { UiSettings } from 'typings/UiSettings';
|
||||
import formatDateTime from 'Utilities/Date/formatDateTime';
|
||||
import getRelativeDate from 'Utilities/Date/getRelativeDate';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import SeriesIndexOverviewInfoRow from './SeriesIndexOverviewInfoRow';
|
||||
import styles from './SeriesIndexOverviewInfo.css';
|
||||
|
||||
@@ -99,7 +100,9 @@ function getInfoRowProps(
|
||||
const { name } = row;
|
||||
|
||||
if (name === 'monitored') {
|
||||
const monitoredText = props.monitored ? 'Monitored' : 'Unmonitored';
|
||||
const monitoredText = props.monitored
|
||||
? translate('Monitored')
|
||||
: translate('Unmonitored');
|
||||
|
||||
return {
|
||||
title: monitoredText,
|
||||
@@ -110,7 +113,7 @@ function getInfoRowProps(
|
||||
|
||||
if (name === 'network') {
|
||||
return {
|
||||
title: 'Network',
|
||||
title: translate('Network'),
|
||||
iconName: icons.NETWORK,
|
||||
label: props.network ?? '',
|
||||
};
|
||||
@@ -118,7 +121,7 @@ function getInfoRowProps(
|
||||
|
||||
if (name === 'qualityProfileId' && !!props.qualityProfile?.name) {
|
||||
return {
|
||||
title: 'Quality Profile',
|
||||
title: translate('QualityProfile'),
|
||||
iconName: icons.PROFILE,
|
||||
label: props.qualityProfile.name,
|
||||
};
|
||||
@@ -130,11 +133,9 @@ function getInfoRowProps(
|
||||
uiSettings;
|
||||
|
||||
return {
|
||||
title: `Previous Airing: ${formatDateTime(
|
||||
previousAiring,
|
||||
longDateFormat,
|
||||
timeFormat
|
||||
)}`,
|
||||
title: translate('PreviousAiringDate', {
|
||||
date: formatDateTime(previousAiring, longDateFormat, timeFormat),
|
||||
}),
|
||||
iconName: icons.CALENDAR,
|
||||
label:
|
||||
getRelativeDate(previousAiring, shortDateFormat, showRelativeDates, {
|
||||
@@ -150,7 +151,9 @@ function getInfoRowProps(
|
||||
uiSettings;
|
||||
|
||||
return {
|
||||
title: `Added: ${formatDateTime(added, longDateFormat, timeFormat)}`,
|
||||
title: translate('AddedDate', {
|
||||
date: formatDateTime(added, longDateFormat, timeFormat),
|
||||
}),
|
||||
iconName: icons.ADD,
|
||||
label:
|
||||
getRelativeDate(added, shortDateFormat, showRelativeDates, {
|
||||
@@ -162,16 +165,16 @@ function getInfoRowProps(
|
||||
|
||||
if (name === 'seasonCount') {
|
||||
const { seasonCount } = props;
|
||||
let seasons = '1 season';
|
||||
let seasons = translate('OneSeason');
|
||||
|
||||
if (seasonCount === 0) {
|
||||
seasons = 'No seasons';
|
||||
seasons = translate('NoSeasons');
|
||||
} else if (seasonCount > 1) {
|
||||
seasons = `${seasonCount} seasons`;
|
||||
seasons = translate('CountSeasons', { count: seasonCount });
|
||||
}
|
||||
|
||||
return {
|
||||
title: 'Season Count',
|
||||
title: translate('SeasonCount'),
|
||||
iconName: icons.CIRCLE,
|
||||
label: seasons,
|
||||
};
|
||||
@@ -179,7 +182,7 @@ function getInfoRowProps(
|
||||
|
||||
if (name === 'path') {
|
||||
return {
|
||||
title: 'Path',
|
||||
title: translate('Path'),
|
||||
iconName: icons.FOLDER,
|
||||
label: props.path,
|
||||
};
|
||||
@@ -187,7 +190,7 @@ function getInfoRowProps(
|
||||
|
||||
if (name === 'sizeOnDisk') {
|
||||
return {
|
||||
title: 'Size on Disk',
|
||||
title: translate('SizeOnDisk'),
|
||||
iconName: icons.DRIVE,
|
||||
label: formatBytes(props.sizeOnDisk),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user