From e8855c312d21324dbddd8e0e712f7df5a9d9863c Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 1 Aug 2023 09:18:29 +0300 Subject: [PATCH] Add label translations in columns --- .../FileBrowser/FileBrowserModalContent.js | 5 +++-- .../src/Episode/History/EpisodeHistory.js | 15 ++++++------- .../src/Episode/Summary/EpisodeSummary.js | 11 +++++----- .../Episode/SelectEpisodeModalContent.tsx | 5 +++-- ...eractiveImportSelectFolderModalContent.tsx | 10 ++++----- .../InteractiveImportModalContent.tsx | 19 +++++++++-------- .../InteractiveSearch/InteractiveSearch.js | 21 ++++++++++--------- .../History/SeriesHistoryModalContent.js | 17 ++++++++------- .../src/Series/History/SeriesHistoryRow.js | 2 +- src/NzbDrone.Core/Localization/Core/en.json | 6 ++++++ 10 files changed, 62 insertions(+), 49 deletions(-) diff --git a/frontend/src/Components/FileBrowser/FileBrowserModalContent.js b/frontend/src/Components/FileBrowser/FileBrowserModalContent.js index 1569910b4..f285ed529 100644 --- a/frontend/src/Components/FileBrowser/FileBrowserModalContent.js +++ b/frontend/src/Components/FileBrowser/FileBrowserModalContent.js @@ -13,18 +13,19 @@ import Scroller from 'Components/Scroller/Scroller'; import Table from 'Components/Table/Table'; import TableBody from 'Components/Table/TableBody'; import { kinds, scrollDirections } from 'Helpers/Props'; +import translate from 'Utilities/String/translate'; import FileBrowserRow from './FileBrowserRow'; import styles from './FileBrowserModalContent.css'; const columns = [ { name: 'type', - label: 'Type', + label: () => translate('Type'), isVisible: true }, { name: 'name', - label: 'Name', + label: () => translate('Name'), isVisible: true } ]; diff --git a/frontend/src/Episode/History/EpisodeHistory.js b/frontend/src/Episode/History/EpisodeHistory.js index fafb4db4c..c5d2c907d 100644 --- a/frontend/src/Episode/History/EpisodeHistory.js +++ b/frontend/src/Episode/History/EpisodeHistory.js @@ -6,6 +6,7 @@ import LoadingIndicator from 'Components/Loading/LoadingIndicator'; import Table from 'Components/Table/Table'; import TableBody from 'Components/Table/TableBody'; import { icons, kinds } from 'Helpers/Props'; +import translate from 'Utilities/String/translate'; import EpisodeHistoryRow from './EpisodeHistoryRow'; const columns = [ @@ -15,41 +16,41 @@ const columns = [ }, { name: 'sourceTitle', - label: 'Source Title', + label: () => translate('SourceTitle'), isVisible: true }, { name: 'languages', - label: 'Languages', + label: () => translate('Languages'), isVisible: true }, { name: 'quality', - label: 'Quality', + label: () => translate('Quality'), isVisible: true }, { name: 'date', - label: 'Date', + label: () => translate('Date'), isVisible: true }, { name: 'details', - label: 'Details', + label: () => translate('Details'), isVisible: true }, { name: 'customFormatScore', label: React.createElement(Icon, { name: icons.SCORE, - title: 'Custom format score' + title: () => translate('CustomFormatScore') }), isSortable: true, isVisible: true }, { name: 'actions', - label: 'Actions', + label: () => translate('Actions'), isVisible: true } ]; diff --git a/frontend/src/Episode/Summary/EpisodeSummary.js b/frontend/src/Episode/Summary/EpisodeSummary.js index 8bf97dc18..f87c884d9 100644 --- a/frontend/src/Episode/Summary/EpisodeSummary.js +++ b/frontend/src/Episode/Summary/EpisodeSummary.js @@ -6,6 +6,7 @@ import Table from 'Components/Table/Table'; import TableBody from 'Components/Table/TableBody'; import { kinds, sizes } from 'Helpers/Props'; import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector'; +import translate from 'Utilities/String/translate'; import EpisodeAiringConnector from './EpisodeAiringConnector'; import EpisodeFileRow from './EpisodeFileRow'; import styles from './EpisodeSummary.css'; @@ -13,31 +14,31 @@ import styles from './EpisodeSummary.css'; const columns = [ { name: 'path', - label: 'Path', + label: () => translate('Path'), isSortable: false, isVisible: true }, { name: 'size', - label: 'Size', + label: () => translate('Size'), isSortable: false, isVisible: true }, { name: 'languages', - label: 'Languages', + label: () => translate('Languages'), isSortable: false, isVisible: true }, { name: 'quality', - label: 'Quality', + label: () => translate('Quality'), isSortable: false, isVisible: true }, { name: 'customFormats', - label: 'Formats', + label: () => translate('Formats'), isSortable: false, isVisible: true }, diff --git a/frontend/src/InteractiveImport/Episode/SelectEpisodeModalContent.tsx b/frontend/src/InteractiveImport/Episode/SelectEpisodeModalContent.tsx index fd9ef5f64..e6b10ddc2 100644 --- a/frontend/src/InteractiveImport/Episode/SelectEpisodeModalContent.tsx +++ b/frontend/src/InteractiveImport/Episode/SelectEpisodeModalContent.tsx @@ -25,6 +25,7 @@ import createClientSideCollectionSelector from 'Store/Selectors/createClientSide import { CheckInputChanged } from 'typings/inputs'; import { SelectStateInputProps } from 'typings/props'; import getErrorMessage from 'Utilities/Object/getErrorMessage'; +import translate from 'Utilities/String/translate'; import getSelectedIds from 'Utilities/Table/getSelectedIds'; import SelectEpisodeRow from './SelectEpisodeRow'; import styles from './SelectEpisodeModalContent.css'; @@ -38,12 +39,12 @@ const columns = [ }, { name: 'title', - label: 'Title', + label: () => translate('Title'), isVisible: true, }, { name: 'airDate', - label: 'Air Date', + label: () => translate('AirDate'), isVisible: true, }, ]; diff --git a/frontend/src/InteractiveImport/Folder/InteractiveImportSelectFolderModalContent.tsx b/frontend/src/InteractiveImport/Folder/InteractiveImportSelectFolderModalContent.tsx index 66ce29fa8..a4f0e82e7 100644 --- a/frontend/src/InteractiveImport/Folder/InteractiveImportSelectFolderModalContent.tsx +++ b/frontend/src/InteractiveImport/Folder/InteractiveImportSelectFolderModalContent.tsx @@ -25,11 +25,11 @@ import styles from './InteractiveImportSelectFolderModalContent.css'; const recentFoldersColumns = [ { name: 'folder', - label: 'Folder', + label: () => translate('Folder'), }, { name: 'lastUsed', - label: 'Last Used', + label: () => translate('LastUsed'), }, { name: 'actions', @@ -100,7 +100,7 @@ function InteractiveImportSelectFolderModalContent( return ( - {modalTitle} - {translate('Select Folder')} + {modalTitle} - {translate('SelectFolder')} @@ -143,7 +143,7 @@ function InteractiveImportSelectFolderModalContent( onPress={onQuickImportPress} > - {translate('Move Automatically')} + {translate('MoveAutomatically')} @@ -156,7 +156,7 @@ function InteractiveImportSelectFolderModalContent( onPress={onInteractiveImportPress} > - {translate('Interactive Import')} + {translate('InteractiveImport')} diff --git a/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContent.tsx b/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContent.tsx index bbcf735a3..8e5276217 100644 --- a/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContent.tsx +++ b/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContent.tsx @@ -59,6 +59,7 @@ import { SortCallback } from 'typings/callbacks'; import { SelectStateInputProps } from 'typings/props'; import getErrorMessage from 'Utilities/Object/getErrorMessage'; import hasDifferentItems from 'Utilities/Object/hasDifferentItems'; +import translate from 'Utilities/String/translate'; import getSelectedIds from 'Utilities/Table/getSelectedIds'; import InteractiveImportRow from './InteractiveImportRow'; import styles from './InteractiveImportModalContent.css'; @@ -82,46 +83,46 @@ type OnSelectedChangeCallback = React.ComponentProps< const COLUMNS = [ { name: 'relativePath', - label: 'Relative Path', + label: () => translate('RelativePath'), isSortable: true, isVisible: true, }, { name: 'series', - label: 'Series', + label: () => translate('Series'), isSortable: true, isVisible: true, }, { name: 'season', - label: 'Season', + label: () => translate('Season'), isVisible: true, }, { name: 'episodes', - label: 'Episode(s)', + label: () => translate('Episodes'), isVisible: true, }, { name: 'releaseGroup', - label: 'Release Group', + label: () => translate('ReleaseGroup'), isVisible: true, }, { name: 'quality', - label: 'Quality', + label: () => translate('Quality'), isSortable: true, isVisible: true, }, { name: 'languages', - label: 'Languages', + label: () => translate('Languages'), isSortable: true, isVisible: true, }, { name: 'size', - label: 'Size', + label: () => translate('Size'), isSortable: true, isVisible: true, }, @@ -129,7 +130,7 @@ const COLUMNS = [ name: 'customFormats', label: React.createElement(Icon, { name: icons.INTERACTIVE, - title: 'Custom Format', + title: () => translate('CustomFormatScore'), }), isSortable: true, isVisible: true, diff --git a/frontend/src/InteractiveSearch/InteractiveSearch.js b/frontend/src/InteractiveSearch/InteractiveSearch.js index c3eadb2ae..e8502788a 100644 --- a/frontend/src/InteractiveSearch/InteractiveSearch.js +++ b/frontend/src/InteractiveSearch/InteractiveSearch.js @@ -8,6 +8,7 @@ import Table from 'Components/Table/Table'; import TableBody from 'Components/Table/TableBody'; import { align, icons, sortDirections } from 'Helpers/Props'; import getErrorMessage from 'Utilities/Object/getErrorMessage'; +import translate from 'Utilities/String/translate'; import InteractiveSearchFilterModalConnector from './InteractiveSearchFilterModalConnector'; import InteractiveSearchRow from './InteractiveSearchRow'; import styles from './InteractiveSearch.css'; @@ -15,49 +16,49 @@ import styles from './InteractiveSearch.css'; const columns = [ { name: 'protocol', - label: 'Source', + label: () => translate('Source'), isSortable: true, isVisible: true }, { name: 'age', - label: 'Age', + label: () => translate('Age'), isSortable: true, isVisible: true }, { name: 'title', - label: 'Title', + label: () => translate('Title'), isSortable: true, isVisible: true }, { name: 'indexer', - label: 'Indexer', + label: () => translate('Indexer'), isSortable: true, isVisible: true }, { name: 'size', - label: 'Size', + label: () => translate('Size'), isSortable: true, isVisible: true }, { name: 'peers', - label: 'Peers', + label: () => translate('Peers'), isSortable: true, isVisible: true }, { name: 'languageWeight', - label: 'Languages', + label: () => translate('Languages'), isSortable: true, isVisible: true }, { name: 'qualityWeight', - label: 'Quality', + label: () => translate('Quality'), isSortable: true, isVisible: true }, @@ -65,7 +66,7 @@ const columns = [ name: 'customFormatScore', label: React.createElement(Icon, { name: icons.SCORE, - title: 'Custom format score' + title: () => translate('CustomFormatScore') }), isSortable: true, isVisible: true @@ -74,7 +75,7 @@ const columns = [ name: 'rejections', label: React.createElement(Icon, { name: icons.DANGER, - title: 'Rejections' + title: () => translate('Rejections') }), isSortable: true, fixedSortDirection: sortDirections.ASCENDING, diff --git a/frontend/src/Series/History/SeriesHistoryModalContent.js b/frontend/src/Series/History/SeriesHistoryModalContent.js index 76214625f..547d8ae93 100644 --- a/frontend/src/Series/History/SeriesHistoryModalContent.js +++ b/frontend/src/Series/History/SeriesHistoryModalContent.js @@ -12,6 +12,7 @@ import Table from 'Components/Table/Table'; import TableBody from 'Components/Table/TableBody'; import { icons, kinds } from 'Helpers/Props'; import SeasonNumber from 'Season/SeasonNumber'; +import translate from 'Utilities/String/translate'; import SeriesHistoryRowConnector from './SeriesHistoryRowConnector'; const columns = [ @@ -21,46 +22,46 @@ const columns = [ }, { name: 'episode', - label: 'Episode', + label: () => translate('Episode'), isVisible: true }, { name: 'sourceTitle', - label: 'Source Title', + label: () => translate('SourceTitle'), isVisible: true }, { name: 'languages', - label: 'Languages', + label: () => translate('Languages'), isVisible: true }, { name: 'quality', - label: 'Quality', + label: () => translate('Quality'), isVisible: true }, { name: 'date', - label: 'Date', + label: () => translate('Date'), isVisible: true }, { name: 'details', - label: 'Details', + label: () => translate('Details'), isVisible: true }, { name: 'customFormatScore', label: React.createElement(Icon, { name: icons.SCORE, - title: 'Custom format score' + title: () => translate('CustomFormatScore') }), isSortable: true, isVisible: true }, { name: 'actions', - label: 'Actions', + label: () => translate('Actions'), isVisible: true } ]; diff --git a/frontend/src/Series/History/SeriesHistoryRow.js b/frontend/src/Series/History/SeriesHistoryRow.js index 34dad48cb..7a2c71498 100644 --- a/frontend/src/Series/History/SeriesHistoryRow.js +++ b/frontend/src/Series/History/SeriesHistoryRow.js @@ -182,7 +182,7 @@ SeriesHistoryRow.propTypes = { id: PropTypes.number.isRequired, eventType: PropTypes.string.isRequired, sourceTitle: PropTypes.string.isRequired, - languages: PropTypes.object.isRequired, + languages: PropTypes.arrayOf(PropTypes.object), quality: PropTypes.object.isRequired, qualityCutoffNotMet: PropTypes.bool.isRequired, customFormats: PropTypes.arrayOf(PropTypes.object), diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 3d9244add..6a468aaf6 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -139,6 +139,7 @@ "FeatureRequests": "Feature Requests", "Filename": "Filename", "Fixed": "Fixed", + "Folder": "Folder", "Formats": "Formats", "Forums": "Forums", "FreeSpace": "Free Space", @@ -182,12 +183,14 @@ "Indexers": "Indexers", "Info": "Info", "InstallLatest": "Install Latest", + "InteractiveImport": "Interactive Import", "Interval": "Interval", "Language": "Language", "Language that Sonarr will use for UI": "Language that Sonarr will use for UI", "Languages": "Languages", "LastDuration": "Last Duration", "LastExecution": "Last Execution", + "LastUsed": "Last Used", "LastWriteTime": "Last Write Time", "LatestSeason": "Latest Season", "LiberaWebchat": "Libera Webchat", @@ -217,6 +220,7 @@ "MonitoredOnly": "Monitored Only", "MoreInfo": "More Info", "MountHealthCheckMessage": "Mount containing a series path is mounted read-only: ", + "MoveAutomatically": "Move Automatically", "MultiSeason": "Multi-Season", "Name": "Name", "Negate": "Negate", @@ -333,12 +337,14 @@ "SceneNumbering": "Scene Numbering", "Scheduled": "Scheduled", "SearchForMonitoredEpisodes": "Search for monitored episodes", + "Season": "Season", "SeasonCount": "Season Count", "SeasonFolder": "Season Folder", "SeasonNumber": "Season Number", "SeasonPack": "Season Pack", "Seasons": "Seasons", "Seeders": "Seeders", + "SelectFolder": "Select Folder", "Series": "Series", "SeriesEditor": "Series Editor", "SeriesTitle": "Series Title",