From 651e88e34fce706ffdff69d3cb9d7f16b5ef97ae Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sun, 6 Jun 2021 12:13:27 +0300 Subject: [PATCH] translate tables --- .../Table/index.jsx | 39 ++++++++++--------- .../DialogTorrentDetailsContent/index.jsx | 2 +- web/src/locales/en/translation.json | 8 +++- web/src/locales/ru/translation.json | 10 ++++- 4 files changed, 37 insertions(+), 22 deletions(-) diff --git a/web/src/components/DialogTorrentDetailsContent/Table/index.jsx b/web/src/components/DialogTorrentDetailsContent/Table/index.jsx index 11e56b7..e2434b0 100644 --- a/web/src/components/DialogTorrentDetailsContent/Table/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/Table/index.jsx @@ -4,6 +4,7 @@ import { humanizeSize } from 'utils/Utils' import ptt from 'parse-torrent-title' import { Button } from '@material-ui/core' import CopyToClipboard from 'react-copy-to-clipboard' +import { useTranslation } from 'react-i18next' import { TableStyle, ShortTableWrapper, ShortTable } from './style' @@ -17,6 +18,8 @@ const Table = memo( const fileHasEpisodeText = !!playableFileList?.find(({ path }) => ptt.parse(path).episode) const fileHasSeasonText = !!playableFileList?.find(({ path }) => ptt.parse(path).season) const fileHasResolutionText = !!playableFileList?.find(({ path }) => ptt.parse(path).resolution) + // eslint-disable-next-line no-unused-vars + const { t } = useTranslation() return !playableFileList?.length ? ( 'No playable files in this torrent' @@ -25,13 +28,13 @@ const Table = memo( - viewed - name - {fileHasSeasonText && seasonAmount?.length === 1 && season} - {fileHasEpisodeText && episode} - {fileHasResolutionText && resolution} - size - actions + {t('Viewed')} + {t('Name')} + {fileHasSeasonText && seasonAmount?.length === 1 && {t('Season')}} + {fileHasEpisodeText && {t('Episode')}} + {fileHasResolutionText && {t('Resolution')}} + {t('Size')} + {t('Actions')} @@ -52,18 +55,18 @@ const Table = memo( {humanizeSize(length)} @@ -87,7 +90,7 @@ const Table = memo(
{isViewed && (
-
viewed
+
{t('Viewed')}
@@ -95,41 +98,41 @@ const Table = memo( )} {fileHasSeasonText && seasonAmount?.length === 1 && (
-
season
+
{t('Season')}
{season}
)} {fileHasEpisodeText && (
-
epoisode
+
{t('Episode')}
{episode}
)} {fileHasResolutionText && (
-
resolution
+
{t('Resolution')}
{resolution}
)}
-
size
+
{t('Size')}
{humanizeSize(length)}
diff --git a/web/src/components/DialogTorrentDetailsContent/index.jsx b/web/src/components/DialogTorrentDetailsContent/index.jsx index c1aaa98..7c78ed6 100644 --- a/web/src/components/DialogTorrentDetailsContent/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/index.jsx @@ -177,7 +177,7 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) { {t('Buffer')} - {!settings?.PreloadBuffer && ({t('BufferNote')})} + {!settings?.PreloadBuffer && {t('BufferNote')}}