WiP: localized categories

FIXME
This commit is contained in:
nikk gitanes
2024-04-06 12:39:03 +03:00
parent 08834e8785
commit d5699699db
12 changed files with 68 additions and 53 deletions

View File

@@ -19,6 +19,7 @@ import AddDialog from 'components/Add/AddDialog'
import { StyledDialog } from 'style/CustomMaterialUiStyles'
import useOnStandaloneAppOutsideClick from 'utils/useOnStandaloneAppOutsideClick'
import { GETTING_INFO, IN_DB, CLOSED, PRELOAD, WORKING } from 'torrentStates'
import { TORRENT_CATEGORIES } from 'components/categories'
import {
StatusIndicators,
@@ -81,6 +82,9 @@ const Torrent = ({ torrent }) => {
const fullPlaylistLink = `${playlistTorrHost()}/${encodeURIComponent(parsedTitle || 'file')}.m3u?link=${hash}&m3u`
const detailedInfoDialogRef = useOnStandaloneAppOutsideClick(closeDetailedInfo)
// FIXME
const catIndex = TORRENT_CATEGORIES.findIndex(e => e.key === category)
const catArray = TORRENT_CATEGORIES.find(e => e.key === category)
return (
<>
@@ -119,7 +123,9 @@ const Torrent = ({ torrent }) => {
<div className='description-title-wrapper'>
<div className='description-section-name'>
{t('Name')}
<div className='description-category-wrapper'>{category}</div>
<div className='description-category-wrapper'>
{catIndex >= 0 ? t(catArray.name) : ''/* {category} */}
</div>
</div>
<div className='description-torrent-title'>{parsedTitle}</div>
</div>