1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-05 15:47:20 +02:00

Add translations to Auto Tagging

This commit is contained in:
Bogdan 2023-07-26 07:46:02 +03:00
parent 80099dcacb
commit 430ea81937
7 changed files with 48 additions and 29 deletions

View File

@ -6,6 +6,7 @@ import IconButton from 'Components/Link/IconButton';
import ConfirmModal from 'Components/Modal/ConfirmModal'; import ConfirmModal from 'Components/Modal/ConfirmModal';
import TagList from 'Components/TagList'; import TagList from 'Components/TagList';
import { icons, kinds } from 'Helpers/Props'; import { icons, kinds } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import EditAutoTaggingModal from './EditAutoTaggingModal'; import EditAutoTaggingModal from './EditAutoTaggingModal';
import styles from './AutoTagging.css'; import styles from './AutoTagging.css';
@ -63,7 +64,7 @@ export default function AutoTagging(props) {
<div> <div>
<IconButton <IconButton
className={styles.cloneButton} className={styles.cloneButton}
title="Clone Auto Tag" title={translate('CloneAutoTag')}
name={icons.CLONE} name={icons.CLONE}
onPress={onClonePress} onPress={onClonePress}
/> />
@ -112,9 +113,9 @@ export default function AutoTagging(props) {
<ConfirmModal <ConfirmModal
isOpen={isDeleteModalOpen} isOpen={isDeleteModalOpen}
kind={kinds.DANGER} kind={kinds.DANGER}
title="Delete Auto Tag" title={translate('DeleteAutoTag')}
message={`Are you sure you want to delete the auto tag '${name}'?`} message={translate('DeleteAutoTagHelpText', [name])}
confirmLabel="Delete" confirmLabel={translate('Delete')}
isSpinning={isDeleting} isSpinning={isDeleting}
onConfirm={onConfirmDelete} onConfirm={onConfirmDelete}
onCancel={onDeleteModalClose} onCancel={onDeleteModalClose}

View File

@ -10,6 +10,7 @@ import { cloneAutoTagging, deleteAutoTagging, fetchAutoTaggings } from 'Store/Ac
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector'; import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
import createTagsSelector from 'Store/Selectors/createTagsSelector'; import createTagsSelector from 'Store/Selectors/createTagsSelector';
import sortByName from 'Utilities/Array/sortByName'; import sortByName from 'Utilities/Array/sortByName';
import translate from 'Utilities/String/translate';
import AutoTagging from './AutoTagging'; import AutoTagging from './AutoTagging';
import EditAutoTaggingModal from './EditAutoTaggingModal'; import EditAutoTaggingModal from './EditAutoTaggingModal';
import styles from './AutoTaggings.css'; import styles from './AutoTaggings.css';
@ -55,9 +56,9 @@ export default function AutoTaggings() {
}, [dispatch]); }, [dispatch]);
return ( return (
<FieldSet legend="Auto Tagging"> <FieldSet legend={translate('AutoTagging')}>
<PageSectionContent <PageSectionContent
errorMessage="Unable to load auto taggimg" errorMessage={translate('UnableToLoadAutoTagging')}
error={error} error={error}
isFetching={isFetching} isFetching={isFetching}
isPopulated={isPopulated} isPopulated={isPopulated}

View File

@ -24,6 +24,7 @@ import {
setAutoTaggingValue setAutoTaggingValue
} from 'Store/Actions/settingsActions'; } from 'Store/Actions/settingsActions';
import { createProviderSettingsSelectorHook } from 'Store/Selectors/createProviderSettingsSelector'; import { createProviderSettingsSelectorHook } from 'Store/Selectors/createProviderSettingsSelector';
import translate from 'Utilities/String/translate';
import AddSpecificationModal from './Specifications/AddSpecificationModal'; import AddSpecificationModal from './Specifications/AddSpecificationModal';
import EditSpecificationModal from './Specifications/EditSpecificationModal'; import EditSpecificationModal from './Specifications/EditSpecificationModal';
import Specification from './Specifications/Specification'; import Specification from './Specifications/Specification';
@ -110,7 +111,7 @@ export default function EditAutoTaggingModalContent(props) {
<ModalContent onModalClose={onModalClose}> <ModalContent onModalClose={onModalClose}>
<ModalHeader> <ModalHeader>
{id ? 'Edit Auto Tag' : 'Add Auto Tag'} {id ? translate('EditAutoTag') : translate('AddAutoTag')}
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>
@ -136,7 +137,7 @@ export default function EditAutoTaggingModalContent(props) {
> >
<FormGroup> <FormGroup>
<FormLabel> <FormLabel>
Name {translate('Name')}
</FormLabel> </FormLabel>
<FormInputGroup <FormInputGroup
@ -148,19 +149,19 @@ export default function EditAutoTaggingModalContent(props) {
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<FormLabel>{'Remove Tags Automatically'}</FormLabel> <FormLabel>{translate('RemoveTagsAutomatically')}</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.CHECK} type={inputTypes.CHECK}
name="removeTagsAutomatically" name="removeTagsAutomatically"
helpText={'Remove tags automatically if conditions are not met'} helpText={translate('RemoveTagsAutomaticallyHelpText')}
{...removeTagsAutomatically} {...removeTagsAutomatically}
onChange={onInputChange} onChange={onInputChange}
/> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<FormLabel>Tags</FormLabel> <FormLabel>{translate('Tags')}</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.TAG} type={inputTypes.TAG}
@ -171,7 +172,7 @@ export default function EditAutoTaggingModalContent(props) {
</FormGroup> </FormGroup>
</Form> </Form>
<FieldSet legend={'Conditions'}> <FieldSet legend={translate('Conditions')}>
<div className={styles.autoTaggings}> <div className={styles.autoTaggings}>
{ {
specifications.map((tag) => { specifications.map((tag) => {
@ -229,7 +230,7 @@ export default function EditAutoTaggingModalContent(props) {
kind={kinds.DANGER} kind={kinds.DANGER}
onPress={onDeleteAutoTaggingPress} onPress={onDeleteAutoTaggingPress}
> >
Delete {translate('Delete')}
</Button> : </Button> :
null null
} }
@ -245,7 +246,7 @@ export default function EditAutoTaggingModalContent(props) {
<Button <Button
onPress={onModalClose} onPress={onModalClose}
> >
Cancel {translate('Cancel')}
</Button> </Button>
<SpinnerErrorButton <SpinnerErrorButton
@ -253,7 +254,7 @@ export default function EditAutoTaggingModalContent(props) {
error={saveError} error={saveError}
onPress={onSavePress} onPress={onSavePress}
> >
Save {translate('Save')}
</SpinnerErrorButton> </SpinnerErrorButton>
</ModalFooter> </ModalFooter>
</ModalContent> </ModalContent>

View File

@ -5,6 +5,7 @@ import Link from 'Components/Link/Link';
import Menu from 'Components/Menu/Menu'; import Menu from 'Components/Menu/Menu';
import MenuContent from 'Components/Menu/MenuContent'; import MenuContent from 'Components/Menu/MenuContent';
import { sizes } from 'Helpers/Props'; import { sizes } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import AddSpecificationPresetMenuItem from './AddSpecificationPresetMenuItem'; import AddSpecificationPresetMenuItem from './AddSpecificationPresetMenuItem';
import styles from './AddSpecificationItem.css'; import styles from './AddSpecificationItem.css';
@ -45,7 +46,7 @@ export default function AddSpecificationItem(props) {
size={sizes.SMALL} size={sizes.SMALL}
onPress={onWrappedSpecificationSelect} onPress={onWrappedSpecificationSelect}
> >
Custom {translate('Custom')}
</Button> </Button>
<Menu className={styles.presetsMenu}> <Menu className={styles.presetsMenu}>
@ -53,7 +54,7 @@ export default function AddSpecificationItem(props) {
className={styles.presetsMenuButton} className={styles.presetsMenuButton}
size={sizes.SMALL} size={sizes.SMALL}
> >
Presets {translate('Presets')}
</Button> </Button>
<MenuContent> <MenuContent>
@ -81,7 +82,7 @@ export default function AddSpecificationItem(props) {
to={infoLink} to={infoLink}
size={sizes.SMALL} size={sizes.SMALL}
> >
More Info {translate('MoreInfo')}
</Button> : </Button> :
null null
} }

View File

@ -13,6 +13,7 @@ import {
fetchAutoTaggingSpecificationSchema, fetchAutoTaggingSpecificationSchema,
selectAutoTaggingSpecificationSchema selectAutoTaggingSpecificationSchema
} from 'Store/Actions/settingsActions'; } from 'Store/Actions/settingsActions';
import translate from 'Utilities/String/translate';
import AddSpecificationItem from './AddSpecificationItem'; import AddSpecificationItem from './AddSpecificationItem';
import styles from './AddSpecificationModalContent.css'; import styles from './AddSpecificationModalContent.css';
@ -44,7 +45,7 @@ export default function AddSpecificationModalContent(props) {
return ( return (
<ModalContent onModalClose={onModalClose}> <ModalContent onModalClose={onModalClose}>
<ModalHeader> <ModalHeader>
Add Condition {translate('AddCondition')}
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>
@ -93,7 +94,7 @@ export default function AddSpecificationModalContent(props) {
<Button <Button
onPress={onModalClose} onPress={onModalClose}
> >
Close {translate('Close')}
</Button> </Button>
</ModalFooter> </ModalFooter>
</ModalContent> </ModalContent>

View File

@ -22,6 +22,7 @@ import {
setAutoTaggingSpecificationValue setAutoTaggingSpecificationValue
} from 'Store/Actions/settingsActions'; } from 'Store/Actions/settingsActions';
import { createProviderSettingsSelectorHook } from 'Store/Selectors/createProviderSettingsSelector'; import { createProviderSettingsSelectorHook } from 'Store/Selectors/createProviderSettingsSelector';
import translate from 'Utilities/String/translate';
import styles from './EditSpecificationModalContent.css'; import styles from './EditSpecificationModalContent.css';
function EditSpecificationModalContent(props) { function EditSpecificationModalContent(props) {
@ -71,7 +72,7 @@ function EditSpecificationModalContent(props) {
return ( return (
<ModalContent onModalClose={onCancelPress}> <ModalContent onModalClose={onCancelPress}>
<ModalHeader> <ModalHeader>
{`${id ? 'Edit' : 'Add'} Condition - ${implementationName}`} {`${id ? translate('EditCondition') : translate('AddCondition')} - ${implementationName}`}
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>
@ -94,7 +95,7 @@ function EditSpecificationModalContent(props) {
<FormGroup> <FormGroup>
<FormLabel> <FormLabel>
Name {translate('Name')}
</FormLabel> </FormLabel>
<FormInputGroup <FormInputGroup
@ -122,28 +123,28 @@ function EditSpecificationModalContent(props) {
<FormGroup> <FormGroup>
<FormLabel> <FormLabel>
Negate {translate('Negate')}
</FormLabel> </FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.CHECK} type={inputTypes.CHECK}
name="negate" name="negate"
{...negate} {...negate}
helpText={`If checked, the auto tagging rule will not apply if this ${implementationName} condition matches.`} helpText={translate('AutoTaggingNegateHelpText', [implementationName])}
onChange={onInputChange} onChange={onInputChange}
/> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<FormLabel> <FormLabel>
Required {translate('Required')}
</FormLabel> </FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.CHECK} type={inputTypes.CHECK}
name="required" name="required"
{...required} {...required}
helpText={`This ${implementationName} condition must match for the auto tagging rule to apply. Otherwise a single ${implementationName} match is sufficient.`} helpText={translate('AutoTaggingRequiredHelpText', [implementationName])}
onChange={onInputChange} onChange={onInputChange}
/> />
</FormGroup> </FormGroup>
@ -157,7 +158,7 @@ function EditSpecificationModalContent(props) {
kind={kinds.DANGER} kind={kinds.DANGER}
onPress={onDeleteSpecificationPress} onPress={onDeleteSpecificationPress}
> >
Delete {translate('Delete')}
</Button> : </Button> :
null null
} }
@ -165,14 +166,14 @@ function EditSpecificationModalContent(props) {
<Button <Button
onPress={onCancelPress} onPress={onCancelPress}
> >
Cancel {translate('Cancel')}
</Button> </Button>
<SpinnerErrorButton <SpinnerErrorButton
isSpinning={false} isSpinning={false}
onPress={onSavePress} onPress={onSavePress}
> >
Save {translate('Save')}
</SpinnerErrorButton> </SpinnerErrorButton>
</ModalFooter> </ModalFooter>
</ModalContent> </ModalContent>

View File

@ -4,6 +4,8 @@
"Actions": "Actions", "Actions": "Actions",
"Activity": "Activity", "Activity": "Activity",
"Add": "Add", "Add": "Add",
"AddAutoTag": "Add Auto Tag",
"AddCondition": "Add Condition",
"AddCustomFormat": "Add Custom Format", "AddCustomFormat": "Add Custom Format",
"AddDelayProfile": "Add Delay Profile", "AddDelayProfile": "Add Delay Profile",
"AddDownloadClient": "Add Download Client", "AddDownloadClient": "Add Download Client",
@ -73,6 +75,9 @@
"AuthenticationMethodHelpText": "Require Username and Password to access Radarr", "AuthenticationMethodHelpText": "Require Username and Password to access Radarr",
"Auto": "Auto", "Auto": "Auto",
"AutoRedownloadFailedHelpText": "Automatically search for and attempt to download a different release", "AutoRedownloadFailedHelpText": "Automatically search for and attempt to download a different release",
"AutoTagging": "Auto Tagging",
"AutoTaggingNegateHelpText": "If checked, the auto tagging rule will not apply if this {0} condition matches.",
"AutoTaggingRequiredHelpText": "This {0} condition must match for the auto tagging rule to apply. Otherwise a single {0} match is sufficient.",
"AutoUnmonitorPreviouslyDownloadedMoviesHelpText": "Movies deleted from the disk are automatically unmonitored in Radarr", "AutoUnmonitorPreviouslyDownloadedMoviesHelpText": "Movies deleted from the disk are automatically unmonitored in Radarr",
"Automatic": "Automatic", "Automatic": "Automatic",
"AutomaticAdd": "Automatic Add", "AutomaticAdd": "Automatic Add",
@ -132,6 +137,7 @@
"ClickToChangeQuality": "Click to change quality", "ClickToChangeQuality": "Click to change quality",
"ClickToChangeReleaseGroup": "Click to change release group", "ClickToChangeReleaseGroup": "Click to change release group",
"ClientPriority": "Client Priority", "ClientPriority": "Client Priority",
"CloneAutoTag": "Clone Auto Tag",
"CloneCondition": "Clone Condition", "CloneCondition": "Clone Condition",
"CloneCustomFormat": "Clone Custom Format", "CloneCustomFormat": "Clone Custom Format",
"CloneIndexer": "Clone Indexer", "CloneIndexer": "Clone Indexer",
@ -202,6 +208,8 @@
"DelayProfiles": "Delay Profiles", "DelayProfiles": "Delay Profiles",
"DelayingDownloadUntilInterp": "Delaying download until {0} at {1}", "DelayingDownloadUntilInterp": "Delaying download until {0} at {1}",
"Delete": "Delete", "Delete": "Delete",
"DeleteAutoTag": "Delete Auto Tag",
"DeleteAutoTagHelpText": "Are you sure you want to delete the auto tag '{0}'?",
"DeleteBackup": "Delete Backup", "DeleteBackup": "Delete Backup",
"DeleteBackupMessageText": "Are you sure you want to delete the backup '{0}'?", "DeleteBackupMessageText": "Are you sure you want to delete the backup '{0}'?",
"DeleteCondition": "Delete Condition", "DeleteCondition": "Delete Condition",
@ -296,7 +304,9 @@
"Downloading": "Downloading", "Downloading": "Downloading",
"Duration": "Duration", "Duration": "Duration",
"Edit": "Edit", "Edit": "Edit",
"EditAutoTag": "Edit Auto Tag",
"EditCollection": "Edit Collection", "EditCollection": "Edit Collection",
"EditCondition": "Edit Condition",
"EditCustomFormat": "Edit Custom Format", "EditCustomFormat": "Edit Custom Format",
"EditDelayProfile": "Edit Delay Profile", "EditDelayProfile": "Edit Delay Profile",
"EditGroups": "Edit Groups", "EditGroups": "Edit Groups",
@ -883,6 +893,8 @@
"RemoveSelectedItemQueueMessageText": "Are you sure you want to remove 1 item from the queue?", "RemoveSelectedItemQueueMessageText": "Are you sure you want to remove 1 item from the queue?",
"RemoveSelectedItems": "Remove Selected Items", "RemoveSelectedItems": "Remove Selected Items",
"RemoveSelectedItemsQueueMessageText": "Are you sure you want to remove {0} items from the queue?", "RemoveSelectedItemsQueueMessageText": "Are you sure you want to remove {0} items from the queue?",
"RemoveTagsAutomatically": "Remove Tags Automatically",
"RemoveTagsAutomaticallyHelpText": "Remove tags automatically if conditions are not met",
"RemovedFromTaskQueue": "Removed from task queue", "RemovedFromTaskQueue": "Removed from task queue",
"RemovedMovieCheckMultipleMessage": "Movies {0} were removed from TMDb", "RemovedMovieCheckMultipleMessage": "Movies {0} were removed from TMDb",
"RemovedMovieCheckSingleMessage": "Movie {0} was removed from TMDb", "RemovedMovieCheckSingleMessage": "Movie {0} was removed from TMDb",
@ -1128,6 +1140,7 @@
"UnableToAddRootFolder": "Unable to add root folder", "UnableToAddRootFolder": "Unable to add root folder",
"UnableToImportCheckLogs": "Downloaded - Unable to Import: check logs for details", "UnableToImportCheckLogs": "Downloaded - Unable to Import: check logs for details",
"UnableToLoadAltTitle": "Unable to load alternative titles.", "UnableToLoadAltTitle": "Unable to load alternative titles.",
"UnableToLoadAutoTagging": "Unable to load auto tagging",
"UnableToLoadBackups": "Unable to load backups", "UnableToLoadBackups": "Unable to load backups",
"UnableToLoadBlocklist": "Unable to load blocklist", "UnableToLoadBlocklist": "Unable to load blocklist",
"UnableToLoadCollections": "Unable to load collections", "UnableToLoadCollections": "Unable to load collections",