From 17dcdfcb06af56c6046b0ddb213a5405bb2a9b82 Mon Sep 17 00:00:00 2001 From: Owaise Imdad Date: Mon, 19 May 2025 23:25:36 +0530 Subject: [PATCH] Added all the strings in locale file for gb. --- client/src/Hooks/useSendTestEmail.js | 8 +++++--- client/src/locales/gb.json | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/src/Hooks/useSendTestEmail.js b/client/src/Hooks/useSendTestEmail.js index 88fc58f19..ca6cfcf9e 100644 --- a/client/src/Hooks/useSendTestEmail.js +++ b/client/src/Hooks/useSendTestEmail.js @@ -2,11 +2,13 @@ import { useState } from "react"; import { networkService } from "../main"; import { useSelector } from "react-redux"; import { createToast } from "../Utils/toastUtils"; +import { useTranslation } from "react-i18next"; const useSendTestEmail = () => { const [isSending, setIsSending] = useState(false); const [error, setError] = useState(null); const user = useSelector((state) => state.auth.user); + const { t } = useTranslation(); const sendTestEmail = async () => { try { @@ -16,14 +18,14 @@ const useSendTestEmail = () => { const response = await networkService.sendTestEmail({ to: user.email }); if (typeof response?.data?.data?.messageId !== "undefined") { createToast({ - body: "Test email sent successfully", + body: t("emailSent"), }); } else { - throw new Error("Failed to send test email"); + throw new Error(t("failedToSendEmail")); } } catch (error) { createToast({ - body: "Failed to send test email", + body: t("failedToSendEmail"), }); setError(error); } finally { diff --git a/client/src/locales/gb.json b/client/src/locales/gb.json index b746f8ea3..c371a0dd4 100644 --- a/client/src/locales/gb.json +++ b/client/src/locales/gb.json @@ -537,5 +537,7 @@ "saving": "Saving..." }, "uptimeCreateSelectURL": "Enter the URL or IP to monitor (e.g., https://example.com/ or 192.168.1.100) and add a clear display name that appears on the dashboard.", - "sendTestEmail": "Send test email" + "sendTestEmail": "Send test email", + "emailSent": "Email sent successfully", + "failedToSendEmail": "Failed to send email" }