diff --git a/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx b/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx
index 76440f02d..87a870d09 100644
--- a/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx
+++ b/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx
@@ -10,6 +10,7 @@ import PropTypes from "prop-types";
import Dialog from "../../../../../Components/Dialog";
import { networkService } from "../../../../../Utils/NetworkService.js";
import { usePauseMonitor } from "../../../../../Hooks/monitorHooks";
+import { useTranslation } from "react-i18next";
/**
* InfrastructureMenu Component
@@ -31,6 +32,7 @@ const InfrastructureMenu = ({ monitor, isAdmin, updateCallback }) => {
const [isDialogOpen, setIsDialogOpen] = useState(false);
const theme = useTheme();
const [pauseMonitor] = usePauseMonitor();
+ const { t } = useTranslation();
const openMenu = (e) => {
e.stopPropagation();
@@ -64,12 +66,16 @@ const InfrastructureMenu = ({ monitor, isAdmin, updateCallback }) => {
try {
await pauseMonitor({ monitorId: monitor.id });
createToast({
- body: `Monitor ${monitor.isActive ? "paused" : "resumed"} successfully.`,
+ body: t("monitorActions.pauseResumeSuccess", "Monitor {{action}} successfully", {
+ action: monitor.isActive ? t("monitorActions.paused", "paused") : t("monitorActions.resumed", "resumed")
+ }),
});
updateCallback();
} catch (error) {
createToast({
- body: `Failed to ${monitor.isActive ? "pause" : "resume"} monitor.`,
+ body: t("monitorActions.pauseResumeFailed", "Failed to {{action}} monitor", {
+ action: monitor.isActive ? t("pause", "pause") : t("resume", "resume")
+ }),
});
}
};
@@ -79,9 +85,9 @@ const InfrastructureMenu = ({ monitor, isAdmin, updateCallback }) => {
await networkService.deleteMonitorById({
monitorId: monitor.id,
});
- createToast({ body: "Monitor deleted successfully." });
+ createToast({ body: t("monitorActions.deleteSuccess", "Monitor deleted successfully") });
} catch (error) {
- createToast({ body: "Failed to delete monitor." });
+ createToast({ body: t("monitorActions.deleteFailed", "Failed to delete monitor") });
} finally {
setIsDialogOpen(false);
updateCallback();
@@ -125,13 +131,13 @@ const InfrastructureMenu = ({ monitor, isAdmin, updateCallback }) => {
},
}}
>
-
+
{isAdmin && (
-
+
)}
{isAdmin && (
)}
{isAdmin && (
@@ -139,17 +145,17 @@ const InfrastructureMenu = ({ monitor, isAdmin, updateCallback }) => {
onClick={openRemove}
sx={{ color: theme.palette.error.main }}
>
- Remove
+ {t("remove", "Remove")}
)}