From cd0ea4ce662d625a921019919438b9ffe8953be8 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 26 Jul 2023 07:46:02 +0300 Subject: [PATCH] Add translations to Auto Tagging (cherry picked from commit 17a6683dbb7eb914b4732fc310044ec9baa3f141) --- .../Settings/Tags/AutoTagging/AutoTagging.js | 9 +++++---- .../Settings/Tags/AutoTagging/AutoTaggings.js | 5 +++-- .../EditAutoTaggingModalContent.js | 19 ++++++++++--------- .../Specifications/AddSpecificationItem.js | 7 ++++--- .../AddSpecificationModalContent.js | 5 +++-- .../EditSpecificationModalContent.js | 19 ++++++++++--------- src/NzbDrone.Core/Localization/Core/en.json | 16 ++++++++++++++++ 7 files changed, 51 insertions(+), 29 deletions(-) diff --git a/frontend/src/Settings/Tags/AutoTagging/AutoTagging.js b/frontend/src/Settings/Tags/AutoTagging/AutoTagging.js index ed72ad99c..760273cb3 100644 --- a/frontend/src/Settings/Tags/AutoTagging/AutoTagging.js +++ b/frontend/src/Settings/Tags/AutoTagging/AutoTagging.js @@ -6,6 +6,7 @@ import IconButton from 'Components/Link/IconButton'; import ConfirmModal from 'Components/Modal/ConfirmModal'; import TagList from 'Components/TagList'; import { icons, kinds } from 'Helpers/Props'; +import translate from 'Utilities/String/translate'; import EditAutoTaggingModal from './EditAutoTaggingModal'; import styles from './AutoTagging.css'; @@ -63,7 +64,7 @@ export default function AutoTagging(props) {
@@ -112,9 +113,9 @@ export default function AutoTagging(props) { +
- {id ? 'Edit Auto Tag' : 'Add Auto Tag'} + {id ? translate('EditAutoTag') : translate('AddAutoTag')} @@ -136,7 +137,7 @@ export default function EditAutoTaggingModalContent(props) { > - Name + {translate('Name')} - {'Remove Tags Automatically'} + {translate('RemoveTagsAutomatically')} - Tags + {translate('Tags')} -
+
{ specifications.map((tag) => { @@ -229,7 +230,7 @@ export default function EditAutoTaggingModalContent(props) { kind={kinds.DANGER} onPress={onDeleteAutoTaggingPress} > - Delete + {translate('Delete')} : null } @@ -245,7 +246,7 @@ export default function EditAutoTaggingModalContent(props) { - Save + {translate('Save')} diff --git a/frontend/src/Settings/Tags/AutoTagging/Specifications/AddSpecificationItem.js b/frontend/src/Settings/Tags/AutoTagging/Specifications/AddSpecificationItem.js index ac23b9291..f6f2b134e 100644 --- a/frontend/src/Settings/Tags/AutoTagging/Specifications/AddSpecificationItem.js +++ b/frontend/src/Settings/Tags/AutoTagging/Specifications/AddSpecificationItem.js @@ -5,6 +5,7 @@ import Link from 'Components/Link/Link'; import Menu from 'Components/Menu/Menu'; import MenuContent from 'Components/Menu/MenuContent'; import { sizes } from 'Helpers/Props'; +import translate from 'Utilities/String/translate'; import AddSpecificationPresetMenuItem from './AddSpecificationPresetMenuItem'; import styles from './AddSpecificationItem.css'; @@ -45,7 +46,7 @@ export default function AddSpecificationItem(props) { size={sizes.SMALL} onPress={onWrappedSpecificationSelect} > - Custom + {translate('Custom')} @@ -53,7 +54,7 @@ export default function AddSpecificationItem(props) { className={styles.presetsMenuButton} size={sizes.SMALL} > - Presets + {translate('Presets')} @@ -81,7 +82,7 @@ export default function AddSpecificationItem(props) { to={infoLink} size={sizes.SMALL} > - More Info + {translate('MoreInfo')} : null } diff --git a/frontend/src/Settings/Tags/AutoTagging/Specifications/AddSpecificationModalContent.js b/frontend/src/Settings/Tags/AutoTagging/Specifications/AddSpecificationModalContent.js index 824e7452d..9b6553cbc 100644 --- a/frontend/src/Settings/Tags/AutoTagging/Specifications/AddSpecificationModalContent.js +++ b/frontend/src/Settings/Tags/AutoTagging/Specifications/AddSpecificationModalContent.js @@ -13,6 +13,7 @@ import { fetchAutoTaggingSpecificationSchema, selectAutoTaggingSpecificationSchema } from 'Store/Actions/settingsActions'; +import translate from 'Utilities/String/translate'; import AddSpecificationItem from './AddSpecificationItem'; import styles from './AddSpecificationModalContent.css'; @@ -44,7 +45,7 @@ export default function AddSpecificationModalContent(props) { return ( - Add Condition + {translate('AddCondition')} @@ -93,7 +94,7 @@ export default function AddSpecificationModalContent(props) { diff --git a/frontend/src/Settings/Tags/AutoTagging/Specifications/EditSpecificationModalContent.js b/frontend/src/Settings/Tags/AutoTagging/Specifications/EditSpecificationModalContent.js index ce8851d75..292468292 100644 --- a/frontend/src/Settings/Tags/AutoTagging/Specifications/EditSpecificationModalContent.js +++ b/frontend/src/Settings/Tags/AutoTagging/Specifications/EditSpecificationModalContent.js @@ -22,6 +22,7 @@ import { setAutoTaggingSpecificationValue } from 'Store/Actions/settingsActions'; import { createProviderSettingsSelectorHook } from 'Store/Selectors/createProviderSettingsSelector'; +import translate from 'Utilities/String/translate'; import styles from './EditSpecificationModalContent.css'; function EditSpecificationModalContent(props) { @@ -71,7 +72,7 @@ function EditSpecificationModalContent(props) { return ( - {`${id ? 'Edit' : 'Add'} Condition - ${implementationName}`} + {`${id ? translate('EditCondition') : translate('AddCondition')} - ${implementationName}`} @@ -94,7 +95,7 @@ function EditSpecificationModalContent(props) { - Name + {translate('Name')} - Negate + {translate('Negate')} - Required + {translate('Required')} @@ -157,7 +158,7 @@ function EditSpecificationModalContent(props) { kind={kinds.DANGER} onPress={onDeleteSpecificationPress} > - Delete + {translate('Delete')} : null } @@ -165,14 +166,14 @@ function EditSpecificationModalContent(props) { - Save + {translate('Save')} diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 74b50039c..0db381137 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -4,6 +4,8 @@ "Actions": "Actions", "Activity": "Activity", "Add": "Add", + "AddAutoTag": "Add Auto Tag", + "AddCondition": "Add Condition", "AddNew": "Add New", "Added": "Added", "AddingTag": "Adding tag", @@ -29,6 +31,9 @@ "AudioInfo": "Audio Info", "AudioLanguages": "Audio Languages", "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", "Backup": "Backup", "BackupNow": "Backup Now", @@ -44,10 +49,12 @@ "CancelPendingTask": "Are you sure you want to cancel this pending task?", "Certification": "Certification", "Clear": "Clear", + "CloneAutoTag": "Clone Auto Tag", "CloneCondition": "Clone Condition", "CloneCustomFormat": "Clone Custom Format", "Close": "Close", "Component": "Component", + "Conditions": "Conditions", "Connect": "Connect", "ContinuingOnly": "Continuing Only", "CountDownloadClientsSelected": "{count} download client(s) selected", @@ -61,6 +68,8 @@ "Daily": "Daily", "Date": "Date", "Delete": "Delete", + "DeleteAutoTag": "Delete Auto Tag", + "DeleteAutoTagHelpText": "Are you sure you want to delete the auto tag '{name}'?", "DeleteBackup": "Delete Backup", "DeleteBackupMessageText": "Are you sure you want to delete the backup '{name}'?", "DeleteCondition": "Delete Condition", @@ -93,6 +102,8 @@ "DownloadClients": "Download Clients", "Duration": "Duration", "Edit": "Edit", + "EditAutoTag": "Edit Auto Tag", + "EditCondition": "Edit Condition", "EditSelectedDownloadClients": "Edit Selected Download Clients", "EditSelectedImportLists": "Edit Selected Import Lists", "EditSelectedIndexers": "Edit Selected Indexers", @@ -205,6 +216,7 @@ "MountHealthCheckMessage": "Mount containing a series path is mounted read-only: ", "MultiSeason": "Multi-Season", "Name": "Name", + "Negate": "Negate", "Negated": "Negated", "Network": "Network", "New": "New", @@ -287,6 +299,8 @@ "RemoveSelectedItemQueueMessageText": "Are you sure you want to remove 1 item from the queue?", "RemoveSelectedItems": "Remove Selected Items", "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", "RemovedSeriesMultipleRemovedHealthCheckMessage": "Series {0} were removed from TheTVDB", "RemovedSeriesSingleRemovedHealthCheckMessage": "Series {0} was removed from TheTVDB", @@ -310,6 +324,7 @@ "RootFolderMultipleMissingHealthCheckMessage": "Multiple root folders are missing: {0}", "RootFolderPath": "Root Folder Path", "Runtime": "Runtime", + "Save": "Save", "SceneNumbering": "Scene Numbering", "Scheduled": "Scheduled", "SearchForMonitoredEpisodes": "Search for monitored episodes", @@ -353,6 +368,7 @@ "Type": "Type", "UI": "UI", "UI Language": "UI Language", + "UnableToLoadAutoTagging": "Unable to load auto tagging", "UnableToLoadBackups": "Unable to load backups", "UnableToUpdateSonarrDirectly": "Unable to update Sonarr directly,", "Unmonitored": "Unmonitored",