Skip to content

Commit

Permalink
Add some translations for artist table index
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisbogdan committed Feb 5, 2024
1 parent 09e9162 commit 49883d0
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 32 deletions.
18 changes: 5 additions & 13 deletions frontend/src/Artist/Index/Table/ArtistIndexRow.tsx
Expand Up @@ -24,7 +24,7 @@ import TagListConnector from 'Components/TagListConnector';
import { icons } from 'Helpers/Props';
import { executeCommand } from 'Store/Actions/commandActions';
import formatBytes from 'Utilities/Number/formatBytes';
import titleCase from 'Utilities/String/titleCase';
import firstCharToUpper from 'Utilities/String/firstCharToUpper';
import translate from 'Utilities/String/translate';
import AlbumsCell from './AlbumsCell';
import hasGrowableColumns from './hasGrowableColumns';
Expand Down Expand Up @@ -224,14 +224,6 @@ function ArtistIndexRow(props: ArtistIndexRowProps) {
);
}

if (name === 'qualityProfileId') {
return (
<VirtualTableRowCell key={name} className={styles[name]}>
{qualityProfile.name}
</VirtualTableRowCell>
);
}

if (name === 'metadataProfileId') {
return (
<VirtualTableRowCell key={name} className={styles[name]}>
Expand All @@ -243,7 +235,7 @@ function ArtistIndexRow(props: ArtistIndexRowProps) {
if (name === 'monitorNewItems') {
return (
<VirtualTableRowCell key={name} className={styles[name]}>
{titleCase(monitorNewItems)}
{translate(firstCharToUpper(monitorNewItems))}
</VirtualTableRowCell>
);
}
Expand All @@ -262,7 +254,7 @@ function ArtistIndexRow(props: ArtistIndexRowProps) {
}
return (
<VirtualTableRowCell key={name} className={styles[name]}>
None
{translate('None')}
</VirtualTableRowCell>
);
}
Expand All @@ -281,7 +273,7 @@ function ArtistIndexRow(props: ArtistIndexRowProps) {
}
return (
<VirtualTableRowCell key={name} className={styles[name]}>
None
{translate('None')}
</VirtualTableRowCell>
);
}
Expand Down Expand Up @@ -338,7 +330,7 @@ function ArtistIndexRow(props: ArtistIndexRowProps) {
if (name === 'path') {
return (
<VirtualTableRowCell key={name} className={styles[name]}>
{path}
<span title={path}>{path}</span>
</VirtualTableRowCell>
);
}
Expand Down

This file was deleted.

@@ -0,0 +1,33 @@
import React from 'react';
import FilterBuilderRowValueProps from 'Components/Filter/Builder/FilterBuilderRowValueProps';
import translate from 'Utilities/String/translate';
import FilterBuilderRowValue from './FilterBuilderRowValue';

const options = [
{
id: 'all',
get name() {
return translate('AllAlbums');
},
},
{
id: 'new',
get name() {
return translate('New');
},
},
{
id: 'none',
get name() {
return translate('None');
},
},
];

function MonitorNewItemsFilterBuilderRowValue(
props: FilterBuilderRowValueProps
) {
return <FilterBuilderRowValue tagList={options} {...props} />;
}

export default MonitorNewItemsFilterBuilderRowValue;
9 changes: 9 additions & 0 deletions frontend/src/Utilities/String/firstCharToUpper.js
@@ -0,0 +1,9 @@
function firstCharToUpper(input) {
if (!input) {
return '';
}

return [].map.call(input, (char, i) => (i ? char : char.toUpperCase())).join('');
}

export default firstCharToUpper;

0 comments on commit 49883d0

Please sign in to comment.