i18n: Refactor and fix network error

This commit is contained in:
Michal Šmahel committed 2025-06-09 21:54:45 +02:00
1 parent 6460fe33d6
commit c5efa71875
21 files changed
+65 -42

No files matched your search

@@ -1,8 +1,11 @@
import { Typography } from "@mui/material"; import { Typography } from "@mui/material";
import { useTheme } from "@emotion/react"; import { useTheme } from "@emotion/react";
import { useTranslation } from "react-i18next";
const NetworkError = () => { const NetworkError = () => {
const theme = useTheme(); const theme = useTheme();
const { t } = useTranslation();
return ( return (
<> <>
<Typography <Typography
@@ -10,9 +13,9 @@ const NetworkError = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
Network error {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>Please check your connection</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</> </>
); );
}; };
@@ -46,9 +46,9 @@ const InfrastructureDetails = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
@@ -66,9 +66,9 @@ const InfrastructureMonitors = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
+2 -2
View File
@@ -58,9 +58,9 @@ const Maintenance = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
+2 -2
View File
@@ -52,9 +52,9 @@ const PageSpeedDetails = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
@@ -35,9 +35,9 @@ const PageSpeed = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
+2 -2
View File
@@ -208,9 +208,9 @@ const CreateStatusPage = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
+2 -2
View File
@@ -69,9 +69,9 @@ const PublicStatus = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
@@ -32,9 +32,9 @@ const StatusPages = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
+2 -2
View File
@@ -95,9 +95,9 @@ const UptimeDetails = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
+2 -2
View File
@@ -158,9 +158,9 @@ const UptimeMonitors = () => {
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{t("networkError")} {t("common.toasts.networkError")}
</Typography> </Typography>
<Typography>{t("checkConnection")}</Typography> <Typography>{t("common.toasts.checkConnection")}</Typography>
</GenericFallback> </GenericFallback>
); );
} }
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "Přepnout mezi světlým a tmavým motivem" "toggleTheme": "Přepnout mezi světlým a tmavým motivem"
},
"toasts": {
"networkError": "Chyba připojení k síti",
"checkConnection": "Zkontrolujte prosím své připojení k síti"
} }
}, },
"errorPages": { "errorPages": {
@@ -128,7 +132,6 @@
"now": "", "now": "",
"delete": "", "delete": "",
"configure": "", "configure": "",
"networkError": "",
"responseTime": "", "responseTime": "",
"ms": "", "ms": "",
"bar": "", "bar": "",
@@ -136,7 +139,6 @@
"country": "", "country": "",
"city": "", "city": "",
"response": "", "response": "",
"checkConnection": "",
"passwordreset": "", "passwordreset": "",
"authRegisterStepOnePersonalDetails": "", "authRegisterStepOnePersonalDetails": "",
"authCheckEmailOpenEmailButton": "", "authCheckEmailOpenEmailButton": "",
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "" "toggleTheme": ""
},
"toasts": {
"networkError": "",
"checkConnection": ""
} }
}, },
"errorPages": { "errorPages": {
@@ -128,7 +132,6 @@
"now": "", "now": "",
"delete": "", "delete": "",
"configure": "", "configure": "",
"networkError": "",
"responseTime": "", "responseTime": "",
"ms": "", "ms": "",
"bar": "", "bar": "",
@@ -136,7 +139,6 @@
"country": "", "country": "",
"city": "", "city": "",
"response": "", "response": "",
"checkConnection": "",
"passwordreset": "", "passwordreset": "",
"authRegisterStepOnePersonalDetails": "", "authRegisterStepOnePersonalDetails": "",
"authCheckEmailOpenEmailButton": "", "authCheckEmailOpenEmailButton": "",
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "Toggles light & dark" "toggleTheme": "Toggles light & dark"
},
"toasts": {
"networkError": "Network error",
"checkConnection": "Please check your connection"
} }
}, },
"errorPages": { "errorPages": {
@@ -124,7 +128,6 @@
"now": "Now", "now": "Now",
"delete": "Delete", "delete": "Delete",
"configure": "Configure", "configure": "Configure",
"networkError": "Network error",
"responseTime": "Response time", "responseTime": "Response time",
"ms": "ms", "ms": "ms",
"bar": "Bar", "bar": "Bar",
@@ -132,7 +135,6 @@
"country": "COUNTRY", "country": "COUNTRY",
"city": "CITY", "city": "CITY",
"response": "RESPONSE", "response": "RESPONSE",
"checkConnection": "Please check your connection",
"passwordreset": "Password Reset", "passwordreset": "Password Reset",
"authRegisterStepOnePersonalDetails": "Enter your personal details", "authRegisterStepOnePersonalDetails": "Enter your personal details",
"authCheckEmailOpenEmailButton": "Open email app", "authCheckEmailOpenEmailButton": "Open email app",
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "" "toggleTheme": ""
},
"toasts": {
"networkError": "",
"checkConnection": ""
} }
}, },
"errorPages": { "errorPages": {
@@ -128,7 +132,6 @@
"now": "", "now": "",
"delete": "", "delete": "",
"configure": "", "configure": "",
"networkError": "",
"responseTime": "", "responseTime": "",
"ms": "", "ms": "",
"bar": "", "bar": "",
@@ -136,7 +139,6 @@
"country": "", "country": "",
"city": "", "city": "",
"response": "", "response": "",
"checkConnection": "",
"passwordreset": "", "passwordreset": "",
"authRegisterStepOnePersonalDetails": "", "authRegisterStepOnePersonalDetails": "",
"authCheckEmailOpenEmailButton": "", "authCheckEmailOpenEmailButton": "",
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "" "toggleTheme": ""
},
"toasts": {
"networkError": "Verkkovirhe",
"checkConnection": "Tarkista yhteytesi"
} }
}, },
"errorPages": { "errorPages": {
@@ -128,7 +132,6 @@
"now": "Nyt", "now": "Nyt",
"delete": "Poista", "delete": "Poista",
"configure": "Määritä", "configure": "Määritä",
"networkError": "Verkkovirhe",
"responseTime": "Vasteaika", "responseTime": "Vasteaika",
"ms": "ms", "ms": "ms",
"bar": "Palkki", "bar": "Palkki",
@@ -136,7 +139,6 @@
"country": "MAA", "country": "MAA",
"city": "KAUPUNKI", "city": "KAUPUNKI",
"response": "Vastaus", "response": "Vastaus",
"checkConnection": "Tarkista yhteytesi",
"passwordreset": "Salasanan nollaus", "passwordreset": "Salasanan nollaus",
"authRegisterStepOnePersonalDetails": "Syötä henkilökohtaiset tietosi", "authRegisterStepOnePersonalDetails": "Syötä henkilökohtaiset tietosi",
"authCheckEmailOpenEmailButton": "Avaa sähköpostisovellus", "authCheckEmailOpenEmailButton": "Avaa sähköpostisovellus",
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "" "toggleTheme": ""
},
"toasts": {
"networkError": "",
"checkConnection": "Vérifiez votre connexion"
} }
}, },
"errorPages": { "errorPages": {
@@ -128,7 +132,6 @@
"now": "", "now": "",
"delete": "Supprimer", "delete": "Supprimer",
"configure": "", "configure": "",
"networkError": "",
"responseTime": "", "responseTime": "",
"ms": "", "ms": "",
"bar": "", "bar": "",
@@ -136,7 +139,6 @@
"country": "PAYS", "country": "PAYS",
"city": "VILLE", "city": "VILLE",
"response": "", "response": "",
"checkConnection": "Vérifiez votre connexion",
"passwordreset": "", "passwordreset": "",
"authRegisterStepOnePersonalDetails": "Saisissez vos infos", "authRegisterStepOnePersonalDetails": "Saisissez vos infos",
"authCheckEmailOpenEmailButton": "Ouvrir l'appli mail", "authCheckEmailOpenEmailButton": "Ouvrir l'appli mail",
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "" "toggleTheme": ""
},
"toasts": {
"networkError": "Erro de rede",
"checkConnection": "Verifique sua conexão"
} }
}, },
"errorPages": { "errorPages": {
@@ -127,7 +131,6 @@
"now": "Agora", "now": "Agora",
"delete": "Deletar", "delete": "Deletar",
"configure": "Configurar", "configure": "Configurar",
"networkError": "Erro de rede",
"responseTime": "Tempo de resposta", "responseTime": "Tempo de resposta",
"ms": "ms", "ms": "ms",
"bar": "Bar", "bar": "Bar",
@@ -135,7 +138,6 @@
"country": "PAÍS", "country": "PAÍS",
"city": "CIDADE", "city": "CIDADE",
"response": "RESPOSTA", "response": "RESPOSTA",
"checkConnection": "Verifique sua conexão",
"passwordreset": "Redefinição de senha", "passwordreset": "Redefinição de senha",
"authRegisterStepOnePersonalDetails": "Insira seus dados pessoais", "authRegisterStepOnePersonalDetails": "Insira seus dados pessoais",
"authCheckEmailOpenEmailButton": "Abra o aplicativo de e-mail", "authCheckEmailOpenEmailButton": "Abra o aplicativo de e-mail",
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "" "toggleTheme": ""
},
"toasts": {
"networkError": "Ошибка сети",
"checkConnection": "Пожалуйста, проверьте ваше соединение"
} }
}, },
"errorPages": { "errorPages": {
@@ -124,7 +128,6 @@
"now": "Сейчас", "now": "Сейчас",
"delete": "Удалить", "delete": "Удалить",
"configure": "Настроить", "configure": "Настроить",
"networkError": "Ошибка сети",
"responseTime": "Время ответа:", "responseTime": "Время ответа:",
"ms": "мс", "ms": "мс",
"bar": "Bar", "bar": "Bar",
@@ -132,7 +135,6 @@
"country": "СТРАНА", "country": "СТРАНА",
"city": "ГОРОД", "city": "ГОРОД",
"response": "ОТВЕТ", "response": "ОТВЕТ",
"checkConnection": "Пожалуйста, проверьте ваше соединение",
"passwordreset": "Сброс пароля", "passwordreset": "Сброс пароля",
"authRegisterStepOnePersonalDetails": "Введите свои личные данные", "authRegisterStepOnePersonalDetails": "Введите свои личные данные",
"authCheckEmailOpenEmailButton": "Откройте приложение почты", "authCheckEmailOpenEmailButton": "Откройте приложение почты",
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "" "toggleTheme": ""
},
"toasts": {
"networkError": "Ağ hatası",
"checkConnection": "Lütfen bağlantınızı kontrol edin"
} }
}, },
"errorPages": { "errorPages": {
@@ -128,7 +132,6 @@
"now": "Şimdi", "now": "Şimdi",
"delete": "Sil", "delete": "Sil",
"configure": "Yapılandır", "configure": "Yapılandır",
"networkError": "Ağ hatası",
"responseTime": "Yanıt süresi:", "responseTime": "Yanıt süresi:",
"ms": "ms", "ms": "ms",
"bar": "Çubuk", "bar": "Çubuk",
@@ -136,7 +139,6 @@
"country": "ÜLKE", "country": "ÜLKE",
"city": "ŞEHİR", "city": "ŞEHİR",
"response": "YANIT", "response": "YANIT",
"checkConnection": "Lütfen bağlantınızı kontrol edin",
"passwordreset": "Parola Sıfırlama", "passwordreset": "Parola Sıfırlama",
"authRegisterStepOnePersonalDetails": "Kişisel bilgilerinizi girin", "authRegisterStepOnePersonalDetails": "Kişisel bilgilerinizi girin",
"authCheckEmailOpenEmailButton": "Eposta uygulamasını aç", "authCheckEmailOpenEmailButton": "Eposta uygulamasını aç",
+4 -2
View File
@@ -4,6 +4,10 @@
"monitoringAgentName": "Capture", "monitoringAgentName": "Capture",
"buttons": { "buttons": {
"toggleTheme": "" "toggleTheme": ""
},
"toasts": {
"networkError": "",
"checkConnection": ""
} }
}, },
"errorPages": { "errorPages": {
@@ -128,7 +132,6 @@
"now": "", "now": "",
"delete": "", "delete": "",
"configure": "", "configure": "",
"networkError": "",
"responseTime": "", "responseTime": "",
"ms": "", "ms": "",
"bar": "", "bar": "",
@@ -136,7 +139,6 @@
"country": "", "country": "",
"city": "", "city": "",
"response": "", "response": "",
"checkConnection": "",
"passwordreset": "", "passwordreset": "",
"authRegisterStepOnePersonalDetails": "", "authRegisterStepOnePersonalDetails": "",
"authCheckEmailOpenEmailButton": "", "authCheckEmailOpenEmailButton": "",