From aea6ac2bf6f8f474568bdfdd085ae427957be749 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sat, 5 Jun 2021 17:32:26 +0300 Subject: [PATCH] simplify i18n --- web/src/App/Sidebar.jsx | 2 +- web/src/components/About.jsx | 2 +- web/src/components/Add/index.jsx | 2 +- web/src/components/Donate/DonateDialog.jsx | 2 +- web/src/components/RemoveAll.jsx | 2 +- web/src/components/Settings.jsx | 2 +- web/src/components/TorrentCard/index.jsx | 2 +- web/src/components/Upload.jsx | 2 +- web/src/index.jsx | 42 +++++++++++----------- 9 files changed, 28 insertions(+), 30 deletions(-) diff --git a/web/src/App/Sidebar.jsx b/web/src/App/Sidebar.jsx index 1d792e0..577539b 100644 --- a/web/src/App/Sidebar.jsx +++ b/web/src/App/Sidebar.jsx @@ -20,7 +20,7 @@ import { AppSidebarStyle } from './style' export default function Sidebar({ isDrawerOpen, setIsDonationDialogOpen }) { // eslint-disable-next-line no-unused-vars - const { t, i18n } = useTranslation('translations') + const { t } = useTranslation() return ( diff --git a/web/src/components/About.jsx b/web/src/components/About.jsx index cfc5894..d4535a9 100644 --- a/web/src/components/About.jsx +++ b/web/src/components/About.jsx @@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next' export default function AboutDialog() { const [open, setOpen] = useState(false) // eslint-disable-next-line no-unused-vars - const { t, i18n } = useTranslation('translations') + const { t } = useTranslation() return (
setOpen(true)}> diff --git a/web/src/components/Add/index.jsx b/web/src/components/Add/index.jsx index 7e27629..e3f5eaa 100644 --- a/web/src/components/Add/index.jsx +++ b/web/src/components/Add/index.jsx @@ -12,7 +12,7 @@ export default function AddDialogButton() { const handleClickOpen = () => setIsDialogOpen(true) const handleClose = () => setIsDialogOpen(false) // eslint-disable-next-line no-unused-vars - const { t, i18n } = useTranslation('translations') + const { t } = useTranslation() return (
diff --git a/web/src/components/Donate/DonateDialog.jsx b/web/src/components/Donate/DonateDialog.jsx index 5d0a113..d5cf2c9 100644 --- a/web/src/components/Donate/DonateDialog.jsx +++ b/web/src/components/Donate/DonateDialog.jsx @@ -13,7 +13,7 @@ const donateFrame = export default function DonateDialog({ onClose }) { // eslint-disable-next-line no-unused-vars - const { t, i18n } = useTranslation('translations') + const { t } = useTranslation() return ( {t('Donate')} diff --git a/web/src/components/RemoveAll.jsx b/web/src/components/RemoveAll.jsx index 53705fe..08a0445 100644 --- a/web/src/components/RemoveAll.jsx +++ b/web/src/components/RemoveAll.jsx @@ -36,7 +36,7 @@ export default function RemoveAll() { const closeDialog = () => setOpen(false) const openDialog = () => setOpen(true) // eslint-disable-next-line no-unused-vars - const { t, i18n } = useTranslation('translations') + const { t } = useTranslation() return ( <> diff --git a/web/src/components/Settings.jsx b/web/src/components/Settings.jsx index c6af72e..b6a84a0 100644 --- a/web/src/components/Settings.jsx +++ b/web/src/components/Settings.jsx @@ -29,7 +29,7 @@ export default function SettingsDialog() { axios.post(settingsHost(), { action: 'set', sets }) } // eslint-disable-next-line no-unused-vars - const { t, i18n } = useTranslation('translations') + const { t } = useTranslation() useEffect(() => { axios diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index 0580d88..67b88ac 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -18,7 +18,7 @@ const Transition = forwardRef((props, ref) =>