From 7ea65de66be375917802e85cd9dc99af0c867404 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 15 Jan 2024 00:55:03 +0100 Subject: [PATCH] Internationalize failed img retry text --- src/components/util/SpinnerImage.tsx | 5 ++++- src/i18n/locale/en.json | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/util/SpinnerImage.tsx b/src/components/util/SpinnerImage.tsx index 6d2dc05514..7f7de44f57 100644 --- a/src/components/util/SpinnerImage.tsx +++ b/src/components/util/SpinnerImage.tsx @@ -13,6 +13,7 @@ import { Theme, SxProps, Stack, Button } from '@mui/material'; import BrokenImageIcon from '@mui/icons-material/BrokenImage'; import RefreshIcon from '@mui/icons-material/Refresh'; +import { useTranslation } from 'react-i18next'; interface IProps { src: string; @@ -29,6 +30,8 @@ interface IProps { export function SpinnerImage(props: IProps) { const { src, alt, onImageLoad, imgRef, spinnerStyle, imgStyle } = props; + const { t } = useTranslation(); + const [imgLoadRetryKey, setImgLoadRetryKey] = useState(0); const [isLoading, setIsLoading] = useState(undefined); const [hasError, setHasError] = useState(false); @@ -69,7 +72,7 @@ export function SpinnerImage(props: IProps) { }} size="large" > - Retry + {t('global.button.retry')} )} diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 8295a6893d..a1841d15e0 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -286,6 +286,7 @@ "reset_to_default": "Reset to Default", "restore": "Restore", "resume": "Resume", + "retry": "Retry", "select": "Select", "select_all": "Select all", "set": "Set",