Add translations to Auto Tagging

(cherry picked from commit 17a6683dbb7eb914b4732fc310044ec9baa3f141)
This commit is contained in:
Bogdan 2023-07-26 07:46:02 +03:00 committed by Mark McDowall
parent cac101bdee
commit cd0ea4ce66
7 changed files with 51 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', { name: 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', { name: 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",
"AddNew": "Add New", "AddNew": "Add New",
"Added": "Added", "Added": "Added",
"AddingTag": "Adding tag", "AddingTag": "Adding tag",
@ -29,6 +31,9 @@
"AudioInfo": "Audio Info", "AudioInfo": "Audio Info",
"AudioLanguages": "Audio Languages", "AudioLanguages": "Audio Languages",
"AutoAdd": "Auto Add", "AutoAdd": "Auto Add",
"AutoTagging": "Auto Tagging",
"AutoTaggingNegateHelpText": "If checked, the auto tagging rule will not apply if this {name} condition matches.",
"AutoTaggingRequiredHelpText": "This {name} condition must match for the auto tagging rule to apply. Otherwise a single {name} match is sufficient.",
"AutomaticAdd": "Automatic Add", "AutomaticAdd": "Automatic Add",
"Backup": "Backup", "Backup": "Backup",
"BackupNow": "Backup Now", "BackupNow": "Backup Now",
@ -44,10 +49,12 @@
"CancelPendingTask": "Are you sure you want to cancel this pending task?", "CancelPendingTask": "Are you sure you want to cancel this pending task?",
"Certification": "Certification", "Certification": "Certification",
"Clear": "Clear", "Clear": "Clear",
"CloneAutoTag": "Clone Auto Tag",
"CloneCondition": "Clone Condition", "CloneCondition": "Clone Condition",
"CloneCustomFormat": "Clone Custom Format", "CloneCustomFormat": "Clone Custom Format",
"Close": "Close", "Close": "Close",
"Component": "Component", "Component": "Component",
"Conditions": "Conditions",
"Connect": "Connect", "Connect": "Connect",
"ContinuingOnly": "Continuing Only", "ContinuingOnly": "Continuing Only",
"CountDownloadClientsSelected": "{count} download client(s) selected", "CountDownloadClientsSelected": "{count} download client(s) selected",
@ -61,6 +68,8 @@
"Daily": "Daily", "Daily": "Daily",
"Date": "Date", "Date": "Date",
"Delete": "Delete", "Delete": "Delete",
"DeleteAutoTag": "Delete Auto Tag",
"DeleteAutoTagHelpText": "Are you sure you want to delete the auto tag '{name}'?",
"DeleteBackup": "Delete Backup", "DeleteBackup": "Delete Backup",
"DeleteBackupMessageText": "Are you sure you want to delete the backup '{name}'?", "DeleteBackupMessageText": "Are you sure you want to delete the backup '{name}'?",
"DeleteCondition": "Delete Condition", "DeleteCondition": "Delete Condition",
@ -93,6 +102,8 @@
"DownloadClients": "Download Clients", "DownloadClients": "Download Clients",
"Duration": "Duration", "Duration": "Duration",
"Edit": "Edit", "Edit": "Edit",
"EditAutoTag": "Edit Auto Tag",
"EditCondition": "Edit Condition",
"EditSelectedDownloadClients": "Edit Selected Download Clients", "EditSelectedDownloadClients": "Edit Selected Download Clients",
"EditSelectedImportLists": "Edit Selected Import Lists", "EditSelectedImportLists": "Edit Selected Import Lists",
"EditSelectedIndexers": "Edit Selected Indexers", "EditSelectedIndexers": "Edit Selected Indexers",
@ -205,6 +216,7 @@
"MountHealthCheckMessage": "Mount containing a series path is mounted read-only: ", "MountHealthCheckMessage": "Mount containing a series path is mounted read-only: ",
"MultiSeason": "Multi-Season", "MultiSeason": "Multi-Season",
"Name": "Name", "Name": "Name",
"Negate": "Negate",
"Negated": "Negated", "Negated": "Negated",
"Network": "Network", "Network": "Network",
"New": "New", "New": "New",
@ -287,6 +299,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",
"RemovedSeriesMultipleRemovedHealthCheckMessage": "Series {0} were removed from TheTVDB", "RemovedSeriesMultipleRemovedHealthCheckMessage": "Series {0} were removed from TheTVDB",
"RemovedSeriesSingleRemovedHealthCheckMessage": "Series {0} was removed from TheTVDB", "RemovedSeriesSingleRemovedHealthCheckMessage": "Series {0} was removed from TheTVDB",
@ -310,6 +324,7 @@
"RootFolderMultipleMissingHealthCheckMessage": "Multiple root folders are missing: {0}", "RootFolderMultipleMissingHealthCheckMessage": "Multiple root folders are missing: {0}",
"RootFolderPath": "Root Folder Path", "RootFolderPath": "Root Folder Path",
"Runtime": "Runtime", "Runtime": "Runtime",
"Save": "Save",
"SceneNumbering": "Scene Numbering", "SceneNumbering": "Scene Numbering",
"Scheduled": "Scheduled", "Scheduled": "Scheduled",
"SearchForMonitoredEpisodes": "Search for monitored episodes", "SearchForMonitoredEpisodes": "Search for monitored episodes",
@ -353,6 +368,7 @@
"Type": "Type", "Type": "Type",
"UI": "UI", "UI": "UI",
"UI Language": "UI Language", "UI Language": "UI Language",
"UnableToLoadAutoTagging": "Unable to load auto tagging",
"UnableToLoadBackups": "Unable to load backups", "UnableToLoadBackups": "Unable to load backups",
"UnableToUpdateSonarrDirectly": "Unable to update Sonarr directly,", "UnableToUpdateSonarrDirectly": "Unable to update Sonarr directly,",
"Unmonitored": "Unmonitored", "Unmonitored": "Unmonitored",