Simplify column translations

This commit is contained in:
Bogdan 2023-08-04 03:38:24 +03:00 committed by GitHub
parent 9188a9971b
commit 551ea18caf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 76 additions and 224 deletions

View File

@ -21,22 +21,16 @@ const SIDEBAR_WIDTH = parseInt(dimensions.sidebarWidth);
const links = [ const links = [
{ {
iconName: icons.SERIES_CONTINUING, iconName: icons.SERIES_CONTINUING,
get title() { title: () => translate('Series'),
return translate('Series');
},
to: '/', to: '/',
alias: '/series', alias: '/series',
children: [ children: [
{ {
get title() { title: () => translate('AddNew'),
return translate('AddNew');
},
to: '/add/new' to: '/add/new'
}, },
{ {
get title() { title: () => translate('LibraryImport'),
return translate('LibraryImport');
},
to: '/add/import' to: '/add/import'
} }
] ]
@ -44,36 +38,26 @@ const links = [
{ {
iconName: icons.CALENDAR, iconName: icons.CALENDAR,
get title() { title: () => translate('Calendar'),
return translate('Calendar');
},
to: '/calendar' to: '/calendar'
}, },
{ {
iconName: icons.ACTIVITY, iconName: icons.ACTIVITY,
get title() { title: () => translate('Activity'),
return translate('Activity');
},
to: '/activity/queue', to: '/activity/queue',
children: [ children: [
{ {
get title() { title: () => translate('Queue'),
return translate('Queue');
},
to: '/activity/queue', to: '/activity/queue',
statusComponent: QueueStatusConnector statusComponent: QueueStatusConnector
}, },
{ {
get title() { title: () => translate('History'),
return translate('History');
},
to: '/activity/history' to: '/activity/history'
}, },
{ {
get title() { title: () => translate('Blocklist'),
return translate('Blocklist');
},
to: '/activity/blocklist' to: '/activity/blocklist'
} }
] ]
@ -81,21 +65,15 @@ const links = [
{ {
iconName: icons.WARNING, iconName: icons.WARNING,
get title() { title: () => translate('Wanted'),
return translate('Wanted');
},
to: '/wanted/missing', to: '/wanted/missing',
children: [ children: [
{ {
get title() { title: () => translate('Missing'),
return translate('Missing');
},
to: '/wanted/missing' to: '/wanted/missing'
}, },
{ {
get title() { title: () => translate('CutoffUnmet'),
return translate('CutoffUnmet');
},
to: '/wanted/cutoffunmet' to: '/wanted/cutoffunmet'
} }
] ]
@ -103,87 +81,59 @@ const links = [
{ {
iconName: icons.SETTINGS, iconName: icons.SETTINGS,
get title() { title: () => translate('Settings'),
return translate('Settings');
},
to: '/settings', to: '/settings',
children: [ children: [
{ {
get title() { title: () => translate('MediaManagement'),
return translate('MediaManagement');
},
to: '/settings/mediamanagement' to: '/settings/mediamanagement'
}, },
{ {
get title() { title: () => translate('Profiles'),
return translate('Profiles');
},
to: '/settings/profiles' to: '/settings/profiles'
}, },
{ {
get title() { title: () => translate('Quality'),
return translate('Quality');
},
to: '/settings/quality' to: '/settings/quality'
}, },
{ {
get title() { title: () => translate('CustomFormats'),
return translate('CustomFormats');
},
to: '/settings/customformats' to: '/settings/customformats'
}, },
{ {
get title() { title: () => translate('Indexers'),
return translate('Indexers');
},
to: '/settings/indexers' to: '/settings/indexers'
}, },
{ {
get title() { title: () => translate('DownloadClients'),
return translate('DownloadClients');
},
to: '/settings/downloadclients' to: '/settings/downloadclients'
}, },
{ {
get title() { title: () => translate('ImportLists'),
return translate('ImportLists');
},
to: '/settings/importlists' to: '/settings/importlists'
}, },
{ {
get title() { title: () => translate('Connect'),
return translate('Connect');
},
to: '/settings/connect' to: '/settings/connect'
}, },
{ {
get title() { title: () => translate('Metadata'),
return translate('Metadata');
},
to: '/settings/metadata' to: '/settings/metadata'
}, },
{ {
get title() { title: () => translate('MetadataSource'),
return translate('MetadataSource');
},
to: '/settings/metadatasource' to: '/settings/metadatasource'
}, },
{ {
get title() { title: () => translate('Tags'),
return translate('Tags');
},
to: '/settings/tags' to: '/settings/tags'
}, },
{ {
get title() { title: () => translate('General'),
return translate('General');
},
to: '/settings/general' to: '/settings/general'
}, },
{ {
get title() { title: () => translate('UI'),
return translate('UI');
},
to: '/settings/ui' to: '/settings/ui'
} }
] ]
@ -191,46 +141,32 @@ const links = [
{ {
iconName: icons.SYSTEM, iconName: icons.SYSTEM,
get title() { title: () => translate('System'),
return translate('System');
},
to: '/system/status', to: '/system/status',
children: [ children: [
{ {
get title() { title: () => translate('Status'),
return translate('Status');
},
to: '/system/status', to: '/system/status',
statusComponent: HealthStatusConnector statusComponent: HealthStatusConnector
}, },
{ {
get title() { title: () => translate('Tasks'),
return translate('Tasks');
},
to: '/system/tasks' to: '/system/tasks'
}, },
{ {
get title() { title: () => translate('Backup'),
return translate('Backup');
},
to: '/system/backup' to: '/system/backup'
}, },
{ {
get title() { title: () => translate('Updates'),
return translate('Updates');
},
to: '/system/updates' to: '/system/updates'
}, },
{ {
get title() { title: () => translate('Events'),
return translate('Events');
},
to: '/system/events' to: '/system/events'
}, },
{ {
get title() { title: () => translate('LogFiles'),
return translate('LogFiles');
},
to: '/system/logs/files' to: '/system/logs/files'
} }
] ]

View File

@ -64,7 +64,7 @@ class PageSidebarItem extends Component {
} }
<span className={isChildItem ? styles.noIcon : null}> <span className={isChildItem ? styles.noIcon : null}>
{title} {typeof title === 'function' ? title() : title}
</span> </span>
{ {
@ -88,7 +88,7 @@ class PageSidebarItem extends Component {
PageSidebarItem.propTypes = { PageSidebarItem.propTypes = {
iconName: PropTypes.object, iconName: PropTypes.object,
title: PropTypes.string.isRequired, title: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
to: PropTypes.string.isRequired, to: PropTypes.string.isRequired,
isActive: PropTypes.bool, isActive: PropTypes.bool,
isActiveParent: PropTypes.bool, isActiveParent: PropTypes.bool,

View File

@ -13,23 +13,17 @@ import RootFolderRow from './RootFolderRow';
const rootFolderColumns = [ const rootFolderColumns = [
{ {
name: 'path', name: 'path',
get label() { label: () => translate('Path'),
return translate('Path');
},
isVisible: true, isVisible: true,
}, },
{ {
name: 'freeSpace', name: 'freeSpace',
get label() { label: () => translate('FreeSpace'),
return translate('FreeSpace');
},
isVisible: true, isVisible: true,
}, },
{ {
name: 'unmappedFolders', name: 'unmappedFolders',
get label() { label: () => translate('UnmappedFolders'),
return translate('UnmappedFolders');
},
isVisible: true, isVisible: true,
}, },
{ {

View File

@ -36,49 +36,37 @@ type OnSelectedChangeCallback = React.ComponentProps<
const COLUMNS = [ const COLUMNS = [
{ {
name: 'name', name: 'name',
get label() { label: () => translate('Name'),
return translate('Name');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'implementation', name: 'implementation',
get label() { label: () => translate('Implementation'),
return translate('Implementation');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'enable', name: 'enable',
get label() { label: () => translate('Enabled'),
return translate('Enabled');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'priority', name: 'priority',
get label() { label: () => translate('Priority'),
return translate('Priority');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'removeCompletedDownloads', name: 'removeCompletedDownloads',
get label() { label: () => translate('RemoveCompleted'),
return translate('RemoveCompleted');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'removeFailedDownloads', name: 'removeFailedDownloads',
get label() { label: () => translate('RemoveFailed'),
return translate('RemoveFailed');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },

View File

@ -36,49 +36,37 @@ type OnSelectedChangeCallback = React.ComponentProps<
const COLUMNS = [ const COLUMNS = [
{ {
name: 'name', name: 'name',
get label() { label: () => translate('Name'),
return translate('Name');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'implementation', name: 'implementation',
get label() { label: () => translate('Implementation'),
return translate('Implementation');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'qualityProfileId', name: 'qualityProfileId',
get label() { label: () => translate('QualityProfile'),
return translate('QualityProfile');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'rootFolderPath', name: 'rootFolderPath',
get label() { label: () => translate('RootFolder'),
return translate('RootFolder');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'enableAutomaticAdd', name: 'enableAutomaticAdd',
get label() { label: () => translate('AutoAdd'),
return translate('AutoAdd');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'tags', name: 'tags',
get label() { label: () => translate('Tags'),
return translate('Tags');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },

View File

@ -36,57 +36,43 @@ type OnSelectedChangeCallback = React.ComponentProps<
const COLUMNS = [ const COLUMNS = [
{ {
name: 'name', name: 'name',
get label() { label: () => translate('Name'),
return translate('Name');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'implementation', name: 'implementation',
get label() { label: () => translate('Implementation'),
return translate('Implementation');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'enableRss', name: 'enableRss',
get label() { label: () => translate('EnableRSS'),
return translate('EnableRSS');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'enableAutomaticSearch', name: 'enableAutomaticSearch',
get label() { label: () => translate('EnableAutomaticSearch'),
return translate('EnableAutomaticSearch');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'enableInteractiveSearch', name: 'enableInteractiveSearch',
get label() { label: () => translate('EnableInteractiveSearch'),
return translate('EnableInteractiveSearch');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'priority', name: 'priority',
get label() { label: () => translate('Priority'),
return translate('Priority');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },
{ {
name: 'tags', name: 'tags',
get label() { label: () => translate('Tags'),
return translate('Tags');
},
isSortable: true, isSortable: true,
isVisible: true, isVisible: true,
}, },

View File

@ -21,23 +21,17 @@ const columns = [
}, },
{ {
name: 'name', name: 'name',
get label() { label: () => translate('Name'),
return translate('Name');
},
isVisible: true isVisible: true
}, },
{ {
name: 'size', name: 'size',
get label() { label: () => translate('Size'),
return translate('Size');
},
isVisible: true isVisible: true
}, },
{ {
name: 'time', name: 'time',
get label() { label: () => translate('Time'),
return translate('Time');
},
isVisible: true isVisible: true
}, },
{ {

View File

@ -19,16 +19,12 @@ import LogFilesTableRow from './LogFilesTableRow';
const columns = [ const columns = [
{ {
name: 'filename', name: 'filename',
get label() { label: () => translate('Filename'),
return translate('Filename');
},
isVisible: true isVisible: true
}, },
{ {
name: 'lastWriteTime', name: 'lastWriteTime',
get label() { label: () => translate('LastWriteTime'),
return translate('LastWriteTime');
},
isVisible: true isVisible: true
}, },
{ {

View File

@ -15,23 +15,17 @@ import styles from './DiskSpace.css';
const columns = [ const columns = [
{ {
name: 'path', name: 'path',
get label() { label: () => translate('Location'),
return translate('Location');
},
isVisible: true isVisible: true
}, },
{ {
name: 'freeSpace', name: 'freeSpace',
get label() { label: () => translate('FreeSpace'),
return translate('FreeSpace');
},
isVisible: true isVisible: true
}, },
{ {
name: 'totalSpace', name: 'totalSpace',
get label() { label: () => translate('TotalSpace'),
return translate('TotalSpace');
},
isVisible: true isVisible: true
}, },
{ {

View File

@ -94,16 +94,12 @@ const columns = [
}, },
{ {
name: 'message', name: 'message',
get label() { label: () => translate('Message'),
return translate('Message');
},
isVisible: true isVisible: true
}, },
{ {
name: 'actions', name: 'actions',
get label() { label: () => translate('Actions'),
return translate('Actions');
},
isVisible: true isVisible: true
} }
]; ];

View File

@ -15,37 +15,27 @@ const columns = [
}, },
{ {
name: 'commandName', name: 'commandName',
get label() { label: () => translate('Name'),
return translate('Name');
},
isVisible: true isVisible: true
}, },
{ {
name: 'queued', name: 'queued',
get label() { label: () => translate('Queued'),
return translate('Queued');
},
isVisible: true isVisible: true
}, },
{ {
name: 'started', name: 'started',
get label() { label: () => translate('Started'),
return translate('Started');
},
isVisible: true isVisible: true
}, },
{ {
name: 'ended', name: 'ended',
get label() { label: () => translate('Ended'),
return translate('Ended');
},
isVisible: true isVisible: true
}, },
{ {
name: 'duration', name: 'duration',
get label() { label: () => translate('Duration'),
return translate('Duration');
},
isVisible: true isVisible: true
}, },
{ {

View File

@ -10,37 +10,27 @@ import ScheduledTaskRowConnector from './ScheduledTaskRowConnector';
const columns = [ const columns = [
{ {
name: 'name', name: 'name',
get label() { label: () => translate('Name'),
return translate('Name');
},
isVisible: true isVisible: true
}, },
{ {
name: 'interval', name: 'interval',
get label() { label: () => translate('Interval'),
return translate('Interval');
},
isVisible: true isVisible: true
}, },
{ {
name: 'lastExecution', name: 'lastExecution',
get label() { label: () => translate('LastExecution'),
return translate('LastExecution');
},
isVisible: true isVisible: true
}, },
{ {
name: 'lastDuration', name: 'lastDuration',
get label() { label: () => translate('LastDuration'),
return translate('LastDuration');
},
isVisible: true isVisible: true
}, },
{ {
name: 'nextExecution', name: 'nextExecution',
get label() { label: () => translate('NextExecution'),
return translate('NextExecution');
},
isVisible: true isVisible: true
}, },
{ {