Add label translations in columns

This commit is contained in:
Bogdan 2023-08-01 09:18:29 +03:00 committed by Mark McDowall
parent 67dc898797
commit e8855c312d
10 changed files with 62 additions and 49 deletions

View File

@ -13,18 +13,19 @@ import Scroller from 'Components/Scroller/Scroller';
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 { kinds, scrollDirections } from 'Helpers/Props'; import { kinds, scrollDirections } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import FileBrowserRow from './FileBrowserRow'; import FileBrowserRow from './FileBrowserRow';
import styles from './FileBrowserModalContent.css'; import styles from './FileBrowserModalContent.css';
const columns = [ const columns = [
{ {
name: 'type', name: 'type',
label: 'Type', label: () => translate('Type'),
isVisible: true isVisible: true
}, },
{ {
name: 'name', name: 'name',
label: 'Name', label: () => translate('Name'),
isVisible: true isVisible: true
} }
]; ];

View File

@ -6,6 +6,7 @@ import LoadingIndicator from 'Components/Loading/LoadingIndicator';
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 translate from 'Utilities/String/translate';
import EpisodeHistoryRow from './EpisodeHistoryRow'; import EpisodeHistoryRow from './EpisodeHistoryRow';
const columns = [ const columns = [
@ -15,41 +16,41 @@ const columns = [
}, },
{ {
name: 'sourceTitle', name: 'sourceTitle',
label: 'Source Title', label: () => translate('SourceTitle'),
isVisible: true isVisible: true
}, },
{ {
name: 'languages', name: 'languages',
label: 'Languages', label: () => translate('Languages'),
isVisible: true isVisible: true
}, },
{ {
name: 'quality', name: 'quality',
label: 'Quality', label: () => translate('Quality'),
isVisible: true isVisible: true
}, },
{ {
name: 'date', name: 'date',
label: 'Date', label: () => translate('Date'),
isVisible: true isVisible: true
}, },
{ {
name: 'details', name: 'details',
label: 'Details', label: () => translate('Details'),
isVisible: true isVisible: true
}, },
{ {
name: 'customFormatScore', name: 'customFormatScore',
label: React.createElement(Icon, { label: React.createElement(Icon, {
name: icons.SCORE, name: icons.SCORE,
title: 'Custom format score' title: () => translate('CustomFormatScore')
}), }),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
{ {
name: 'actions', name: 'actions',
label: 'Actions', label: () => translate('Actions'),
isVisible: true isVisible: true
} }
]; ];

View File

@ -6,6 +6,7 @@ import Table from 'Components/Table/Table';
import TableBody from 'Components/Table/TableBody'; import TableBody from 'Components/Table/TableBody';
import { kinds, sizes } from 'Helpers/Props'; import { kinds, sizes } from 'Helpers/Props';
import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector'; import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector';
import translate from 'Utilities/String/translate';
import EpisodeAiringConnector from './EpisodeAiringConnector'; import EpisodeAiringConnector from './EpisodeAiringConnector';
import EpisodeFileRow from './EpisodeFileRow'; import EpisodeFileRow from './EpisodeFileRow';
import styles from './EpisodeSummary.css'; import styles from './EpisodeSummary.css';
@ -13,31 +14,31 @@ import styles from './EpisodeSummary.css';
const columns = [ const columns = [
{ {
name: 'path', name: 'path',
label: 'Path', label: () => translate('Path'),
isSortable: false, isSortable: false,
isVisible: true isVisible: true
}, },
{ {
name: 'size', name: 'size',
label: 'Size', label: () => translate('Size'),
isSortable: false, isSortable: false,
isVisible: true isVisible: true
}, },
{ {
name: 'languages', name: 'languages',
label: 'Languages', label: () => translate('Languages'),
isSortable: false, isSortable: false,
isVisible: true isVisible: true
}, },
{ {
name: 'quality', name: 'quality',
label: 'Quality', label: () => translate('Quality'),
isSortable: false, isSortable: false,
isVisible: true isVisible: true
}, },
{ {
name: 'customFormats', name: 'customFormats',
label: 'Formats', label: () => translate('Formats'),
isSortable: false, isSortable: false,
isVisible: true isVisible: true
}, },

View File

@ -25,6 +25,7 @@ import createClientSideCollectionSelector from 'Store/Selectors/createClientSide
import { CheckInputChanged } from 'typings/inputs'; import { CheckInputChanged } from 'typings/inputs';
import { SelectStateInputProps } from 'typings/props'; import { SelectStateInputProps } from 'typings/props';
import getErrorMessage from 'Utilities/Object/getErrorMessage'; import getErrorMessage from 'Utilities/Object/getErrorMessage';
import translate from 'Utilities/String/translate';
import getSelectedIds from 'Utilities/Table/getSelectedIds'; import getSelectedIds from 'Utilities/Table/getSelectedIds';
import SelectEpisodeRow from './SelectEpisodeRow'; import SelectEpisodeRow from './SelectEpisodeRow';
import styles from './SelectEpisodeModalContent.css'; import styles from './SelectEpisodeModalContent.css';
@ -38,12 +39,12 @@ const columns = [
}, },
{ {
name: 'title', name: 'title',
label: 'Title', label: () => translate('Title'),
isVisible: true, isVisible: true,
}, },
{ {
name: 'airDate', name: 'airDate',
label: 'Air Date', label: () => translate('AirDate'),
isVisible: true, isVisible: true,
}, },
]; ];

View File

@ -25,11 +25,11 @@ import styles from './InteractiveImportSelectFolderModalContent.css';
const recentFoldersColumns = [ const recentFoldersColumns = [
{ {
name: 'folder', name: 'folder',
label: 'Folder', label: () => translate('Folder'),
}, },
{ {
name: 'lastUsed', name: 'lastUsed',
label: 'Last Used', label: () => translate('LastUsed'),
}, },
{ {
name: 'actions', name: 'actions',
@ -100,7 +100,7 @@ function InteractiveImportSelectFolderModalContent(
return ( return (
<ModalContent onModalClose={onModalClose}> <ModalContent onModalClose={onModalClose}>
<ModalHeader> <ModalHeader>
{modalTitle} - {translate('Select Folder')} {modalTitle} - {translate('SelectFolder')}
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>
@ -143,7 +143,7 @@ function InteractiveImportSelectFolderModalContent(
onPress={onQuickImportPress} onPress={onQuickImportPress}
> >
<Icon className={styles.buttonIcon} name={icons.QUICK} /> <Icon className={styles.buttonIcon} name={icons.QUICK} />
{translate('Move Automatically')} {translate('MoveAutomatically')}
</Button> </Button>
</div> </div>
@ -156,7 +156,7 @@ function InteractiveImportSelectFolderModalContent(
onPress={onInteractiveImportPress} onPress={onInteractiveImportPress}
> >
<Icon className={styles.buttonIcon} name={icons.INTERACTIVE} /> <Icon className={styles.buttonIcon} name={icons.INTERACTIVE} />
{translate('Interactive Import')} {translate('InteractiveImport')}
</Button> </Button>
</div> </div>
</div> </div>

View File

@ -59,6 +59,7 @@ import { SortCallback } from 'typings/callbacks';
import { SelectStateInputProps } from 'typings/props'; import { SelectStateInputProps } from 'typings/props';
import getErrorMessage from 'Utilities/Object/getErrorMessage'; import getErrorMessage from 'Utilities/Object/getErrorMessage';
import hasDifferentItems from 'Utilities/Object/hasDifferentItems'; import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
import translate from 'Utilities/String/translate';
import getSelectedIds from 'Utilities/Table/getSelectedIds'; import getSelectedIds from 'Utilities/Table/getSelectedIds';
import InteractiveImportRow from './InteractiveImportRow'; import InteractiveImportRow from './InteractiveImportRow';
import styles from './InteractiveImportModalContent.css'; import styles from './InteractiveImportModalContent.css';
@ -82,46 +83,46 @@ type OnSelectedChangeCallback = React.ComponentProps<
const COLUMNS = [ const COLUMNS = [
{ {
name: 'relativePath', name: 'relativePath',
label: 'Relative Path', label: () => translate('RelativePath'),
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'series', name: 'series',
label: 'Series', label: () => translate('Series'),
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'season', name: 'season',
label: 'Season', label: () => translate('Season'),
isVisible: true, isVisible: true,
}, },
{ {
name: 'episodes', name: 'episodes',
label: 'Episode(s)', label: () => translate('Episodes'),
isVisible: true, isVisible: true,
}, },
{ {
name: 'releaseGroup', name: 'releaseGroup',
label: 'Release Group', label: () => translate('ReleaseGroup'),
isVisible: true, isVisible: true,
}, },
{ {
name: 'quality', name: 'quality',
label: 'Quality', label: () => translate('Quality'),
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'languages', name: 'languages',
label: 'Languages', label: () => translate('Languages'),
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'size', name: 'size',
label: 'Size', label: () => translate('Size'),
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
@ -129,7 +130,7 @@ const COLUMNS = [
name: 'customFormats', name: 'customFormats',
label: React.createElement(Icon, { label: React.createElement(Icon, {
name: icons.INTERACTIVE, name: icons.INTERACTIVE,
title: 'Custom Format', title: () => translate('CustomFormatScore'),
}), }),
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,

View File

@ -8,6 +8,7 @@ import Table from 'Components/Table/Table';
import TableBody from 'Components/Table/TableBody'; import TableBody from 'Components/Table/TableBody';
import { align, icons, sortDirections } from 'Helpers/Props'; import { align, icons, sortDirections } from 'Helpers/Props';
import getErrorMessage from 'Utilities/Object/getErrorMessage'; import getErrorMessage from 'Utilities/Object/getErrorMessage';
import translate from 'Utilities/String/translate';
import InteractiveSearchFilterModalConnector from './InteractiveSearchFilterModalConnector'; import InteractiveSearchFilterModalConnector from './InteractiveSearchFilterModalConnector';
import InteractiveSearchRow from './InteractiveSearchRow'; import InteractiveSearchRow from './InteractiveSearchRow';
import styles from './InteractiveSearch.css'; import styles from './InteractiveSearch.css';
@ -15,49 +16,49 @@ import styles from './InteractiveSearch.css';
const columns = [ const columns = [
{ {
name: 'protocol', name: 'protocol',
label: 'Source', label: () => translate('Source'),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
{ {
name: 'age', name: 'age',
label: 'Age', label: () => translate('Age'),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
{ {
name: 'title', name: 'title',
label: 'Title', label: () => translate('Title'),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
{ {
name: 'indexer', name: 'indexer',
label: 'Indexer', label: () => translate('Indexer'),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
{ {
name: 'size', name: 'size',
label: 'Size', label: () => translate('Size'),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
{ {
name: 'peers', name: 'peers',
label: 'Peers', label: () => translate('Peers'),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
{ {
name: 'languageWeight', name: 'languageWeight',
label: 'Languages', label: () => translate('Languages'),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
{ {
name: 'qualityWeight', name: 'qualityWeight',
label: 'Quality', label: () => translate('Quality'),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
@ -65,7 +66,7 @@ const columns = [
name: 'customFormatScore', name: 'customFormatScore',
label: React.createElement(Icon, { label: React.createElement(Icon, {
name: icons.SCORE, name: icons.SCORE,
title: 'Custom format score' title: () => translate('CustomFormatScore')
}), }),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
@ -74,7 +75,7 @@ const columns = [
name: 'rejections', name: 'rejections',
label: React.createElement(Icon, { label: React.createElement(Icon, {
name: icons.DANGER, name: icons.DANGER,
title: 'Rejections' title: () => translate('Rejections')
}), }),
isSortable: true, isSortable: true,
fixedSortDirection: sortDirections.ASCENDING, fixedSortDirection: sortDirections.ASCENDING,

View File

@ -12,6 +12,7 @@ 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 SeasonNumber from 'Season/SeasonNumber';
import translate from 'Utilities/String/translate';
import SeriesHistoryRowConnector from './SeriesHistoryRowConnector'; import SeriesHistoryRowConnector from './SeriesHistoryRowConnector';
const columns = [ const columns = [
@ -21,46 +22,46 @@ const columns = [
}, },
{ {
name: 'episode', name: 'episode',
label: 'Episode', label: () => translate('Episode'),
isVisible: true isVisible: true
}, },
{ {
name: 'sourceTitle', name: 'sourceTitle',
label: 'Source Title', label: () => translate('SourceTitle'),
isVisible: true isVisible: true
}, },
{ {
name: 'languages', name: 'languages',
label: 'Languages', label: () => translate('Languages'),
isVisible: true isVisible: true
}, },
{ {
name: 'quality', name: 'quality',
label: 'Quality', label: () => translate('Quality'),
isVisible: true isVisible: true
}, },
{ {
name: 'date', name: 'date',
label: 'Date', label: () => translate('Date'),
isVisible: true isVisible: true
}, },
{ {
name: 'details', name: 'details',
label: 'Details', label: () => translate('Details'),
isVisible: true isVisible: true
}, },
{ {
name: 'customFormatScore', name: 'customFormatScore',
label: React.createElement(Icon, { label: React.createElement(Icon, {
name: icons.SCORE, name: icons.SCORE,
title: 'Custom format score' title: () => translate('CustomFormatScore')
}), }),
isSortable: true, isSortable: true,
isVisible: true isVisible: true
}, },
{ {
name: 'actions', name: 'actions',
label: 'Actions', label: () => translate('Actions'),
isVisible: true isVisible: true
} }
]; ];

View File

@ -182,7 +182,7 @@ SeriesHistoryRow.propTypes = {
id: PropTypes.number.isRequired, id: PropTypes.number.isRequired,
eventType: PropTypes.string.isRequired, eventType: PropTypes.string.isRequired,
sourceTitle: PropTypes.string.isRequired, sourceTitle: PropTypes.string.isRequired,
languages: PropTypes.object.isRequired, languages: PropTypes.arrayOf(PropTypes.object),
quality: PropTypes.object.isRequired, quality: PropTypes.object.isRequired,
qualityCutoffNotMet: PropTypes.bool.isRequired, qualityCutoffNotMet: PropTypes.bool.isRequired,
customFormats: PropTypes.arrayOf(PropTypes.object), customFormats: PropTypes.arrayOf(PropTypes.object),

View File

@ -139,6 +139,7 @@
"FeatureRequests": "Feature Requests", "FeatureRequests": "Feature Requests",
"Filename": "Filename", "Filename": "Filename",
"Fixed": "Fixed", "Fixed": "Fixed",
"Folder": "Folder",
"Formats": "Formats", "Formats": "Formats",
"Forums": "Forums", "Forums": "Forums",
"FreeSpace": "Free Space", "FreeSpace": "Free Space",
@ -182,12 +183,14 @@
"Indexers": "Indexers", "Indexers": "Indexers",
"Info": "Info", "Info": "Info",
"InstallLatest": "Install Latest", "InstallLatest": "Install Latest",
"InteractiveImport": "Interactive Import",
"Interval": "Interval", "Interval": "Interval",
"Language": "Language", "Language": "Language",
"Language that Sonarr will use for UI": "Language that Sonarr will use for UI", "Language that Sonarr will use for UI": "Language that Sonarr will use for UI",
"Languages": "Languages", "Languages": "Languages",
"LastDuration": "Last Duration", "LastDuration": "Last Duration",
"LastExecution": "Last Execution", "LastExecution": "Last Execution",
"LastUsed": "Last Used",
"LastWriteTime": "Last Write Time", "LastWriteTime": "Last Write Time",
"LatestSeason": "Latest Season", "LatestSeason": "Latest Season",
"LiberaWebchat": "Libera Webchat", "LiberaWebchat": "Libera Webchat",
@ -217,6 +220,7 @@
"MonitoredOnly": "Monitored Only", "MonitoredOnly": "Monitored Only",
"MoreInfo": "More Info", "MoreInfo": "More Info",
"MountHealthCheckMessage": "Mount containing a series path is mounted read-only: ", "MountHealthCheckMessage": "Mount containing a series path is mounted read-only: ",
"MoveAutomatically": "Move Automatically",
"MultiSeason": "Multi-Season", "MultiSeason": "Multi-Season",
"Name": "Name", "Name": "Name",
"Negate": "Negate", "Negate": "Negate",
@ -333,12 +337,14 @@
"SceneNumbering": "Scene Numbering", "SceneNumbering": "Scene Numbering",
"Scheduled": "Scheduled", "Scheduled": "Scheduled",
"SearchForMonitoredEpisodes": "Search for monitored episodes", "SearchForMonitoredEpisodes": "Search for monitored episodes",
"Season": "Season",
"SeasonCount": "Season Count", "SeasonCount": "Season Count",
"SeasonFolder": "Season Folder", "SeasonFolder": "Season Folder",
"SeasonNumber": "Season Number", "SeasonNumber": "Season Number",
"SeasonPack": "Season Pack", "SeasonPack": "Season Pack",
"Seasons": "Seasons", "Seasons": "Seasons",
"Seeders": "Seeders", "Seeders": "Seeders",
"SelectFolder": "Select Folder",
"Series": "Series", "Series": "Series",
"SeriesEditor": "Series Editor", "SeriesEditor": "Series Editor",
"SeriesTitle": "Series Title", "SeriesTitle": "Series Title",