Translate Frontend Organize + Rename modal
including changing SeasonNumber component to formatSeason function
This commit is contained in:
parent
0feee19146
commit
866fbc7f09
|
@ -4,12 +4,14 @@ import Alert from 'Components/Alert';
|
||||||
import CheckInput from 'Components/Form/CheckInput';
|
import CheckInput from 'Components/Form/CheckInput';
|
||||||
import Button from 'Components/Link/Button';
|
import Button from 'Components/Link/Button';
|
||||||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||||||
|
import InlineMarkdown from 'Components/Markdown/InlineMarkdown';
|
||||||
import ModalBody from 'Components/Modal/ModalBody';
|
import ModalBody from 'Components/Modal/ModalBody';
|
||||||
import ModalContent from 'Components/Modal/ModalContent';
|
import ModalContent from 'Components/Modal/ModalContent';
|
||||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
import ModalFooter from 'Components/Modal/ModalFooter';
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
||||||
import { kinds } from 'Helpers/Props';
|
import { kinds } from 'Helpers/Props';
|
||||||
import SeasonNumber from 'Season/SeasonNumber';
|
import formatSeason from 'Season/formatSeason';
|
||||||
|
import translate from 'Utilities/String/translate';
|
||||||
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
||||||
import selectAll from 'Utilities/Table/selectAll';
|
import selectAll from 'Utilities/Table/selectAll';
|
||||||
import toggleSelected from 'Utilities/Table/toggleSelected';
|
import toggleSelected from 'Utilities/Table/toggleSelected';
|
||||||
|
@ -93,7 +95,10 @@ class OrganizePreviewModalContent extends Component {
|
||||||
return (
|
return (
|
||||||
<ModalContent onModalClose={onModalClose}>
|
<ModalContent onModalClose={onModalClose}>
|
||||||
<ModalHeader>
|
<ModalHeader>
|
||||||
Organize & Rename {seasonNumber != null && <SeasonNumber seasonNumber={seasonNumber} />}
|
{ seasonNumber == null ?
|
||||||
|
translate('OrganizeModalHeader') :
|
||||||
|
translate('OrganizeModalHeaderSeason', { season: formatSeason(seasonNumber) })
|
||||||
|
}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
|
@ -104,7 +109,7 @@ class OrganizePreviewModalContent extends Component {
|
||||||
|
|
||||||
{
|
{
|
||||||
!isFetching && error &&
|
!isFetching && error &&
|
||||||
<div>Error loading previews</div>
|
<div>{translate('OrganizeLoadError')}</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -112,8 +117,8 @@ class OrganizePreviewModalContent extends Component {
|
||||||
<div>
|
<div>
|
||||||
{
|
{
|
||||||
renameEpisodes ?
|
renameEpisodes ?
|
||||||
<div>Success! My work is done, no files to rename.</div> :
|
<div>{translate('OrganizeNothingToRename')}</div> :
|
||||||
<div>Renaming is disabled, nothing to rename</div>
|
<div>{translate('OrganizeRenamingDisabled')}</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -123,17 +128,11 @@ class OrganizePreviewModalContent extends Component {
|
||||||
<div>
|
<div>
|
||||||
<Alert>
|
<Alert>
|
||||||
<div>
|
<div>
|
||||||
All paths are relative to:
|
<InlineMarkdown data={translate('OrganizeRelativePaths', { path })} blockClassName={styles.path} />
|
||||||
<span className={styles.path}>
|
|
||||||
{path}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
Naming pattern:
|
<InlineMarkdown data={translate('OrganizeNamingPattern', { episodeFormat })} blockClassName={styles.episodeFormat} />
|
||||||
<span className={styles.episodeFormat}>
|
|
||||||
{episodeFormat}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</Alert>
|
</Alert>
|
||||||
|
|
||||||
|
@ -172,14 +171,14 @@ class OrganizePreviewModalContent extends Component {
|
||||||
<Button
|
<Button
|
||||||
onPress={onModalClose}
|
onPress={onModalClose}
|
||||||
>
|
>
|
||||||
Cancel
|
{translate('Cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
kind={kinds.PRIMARY}
|
kind={kinds.PRIMARY}
|
||||||
onPress={this.onOrganizePress}
|
onPress={this.onOrganizePress}
|
||||||
>
|
>
|
||||||
Organize
|
{translate('Organize')}
|
||||||
</Button>
|
</Button>
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
function SeasonNumber(props) {
|
|
||||||
const {
|
|
||||||
seasonNumber,
|
|
||||||
separator
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
if (seasonNumber === 0) {
|
|
||||||
return `${separator}Specials`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (seasonNumber > 0) {
|
|
||||||
return `${separator}Season ${seasonNumber}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
SeasonNumber.propTypes = {
|
|
||||||
seasonNumber: PropTypes.number.isRequired,
|
|
||||||
separator: PropTypes.string.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
SeasonNumber.defaultProps = {
|
|
||||||
separator: '- '
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SeasonNumber;
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
import translate from 'Utilities/String/translate';
|
||||||
|
|
||||||
|
export default function formatSeason(seasonNumber: number) {
|
||||||
|
if (seasonNumber === 0) {
|
||||||
|
return translate('Specials');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (seasonNumber > 0) {
|
||||||
|
return translate('SeasonNumberToken', { seasonNumber });
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
|
@ -11,7 +11,7 @@ import ModalHeader from 'Components/Modal/ModalHeader';
|
||||||
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 } from 'Helpers/Props';
|
import { icons, kinds } from 'Helpers/Props';
|
||||||
import SeasonNumber from 'Season/SeasonNumber';
|
import formatSeason from 'Season/formatSeason';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import SeriesHistoryRowConnector from './SeriesHistoryRowConnector';
|
import SeriesHistoryRowConnector from './SeriesHistoryRowConnector';
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class SeriesHistoryModalContent extends Component {
|
||||||
return (
|
return (
|
||||||
<ModalContent onModalClose={onModalClose}>
|
<ModalContent onModalClose={onModalClose}>
|
||||||
<ModalHeader>
|
<ModalHeader>
|
||||||
History {seasonNumber != null && <SeasonNumber seasonNumber={seasonNumber} />}
|
History {seasonNumber != null && formatSeason(seasonNumber)}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
|
|
|
@ -7,7 +7,7 @@ import ModalFooter from 'Components/Modal/ModalFooter';
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
||||||
import { scrollDirections } from 'Helpers/Props';
|
import { scrollDirections } from 'Helpers/Props';
|
||||||
import InteractiveSearchConnector from 'InteractiveSearch/InteractiveSearchConnector';
|
import InteractiveSearchConnector from 'InteractiveSearch/InteractiveSearchConnector';
|
||||||
import SeasonNumber from 'Season/SeasonNumber';
|
import formatSeason from 'Season/formatSeason';
|
||||||
|
|
||||||
function SeasonInteractiveSearchModalContent(props) {
|
function SeasonInteractiveSearchModalContent(props) {
|
||||||
const {
|
const {
|
||||||
|
@ -19,7 +19,7 @@ function SeasonInteractiveSearchModalContent(props) {
|
||||||
return (
|
return (
|
||||||
<ModalContent onModalClose={onModalClose}>
|
<ModalContent onModalClose={onModalClose}>
|
||||||
<ModalHeader>
|
<ModalHeader>
|
||||||
Interactive Search {seasonNumber != null && <SeasonNumber seasonNumber={seasonNumber} />}
|
Interactive Search {seasonNumber != null && formatSeason(seasonNumber)}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
|
||||||
<ModalBody scrollDirection={scrollDirections.BOTH}>
|
<ModalBody scrollDirection={scrollDirections.BOTH}>
|
||||||
|
|
|
@ -818,6 +818,14 @@
|
||||||
"OptionalName": "Optional name",
|
"OptionalName": "Optional name",
|
||||||
"Options": "Options",
|
"Options": "Options",
|
||||||
"Or": "or",
|
"Or": "or",
|
||||||
|
"Organize": "Organize",
|
||||||
|
"OrganizeLoadError": "Error loading previews",
|
||||||
|
"OrganizeModalHeader": "Organize & Rename",
|
||||||
|
"OrganizeModalHeaderSeason": "Organize & Rename - {season}",
|
||||||
|
"OrganizeNamingPattern": "Naming pattern: `{episodeFormat}`",
|
||||||
|
"OrganizeNothingToRename": "Success! My work is done, no files to rename.",
|
||||||
|
"OrganizeRelativePaths": "All paths are relative to: `{path}`",
|
||||||
|
"OrganizeRenamingDisabled": "Renaming is disabled, nothing to rename",
|
||||||
"Original": "Original",
|
"Original": "Original",
|
||||||
"OriginalLanguage": "Original Language",
|
"OriginalLanguage": "Original Language",
|
||||||
"Other": "Other",
|
"Other": "Other",
|
||||||
|
|
Loading…
Reference in New Issue