diff --git a/client/src/components/common/HeaderCreate.tsx b/client/src/components/common/HeaderCreate.tsx
index 5af4e8629..ded3ecca1 100644
--- a/client/src/components/common/HeaderCreate.tsx
+++ b/client/src/components/common/HeaderCreate.tsx
@@ -47,7 +47,7 @@ export const HeaderCreate = ({
>
{limitReached
? "Your plan's limit has been reached"
- : label || t("createNew")}
+ : label || t("common.buttons.createNew")}
diff --git a/client/src/components/common/HeaderRange.tsx b/client/src/components/common/HeaderRange.tsx
index 0fd7348b3..220c187ee 100644
--- a/client/src/components/common/HeaderRange.tsx
+++ b/client/src/components/common/HeaderRange.tsx
@@ -3,6 +3,7 @@ import { ButtonGroup, Button } from "@/components/inputs";
import { useTheme } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import useMediaQuery from "@mui/material/useMediaQuery";
+import { useTranslation } from "react-i18next";
export const HeaderRange = ({
range,
setRange,
@@ -14,6 +15,7 @@ export const HeaderRange = ({
loading: boolean;
all?: boolean;
}) => {
+ const { t } = useTranslation();
const theme = useTheme();
const isSmall = useMediaQuery(theme.breakpoints.down("md"));
return (
@@ -45,7 +47,7 @@ export const HeaderRange = ({
: undefined
}
>
- All
+ {t("common.buttons.range.all")}
)}
diff --git a/client/src/components/design-elements/BasePage.tsx b/client/src/components/design-elements/BasePage.tsx
index be5ec1d33..f523ab79f 100644
--- a/client/src/components/design-elements/BasePage.tsx
+++ b/client/src/components/design-elements/BasePage.tsx
@@ -127,9 +127,9 @@ export const MonitorBasePageWithStates: React.FC<
return (
diff --git a/client/src/components/design-elements/StatusBox.tsx b/client/src/components/design-elements/StatusBox.tsx
index d0b1e05f2..0ccea02ce 100644
--- a/client/src/components/design-elements/StatusBox.tsx
+++ b/client/src/components/design-elements/StatusBox.tsx
@@ -41,7 +41,11 @@ const StatusBox = ({
return (
-
+
{label}
@@ -55,23 +59,47 @@ const StatusBox = ({
export const UpStatusBox = ({ n }: { n: number }) => {
const theme = useTheme();
const { t } = useTranslation();
- return ;
+ return (
+
+ );
};
export const DownStatusBox = ({ n }: { n: number }) => {
const theme = useTheme();
const { t } = useTranslation();
- return ;
+ return (
+
+ );
};
export const PausedStatusBox = ({ n }: { n: number }) => {
const theme = useTheme();
const { t } = useTranslation();
- return ;
+ return (
+
+ );
};
export const InitializingStatusBox = ({ n }: { n: number }) => {
const theme = useTheme();
const { t } = useTranslation();
- return ;
+ return (
+
+ );
};
diff --git a/client/src/components/design-elements/Table.tsx b/client/src/components/design-elements/Table.tsx
index 19a63fa79..a59e7dedc 100644
--- a/client/src/components/design-elements/Table.tsx
+++ b/client/src/components/design-elements/Table.tsx
@@ -22,6 +22,7 @@ import {
import TablePagination from "@mui/material/TablePagination";
import type { TablePaginationProps } from "@mui/material/TablePagination";
+import { useTranslation } from "react-i18next";
import { useState, Fragment } from "react";
import { useTheme } from "@mui/material/styles";
import useMediaQuery from "@mui/material/useMediaQuery";
@@ -362,6 +363,7 @@ export const Pagination: React.FC = ({ ...props }) => {
const EmptyView = () => {
const theme = useTheme();
+ const { t } = useTranslation();
return (
{
borderRadius: theme.shape.borderRadius,
}}
>
- No data
+ {t("monitors.common.table.empty")}
);
};
diff --git a/client/src/components/inputs/Dialog.tsx b/client/src/components/inputs/Dialog.tsx
index 662da2e03..287bfa893 100644
--- a/client/src/components/inputs/Dialog.tsx
+++ b/client/src/components/inputs/Dialog.tsx
@@ -5,6 +5,7 @@ import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from "@mui/material/DialogTitle";
import { Button } from "@/components/inputs";
import { typographyLevels } from "@/theme/palette";
+import { useTranslation } from "react-i18next";
export const DialogInput = ({
open,
@@ -25,6 +26,7 @@ export const DialogInput = ({
cancelColor?: "error" | "primary";
loading?: boolean;
}) => {
+ const { t } = useTranslation();
return (
diff --git a/client/src/components/monitors/ChartAvgResponse.tsx b/client/src/components/monitors/ChartAvgResponse.tsx
index 75d2d2caf..f4534ca68 100644
--- a/client/src/components/monitors/ChartAvgResponse.tsx
+++ b/client/src/components/monitors/ChartAvgResponse.tsx
@@ -4,6 +4,7 @@ import Typography from "@mui/material/Typography";
import { Gauge } from "lucide-react";
import { Cell, RadialBarChart, RadialBar, ResponsiveContainer } from "recharts";
+import { useTranslation } from "react-i18next";
import { getResponseTimeColor } from "@/utils/MonitorUtils";
import { useTheme } from "@mui/material/styles";
@@ -14,6 +15,7 @@ export const ChartAvgResponse = ({
avg: number;
max: number;
}) => {
+ const { t } = useTranslation();
const theme = useTheme();
const chartData = [
{ name: "max", value: max - avg, color: "transparent" },
@@ -28,7 +30,10 @@ export const ChartAvgResponse = ({
};
return (
- } title={"Average response time"}>
+ }
+ title={t("common.charts.avgResponseTime.title")}
+ >
- Low
- High
+
+ {t("common.charts.avgResponseTime.lowLabel")}
+
+
+ {t("common.charts.avgResponseTime.highLabel")}
+
- {t("sendTestNotifications")}
+ {t("common.buttons.testNotification")}
)}
}
@@ -84,7 +86,7 @@ export const HeaderControls = ({
navigate(`${path}/${monitor._id}/configure`);
}}
>
- {t("configure")}
+ {t("common.buttons.configure")}
diff --git a/client/src/components/monitors/HeaderFilter.tsx b/client/src/components/monitors/HeaderFilter.tsx
index ca02ba1df..c674fd1a9 100644
--- a/client/src/components/monitors/HeaderFilter.tsx
+++ b/client/src/components/monitors/HeaderFilter.tsx
@@ -5,6 +5,7 @@ import Typography from "@mui/material/Typography";
import { Select, Checkbox, TextInput } from "@/components/inputs";
import { LoadingSpinner } from "@/components/design-elements";
+import { useTranslation } from "react-i18next";
import { useEffect, useState } from "react";
import { useTheme } from "@mui/material/styles";
import type { SelectChangeEvent } from "@mui/material/Select";
@@ -42,6 +43,7 @@ export const HeaderFilter = ({
loading = false,
}: HeaderFilterProps) => {
const theme = useTheme();
+ const { t } = useTranslation();
const [localSearch, setLocalSearch] = useState(searchString);
useEffect(() => {
@@ -68,7 +70,7 @@ export const HeaderFilter = ({
return (
diff --git a/client/src/pages/infrastructure/InfraMonitors.tsx b/client/src/pages/infrastructure/InfraMonitors.tsx
index 661160147..27d71c989 100644
--- a/client/src/pages/infrastructure/InfraMonitors.tsx
+++ b/client/src/pages/infrastructure/InfraMonitors.tsx
@@ -90,8 +90,8 @@ const PageSpeedMonitorsPage = () => {
actionLink="/infrastructure/create"
>
{
/>
),
@@ -179,7 +186,7 @@ export const InfraMonitorsTable = ({
onClick={(e) => handleSort(e, "status")}
sx={{ cursor: "pointer" }}
>
- {t("status")}
+ {t("monitors.common.table.headers.status")}
{renderSortIcon(sortField === "status")}
),
@@ -189,7 +196,7 @@ export const InfraMonitorsTable = ({
},
{
id: "cpu",
- content: t("cpu"),
+ content: t("monitors.common.table.headers.cpu"),
render: (row) => {
const cpuUsage =
(row.latestChecks?.[0]?.system?.cpu?.usage_percent || 0) * 100;
@@ -198,7 +205,7 @@ export const InfraMonitorsTable = ({
},
{
id: "memory",
- content: t("memory"),
+ content: t("monitors.common.table.headers.memory"),
render: (row) => {
const memoryUsage =
(row.latestChecks?.[0]?.system?.memory?.usage_percent || 0) * 100;
@@ -207,7 +214,7 @@ export const InfraMonitorsTable = ({
},
{
id: "disk",
- content: t("disk"),
+ content: t("monitors.common.table.headers.disk"),
render: (row) => {
const totalDiskUsage = row.latestChecks?.[0]?.system?.disk?.reduce(
(acc, disk) => acc + disk.usage_percent,
@@ -221,7 +228,7 @@ export const InfraMonitorsTable = ({
{
id: "actions",
- content: t("actions"),
+ content: t("monitors.common.table.headers.actions"),
render: (row) => {
return ;
},
diff --git a/client/src/pages/pagespeed/PageSpeedForm.tsx b/client/src/pages/pagespeed/PageSpeedForm.tsx
index 16ae0d31e..865c8b65f 100644
--- a/client/src/pages/pagespeed/PageSpeedForm.tsx
+++ b/client/src/pages/pagespeed/PageSpeedForm.tsx
@@ -100,8 +100,8 @@ export const PageSpeedForm = ({
return (
@@ -140,7 +140,7 @@ export const PageSpeedForm = ({
}, 0);
}}
type="text"
- fieldLabel={t("url")}
+ fieldLabel={t("monitors.common.form.optionUrl")}
fullWidth
error={!!errors.url}
helperText={errors.url ? errors.url.message : ""}
@@ -155,7 +155,7 @@ export const PageSpeedForm = ({
- {t("settingsSave")}
+ {t("common.buttons.save")}
diff --git a/client/src/pages/pagespeed/PageSpeedMonitorTable.tsx b/client/src/pages/pagespeed/PageSpeedMonitorTable.tsx
index a6e018538..62302b331 100644
--- a/client/src/pages/pagespeed/PageSpeedMonitorTable.tsx
+++ b/client/src/pages/pagespeed/PageSpeedMonitorTable.tsx
@@ -85,7 +85,7 @@ export const PageSpeedMonitorTable = ({
return [
{
id: 1,
- label: "Open site",
+ label: t("monitors.common.actions.openSite"),
action: () => {
window.open(monitor.url, "_blank", "noreferrer");
},
@@ -93,21 +93,21 @@ export const PageSpeedMonitorTable = ({
},
{
id: 2,
- label: "Details",
+ label: t("monitors.common.actions.details"),
action: () => {
navigate(`${monitor._id}`);
},
},
{
id: 3,
- label: "Incidents",
+ label: t("monitors.common.actions.incidents"),
action: () => {
navigate(`/incidents?monitorId=${monitor._id}`);
},
},
{
id: 4,
- label: "Configure",
+ label: t("monitors.common.actions.configure"),
action: () => {
navigate(`/pagespeed/${monitor._id}/configure`);
},
@@ -116,12 +116,15 @@ export const PageSpeedMonitorTable = ({
// id: 5,
// label: "Clone",
// action: () => {
-
+
// },
// },
{
id: 6,
- label: monitor.status === "paused" ? "Resume" : "Pause",
+ label:
+ monitor.status === "paused"
+ ? t("common.buttons.resume")
+ : t("common.buttons.pause"),
action: async () => {
await patch(`/monitors/${monitor._id}/active`);
refetch();
@@ -130,7 +133,11 @@ export const PageSpeedMonitorTable = ({
},
{
id: 7,
- label: Remove,
+ label: (
+
+ {t("common.buttons.delete")}
+
+ ),
action: () => {
setSelectedMonitor(monitor);
},
@@ -163,7 +170,7 @@ export const PageSpeedMonitorTable = ({
onClick={(e) => handleSort(e, "name")}
sx={{ cursor: "pointer" }}
>
- {t("host")}
+ {t("monitors.common.table.headers.name")}
{renderSortIcon(sortField === "name")}
),
@@ -182,7 +189,7 @@ export const PageSpeedMonitorTable = ({
onClick={(e) => handleSort(e, "status")}
sx={{ cursor: "pointer" }}
>
- {t("status")}
+ {t("monitors.common.table.headers.status")}
{renderSortIcon(sortField === "status")}
),
@@ -192,7 +199,7 @@ export const PageSpeedMonitorTable = ({
},
{
id: "histogram",
- content: "PageSpeed score",
+ content: t("monitors.common.table.headers.pageSpeedScore"),
render: (row) => {
return (
@@ -207,7 +214,7 @@ export const PageSpeedMonitorTable = ({
{
id: "actions",
- content: t("actions"),
+ content: t("monitors.common.table.headers.actions"),
render: (row) => {
return ;
},
diff --git a/client/src/pages/pagespeed/PageSpeedMonitors.tsx b/client/src/pages/pagespeed/PageSpeedMonitors.tsx
index 28f16e7a4..de599d753 100644
--- a/client/src/pages/pagespeed/PageSpeedMonitors.tsx
+++ b/client/src/pages/pagespeed/PageSpeedMonitors.tsx
@@ -19,7 +19,6 @@ import useMediaQuery from "@mui/material/useMediaQuery";
import { useState } from "react";
import { useDelete } from "@/hooks/UseApi";
import { InitializingStatusBox } from "@/components/design-elements/StatusBox";
-import { useAppSelector } from "@/hooks/AppHooks";
import { config } from "@/config/index";
import { useLimitReached } from "@/hooks/UsePlanEntitlements";
@@ -27,7 +26,6 @@ const GLOBAL_REFRESH = config.GLOBAL_REFRESH;
const PageSpeedMonitorsPage = () => {
const theme = useTheme();
- const { user } = useAppSelector((state) => state.auth);
const { t } = useTranslation();
const isSmall = useMediaQuery(theme.breakpoints.down("md"));
@@ -91,8 +89,8 @@ const PageSpeedMonitorsPage = () => {
monitorLimitReached={monitorLimitReached}
>
{
/>
),
@@ -185,7 +193,7 @@ export const MonitorTable = ({
onClick={(e) => handleSort(e, "status")}
sx={{ cursor: "pointer" }}
>
- {t("status")}
+ {t("monitors.common.table.headers.status")}
{renderSortIcon(sortField === "status")}
),
@@ -195,7 +203,7 @@ export const MonitorTable = ({
},
{
id: "histogram",
- content: t("responseTime"),
+ content: t("monitors.common.table.headers.responseTime"),
render: (row) => {
if (chartType === "histogram") {
return ;
@@ -215,7 +223,7 @@ export const MonitorTable = ({
onClick={(e) => handleSort(e, "type")}
sx={{ cursor: "pointer" }}
>
- {t("type")}
+ {t("monitors.common.table.headers.type")}
{renderSortIcon(sortField === "type")}
),
@@ -225,7 +233,7 @@ export const MonitorTable = ({
},
{
id: "actions",
- content: t("actions"),
+ content: t("monitors.common.table.headers.actions"),
render: (row) => {
return ;
},
@@ -234,7 +242,7 @@ export const MonitorTable = ({
return headers;
};
- const headers = getHeaders();
+ const headers = getHeaders(chartType);
return (