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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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