From 847c7630ec57d04ade7f0789f0113c590d6c3820 Mon Sep 17 00:00:00 2001 From: Br0wnHammer Date: Fri, 4 Jul 2025 22:24:59 +0530 Subject: [PATCH] Strings localizations --- client/src/Hooks/checkHooks.js | 7 +++++-- client/src/locales/en.json | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/src/Hooks/checkHooks.js b/client/src/Hooks/checkHooks.js index 924c24a27..f23e1eaea 100644 --- a/client/src/Hooks/checkHooks.js +++ b/client/src/Hooks/checkHooks.js @@ -1,6 +1,7 @@ import { useState, useEffect } from "react"; import { networkService } from "../main"; import { createToast } from "../Utils/toastUtils"; +import { useTranslation } from "react-i18next"; const useFetchChecksTeam = ({ status, @@ -164,6 +165,7 @@ const useFetchChecksSummaryByTeamId = ({ updateTrigger } = {}) => { const useResolveIncident = () => { const [isLoading, setIsLoading] = useState(false); + const { t } = useTranslation(); const resolveIncident = async (checkId, setUpdateTrigger) => { try { @@ -174,7 +176,7 @@ const useResolveIncident = () => { }); setUpdateTrigger((prev) => !prev); } catch (error) { - createToast({ body: "Failed to resolve incident." }); + createToast({ body: t("checkHooks.failureResolveOne") }); } finally { setIsLoading(false); } @@ -185,6 +187,7 @@ const useResolveIncident = () => { const useAckAllChecks = () => { const [isLoading, setIsLoading] = useState(false); + const { t } = useTranslation(); const ackAllChecks = async (setUpdateTrigger) => { try { @@ -192,7 +195,7 @@ const useAckAllChecks = () => { await networkService.updateAllChecksStatus({ ack: true }); setUpdateTrigger((prev) => !prev); } catch (error) { - createToast({ body: "Failed to resolve all incidents." }); + createToast({ body: t("checkHooks.failureResolveAll") }); } finally { setIsLoading(false); } diff --git a/client/src/locales/en.json b/client/src/locales/en.json index a0cf282b9..331bfe1ad 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -516,6 +516,10 @@ "monitorStatusUp": "Monitor {name} ({url}) is now UP and responding", "monitors": "monitors", "monitorsToApply": "Monitors to apply maintenance window to", + "checkHooks": { + "failureResolveOne": "Failed to resolve incident.", + "failureResolveAll": "Failed to resolve all incidents." + }, "ms": "ms", "navControls": "Controls", "nextWindow": "Next window",