remove direct references to plural translation keys

This commit is contained in:
jeffvli
2026-01-29 19:52:42 -08:00
parent c1f48b21a4
commit 74b0e38f7e
10 changed files with 50 additions and 28 deletions
@@ -36,6 +36,7 @@ export type ItemDetailsModalProps = {
};
type ItemDetailRow<T> = {
count?: number;
key?: keyof T;
label: string;
postprocess?: string[];
@@ -61,7 +62,10 @@ const handleRow = <T extends AnyLibraryItem>(
return (
<Table.Tr key={rule.label}>
<Table.Th>
{t(rule.label, { postProcess: rule.postprocess || 'sentenceCase' })}
{t(rule.label, {
...(rule.count !== undefined && { count: rule.count }),
postProcess: rule.postprocess || 'sentenceCase',
})}
</Table.Th>
<Table.Td>{value}</Table.Td>
</Table.Tr>
@@ -135,12 +139,12 @@ const BoolField = (key: boolean) =>
const AlbumPropertyMapping: ItemDetailRow<Album>[] = [
{ key: 'name', label: 'common.title' },
{ label: 'entity.albumArtist_one', render: (item) => formatArtists(item.albumArtists) },
{ count: 1, label: 'entity.albumArtist', render: (item) => formatArtists(item.albumArtists) },
{
label: 'common.releaseType',
render: (item, t) => normalizeReleaseTypes(item.releaseTypes, t).join(SEPARATOR_STRING),
},
{ label: 'entity.genre_other', render: FormatGenre },
{ count: 2, label: 'entity.genre', render: FormatGenre },
{
label: 'common.duration',
render: (album) => album.duration && formatDurationString(album.duration),
@@ -198,7 +202,7 @@ const AlbumPropertyMapping: ItemDetailRow<Album>[] = [
const AlbumArtistPropertyMapping: ItemDetailRow<AlbumArtist>[] = [
{ key: 'name', label: 'common.name' },
{ label: 'entity.genre_other', render: FormatGenre },
{ count: 2, label: 'entity.genre', render: FormatGenre },
{
label: 'common.duration',
render: (artist) => artist.duration && formatDurationString(artist.duration),
@@ -243,7 +247,7 @@ const AlbumArtistPropertyMapping: ItemDetailRow<AlbumArtist>[] = [
const PlaylistPropertyMapping: ItemDetailRow<Playlist>[] = [
{ key: 'name', label: 'common.title' },
{ key: 'description', label: 'common.description' },
{ label: 'entity.genre_other', render: FormatGenre },
{ count: 2, label: 'entity.genre', render: FormatGenre },
{
label: 'common.duration',
render: (playlist) => playlist.duration && formatDurationString(playlist.duration),
@@ -266,11 +270,17 @@ const PlaylistPropertyMapping: ItemDetailRow<Playlist>[] = [
const SongPropertyMapping: ItemDetailRow<Song>[] = [
{ key: 'name', label: 'common.title' },
{ key: 'path', label: 'common.path', render: SongPath },
{ label: 'entity.albumArtist_one', render: (item) => formatArtists(item.albumArtists) },
{ key: 'artists', label: 'entity.artist_other', render: (item) => formatArtists(item.artists) },
{ count: 1, label: 'entity.albumArtist', render: (item) => formatArtists(item.albumArtists) },
{
count: 2,
key: 'artists',
label: 'entity.artist',
render: (item) => formatArtists(item.artists),
},
{
count: 1,
key: 'album',
label: 'entity.album_one',
label: 'entity.album',
render: (song) =>
song.albumId &&
song.album && (
@@ -304,7 +314,7 @@ const SongPropertyMapping: ItemDetailRow<Song>[] = [
? t('common.clean', { postProcess: 'sentenceCase' })
: null,
},
{ label: 'entity.genre_other', render: FormatGenre },
{ count: 2, label: 'entity.genre', render: FormatGenre },
{
label: 'common.duration',
render: (song) => formatDurationString(song.duration),
@@ -314,7 +324,7 @@ const SongPropertyMapping: ItemDetailRow<Song>[] = [
{ key: 'bitRate', label: 'common.bitrate', render: (song) => `${song.bitRate} kbps` },
{ key: 'sampleRate', label: 'common.sampleRate' },
{ key: 'bitDepth', label: 'common.bitDepth' },
{ key: 'channels', label: 'common.channel_other' },
{ count: 2, key: 'channels', label: 'common.channel' },
{ key: 'size', label: 'common.size', render: (song) => formatSizeString(song.size) },
{
label: 'common.favorite',