From 1b8c6167b7a34f72b68815bd21cdd9d0dfa67c0f Mon Sep 17 00:00:00 2001 From: mohadeseh safari Date: Tue, 24 Jun 2025 15:16:24 -0400 Subject: [PATCH] Add localization for status page creation and update messages --- client/src/Pages/StatusPage/Create/index.jsx | 16 +++++++--------- client/src/locales/en.json | 6 +++++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/src/Pages/StatusPage/Create/index.jsx b/client/src/Pages/StatusPage/Create/index.jsx index 9c218d3c4..9d876df45 100644 --- a/client/src/Pages/StatusPage/Create/index.jsx +++ b/client/src/Pages/StatusPage/Create/index.jsx @@ -19,8 +19,6 @@ import { useParams } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { useStatusPageDelete } from "../Status/Hooks/useStatusPageDelete"; //Constants -const TAB_LIST = ["General settings", "Contents"]; - const ERROR_TAB_MAPPING = [ ["companyName", "url", "timezone", "color", "isPublished", "logo"], ["monitors", "showUptimePercentage", "showCharts"], @@ -153,8 +151,8 @@ const handleDelete = async () => { if (success) { createToast({ body: isCreate - ? "Status page created successfully" - : "Status page updated successfully", + ? t("statusPage.createSuccess") + : t("statusPage.updateSuccess"), }); navigate(`/status/uptime/${form.url}`); } @@ -177,7 +175,7 @@ const handleDelete = async () => { // If we get -1, there's an unknown error if (errorTabs[0] === -1) { - createToast({ body: "Unknown error" }); + createToast({ body: t("common.toasts.unknownError") }); return; } @@ -239,9 +237,9 @@ const handleDelete = async () => { {!isCreate && ( @@ -280,7 +278,7 @@ const handleDelete = async () => { removeLogo={removeLogo} tab={tab} setTab={setTab} - TAB_LIST={TAB_LIST} + TAB_LIST={[t("statusPage.generalSettings", "General settings"), t("statusPage.contents", "Contents")]} isCreate={isCreate} />