From 85d91c64b5b3ec31df8acecd68a1fa6a68d57ff9 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Wed, 30 Mar 2022 21:47:45 +0200 Subject: feat(renderer): Renderer translations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add react-i18n to make us able to use i18next translations in the renderer process just like we do in the main process. Translations are hot-reloaded automatically. Signed-off-by: Kristóf Marussy --- packages/renderer/src/components/locationBar/ExtraButtons.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/renderer/src/components/locationBar/ExtraButtons.tsx') diff --git a/packages/renderer/src/components/locationBar/ExtraButtons.tsx b/packages/renderer/src/components/locationBar/ExtraButtons.tsx index 4eaee29..1755495 100644 --- a/packages/renderer/src/components/locationBar/ExtraButtons.tsx +++ b/packages/renderer/src/components/locationBar/ExtraButtons.tsx @@ -23,6 +23,7 @@ import Box from '@mui/material/Box'; import IconButton from '@mui/material/IconButton'; import { observer } from 'mobx-react-lite'; import React from 'react'; +import { useTranslation } from 'react-i18next'; import type Service from '../../stores/Service'; @@ -31,6 +32,10 @@ function ExtraButtons({ }: { service: Service | undefined; }): JSX.Element { + const { t } = useTranslation(undefined, { + keyPrefix: 'toolbar', + }); + return ( service?.openCurrentURLInExternalBrowser()} > -- cgit v1.2.3-54-g00ecf