From 449a75eb2cc6be271d8908b96801c0cf2a68e7ce Mon Sep 17 00:00:00 2001 From: mohadeseh safari Date: Fri, 9 May 2025 15:34:55 -0400 Subject: [PATCH] - Added translations for Status filter options (Up/Down) using monitorStatus keys - Added translations for State filter options (Active/Paused) using monitorState keys --- .../Monitors/Components/Filter/index.jsx | 24 +++++++++++-------- client/src/locales/gb.json | 3 ++- client/src/locales/ru.json | 3 ++- client/src/locales/tr.json | 3 ++- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/client/src/Pages/Uptime/Monitors/Components/Filter/index.jsx b/client/src/Pages/Uptime/Monitors/Components/Filter/index.jsx index cf55ce3aa..7d9f5a6bf 100644 --- a/client/src/Pages/Uptime/Monitors/Components/Filter/index.jsx +++ b/client/src/Pages/Uptime/Monitors/Components/Filter/index.jsx @@ -27,22 +27,14 @@ import { useTranslation } from "react-i18next"; * @returns {JSX.Element} The rendered Filter component. */ -const typeOptions = [ +const getTypeOptions = () => [ { value: "http", label: "HTTP(S)" }, { value: "ping", label: "Ping" }, { value: "docker", label: "Docker" }, { value: "port", label: "Port" }, ]; -const statusOptions = [ - { value: "Up", label: "Up" }, - { value: "Down", label: "Down" }, -]; - -const stateOptions = [ - { value: "Active", label: "Active" }, - { value: "Paused", label: "Paused" }, -]; +// These functions were moved inline to ensure translations are applied correctly const Filter = ({ selectedTypes, @@ -58,6 +50,18 @@ const Filter = ({ const theme = useTheme(); const { t } = useTranslation(); + const typeOptions = getTypeOptions(); + // Create status options with translations + const statusOptions = [ + { value: "Up", label: t("monitorStatus.up") }, + { value: "Down", label: t("monitorStatus.down") }, + ]; + // Create state options with translations + const stateOptions = [ + { value: "Active", label: t("monitorState.active") }, + { value: "Paused", label: t("monitorState.paused") }, + ]; + const handleTypeChange = (event) => { const selectedValues = event.target.value; setSelectedTypes(selectedValues.length > 0 ? selectedValues : undefined); diff --git a/client/src/locales/gb.json b/client/src/locales/gb.json index 4464ff01f..9eff52fe9 100644 --- a/client/src/locales/gb.json +++ b/client/src/locales/gb.json @@ -459,7 +459,8 @@ }, "monitorState": { "paused": "paused", - "resumed": "resumed" + "resumed": "resumed", + "active": "active" }, "menu": { "uptime": "Uptime", diff --git a/client/src/locales/ru.json b/client/src/locales/ru.json index 3be8de937..a0969cc53 100644 --- a/client/src/locales/ru.json +++ b/client/src/locales/ru.json @@ -424,7 +424,8 @@ }, "monitorState": { "paused": "приостановлен", - "resumed": "возобновлен" + "resumed": "возобновлен", + "active": "активный" }, "menu": { "uptime": "Аптайм", diff --git a/client/src/locales/tr.json b/client/src/locales/tr.json index c36351669..76dceb2fb 100644 --- a/client/src/locales/tr.json +++ b/client/src/locales/tr.json @@ -447,7 +447,8 @@ }, "monitorState": { "paused": "duraklatıldı", - "resumed": "devam ettirildi" + "resumed": "devam ettirildi", + "active": "aktif" }, "menu": { "uptime": "Çalışma Süresi",