Add localization for status page creation and update messages
This commit is contained in:
1 parent
e371596d15
commit
1b8c6167b7
2 files changed
+12
-10
No files matched your search
@@ -19,8 +19,6 @@ import { useParams } from "react-router-dom";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useStatusPageDelete } from "../Status/Hooks/useStatusPageDelete";
|
import { useStatusPageDelete } from "../Status/Hooks/useStatusPageDelete";
|
||||||
//Constants
|
//Constants
|
||||||
const TAB_LIST = ["General settings", "Contents"];
|
|
||||||
|
|
||||||
const ERROR_TAB_MAPPING = [
|
const ERROR_TAB_MAPPING = [
|
||||||
["companyName", "url", "timezone", "color", "isPublished", "logo"],
|
["companyName", "url", "timezone", "color", "isPublished", "logo"],
|
||||||
["monitors", "showUptimePercentage", "showCharts"],
|
["monitors", "showUptimePercentage", "showCharts"],
|
||||||
@@ -153,8 +151,8 @@ const handleDelete = async () => {
|
|||||||
if (success) {
|
if (success) {
|
||||||
createToast({
|
createToast({
|
||||||
body: isCreate
|
body: isCreate
|
||||||
? "Status page created successfully"
|
? t("statusPage.createSuccess")
|
||||||
: "Status page updated successfully",
|
: t("statusPage.updateSuccess"),
|
||||||
});
|
});
|
||||||
navigate(`/status/uptime/${form.url}`);
|
navigate(`/status/uptime/${form.url}`);
|
||||||
}
|
}
|
||||||
@@ -177,7 +175,7 @@ const handleDelete = async () => {
|
|||||||
|
|
||||||
// If we get -1, there's an unknown error
|
// If we get -1, there's an unknown error
|
||||||
if (errorTabs[0] === -1) {
|
if (errorTabs[0] === -1) {
|
||||||
createToast({ body: "Unknown error" });
|
createToast({ body: t("common.toasts.unknownError") });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,9 +237,9 @@ const handleDelete = async () => {
|
|||||||
<Stack gap={theme.spacing(10)}>
|
<Stack gap={theme.spacing(10)}>
|
||||||
<Breadcrumbs
|
<Breadcrumbs
|
||||||
list={[
|
list={[
|
||||||
{ name: "status", path: "/status" },
|
{ name: t("statusBreadCrumbsStatusPages", "Status"), path: "/status" },
|
||||||
{ name: "details", path: `/status/${url}` },
|
{ name: t("statusBreadCrumbsDetails", "Details"), path: `/status/${url}` },
|
||||||
{ name: "configure", path: `/status/create/${url}` },
|
{ name: t("configure", "Configure"), path: `/status/create/${url}` },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
{!isCreate && (
|
{!isCreate && (
|
||||||
@@ -280,7 +278,7 @@ const handleDelete = async () => {
|
|||||||
removeLogo={removeLogo}
|
removeLogo={removeLogo}
|
||||||
tab={tab}
|
tab={tab}
|
||||||
setTab={setTab}
|
setTab={setTab}
|
||||||
TAB_LIST={TAB_LIST}
|
TAB_LIST={[t("statusPage.generalSettings", "General settings"), t("statusPage.contents", "Contents")]}
|
||||||
isCreate={isCreate}
|
isCreate={isCreate}
|
||||||
/>
|
/>
|
||||||
<Stack
|
<Stack
|
||||||
|
|||||||
@@ -277,7 +277,11 @@
|
|||||||
"statusPageName": "Status page name",
|
"statusPageName": "Status page name",
|
||||||
"statusPage": {
|
"statusPage": {
|
||||||
"deleteSuccess": "Status page deleted successfully",
|
"deleteSuccess": "Status page deleted successfully",
|
||||||
"deleteFailed": "Failed to delete status page"
|
"deleteFailed": "Failed to delete status page",
|
||||||
|
"createSuccess": "Status page created successfully",
|
||||||
|
"updateSuccess": "Status page updated successfully",
|
||||||
|
"generalSettings": "General settings",
|
||||||
|
"contents": "Contents"
|
||||||
},
|
},
|
||||||
"publicURL": "Public URL",
|
"publicURL": "Public URL",
|
||||||
"repeat": "Repeat",
|
"repeat": "Repeat",
|
||||||
|
|||||||
Reference in new issue
Block a user