From 94e45c21333be735cd3e2d76815db4b1962958c2 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Tue, 14 Feb 2023 20:08:03 +0330 Subject: [PATCH] add translation keys --- src/i18n/locale/en.json | 4 ++++ src/screens/DownloadQueue.tsx | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 003ff56e..b45a3601 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -10,6 +10,10 @@ "Browse": { "sources": "Sources", "extensions": "Extensions" + }, + "DownloadQueue": { + "no-downloads": "No downloads", + "download-queue": "Download Queue" } } } diff --git a/src/screens/DownloadQueue.tsx b/src/screens/DownloadQueue.tsx index e0f27e29..a062fadb 100644 --- a/src/screens/DownloadQueue.tsx +++ b/src/screens/DownloadQueue.tsx @@ -26,6 +26,7 @@ import DownloadStateIndicator from 'components/molecules/DownloadStateIndicator' import { NavbarToolbar } from 'components/navbar/DefaultNavBar'; import { Link } from 'react-router-dom'; import { BACK } from 'util/useBackTo'; +import { useTranslation } from 'react-i18next'; const initialQueue = { status: 'Stopped', @@ -33,6 +34,8 @@ const initialQueue = { } as IQueue; const DownloadQueue: React.FC = () => { + const { t } = useTranslation(); + const { data: queueState } = useSubscription('/api/v1/downloads'); const { queue, status } = queueState ?? initialQueue; @@ -47,7 +50,7 @@ const DownloadQueue: React.FC = () => { }; useEffect(() => { - setTitle('Download Queue'); + setTitle(t('screens.DownloadQueue.download-queue')); setAction(null); }, []); @@ -55,7 +58,7 @@ const DownloadQueue: React.FC = () => { const onDragEnd = (result: DropResult) => {}; if (queue.length === 0) { - return ; + return ; } const handleDelete = (chapter: IChapter) => {