Feat: Migrate Hardcoded Strings

This commit is contained in:
Br0wnHammer committed 2025-03-17 01:16:42 +05:30
1 parent b6113a176f
commit cdbabeb225
30 files changed
+334 -187

No files matched your search

@@ -4,9 +4,11 @@ import { Box, Typography } from "@mui/material";
// Utils
import { useTheme } from "@mui/material/styles";
import { useNavigate } from "react-router-dom";
import { useTranslation } from "react-i18next";
const AdminLink = () => {
const theme = useTheme();
const { t } = useTranslation();
const navigate = useNavigate();
return (
@@ -16,7 +18,7 @@ const AdminLink = () => {
display="inline-block"
color={theme.palette.primary.contrastText}
>
Administrator?
{t("administrator")}
</Typography>
<Typography
component="span"
@@ -25,7 +27,7 @@ const AdminLink = () => {
sx={{ cursor: "pointer" }}
onClick={() => navigate("/login")}
>
Login here
{t("loginHere")}
</Typography>
</Box>
);
@@ -8,9 +8,11 @@ import { useTheme } from "@mui/material/styles";
import { useNavigate } from "react-router-dom";
import { useLocation } from "react-router-dom";
import PropTypes from "prop-types";
import { useTranslation } from "react-i18next";
const Controls = ({ isDeleteOpen, setIsDeleteOpen, isDeleting, url, type }) => {
const theme = useTheme();
const { t } = useTranslation();
const location = useLocation();
const currentPath = location.pathname;
const navigate = useNavigate();
@@ -35,7 +37,7 @@ const Controls = ({ isDeleteOpen, setIsDeleteOpen, isDeleting, url, type }) => {
onClick={() => setIsDeleteOpen(!isDeleteOpen)}
loading={isDeleting}
>
Delete
{t("delete")}
</Button>
</Box>
<Box>
@@ -59,7 +61,7 @@ const Controls = ({ isDeleteOpen, setIsDeleteOpen, isDeleting, url, type }) => {
},
}}
>
<SettingsIcon /> Configure
<SettingsIcon /> {t("configure")}
</Button>
</Box>
</Stack>
+14 -12
View File
@@ -17,6 +17,7 @@ import { useStatusPageDelete } from "./Hooks/useStatusPageDelete";
import { useState } from "react";
import { useParams } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { useTranslation } from "react-i18next";
const PublicStatus = () => {
const { url } = useParams();
@@ -24,6 +25,7 @@ const PublicStatus = () => {
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
// Utils
const theme = useTheme();
const { t } = useTranslation();
const location = useLocation();
const navigate = useNavigate();
@@ -59,9 +61,9 @@ const PublicStatus = () => {
marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary}
>
Network error
{t("networkError")}
</Typography>
<Typography>Please check your connection</Typography>
<Typography>{t("checkConnection")}</Typography>
</GenericFallback>
);
}
@@ -76,9 +78,9 @@ const PublicStatus = () => {
marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary}
>
A public status page is not set up.
{t("statusPageStatus")}
</Typography>
<Typography>Please contact to your administrator</Typography>
<Typography>{t("statusPageStatusContactAdmin")}</Typography>
</GenericFallback>
</Stack>
);
@@ -94,9 +96,9 @@ const PublicStatus = () => {
marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary}
>
This status page is not public.
{t("statusPageStatusNotPublic")}
</Typography>
<Typography>Please contact to your administrator</Typography>
<Typography>{t("statusPageStatusContactAdmin")}</Typography>
</GenericFallback>
</Stack>
);
@@ -111,9 +113,9 @@ const PublicStatus = () => {
marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary}
>
There's no status page here.
{t("statusPageStatusNoPage")}
</Typography>
<Typography>Please contact to your administrator</Typography>
<Typography>{t("statusPageStatusContactAdmin")}</Typography>
</GenericFallback>
);
}
@@ -131,12 +133,12 @@ const PublicStatus = () => {
setIsDeleteOpen={setIsDeleteOpen}
url={url}
/>
<Typography variant="h2">Service status</Typography>
<Typography variant="h2">{t("statusPageStatusServiceStatus")}</Typography>
<StatusBar monitors={monitors} />
<MonitorsList monitors={monitors} />
{link}
<Dialog
title="Do you want to delete this status page?"
title={t("deleteStatusPage")}
onConfirm={() => {
deleteStatusPage();
setIsDeleteOpen(false);
@@ -146,8 +148,8 @@ const PublicStatus = () => {
setIsDeleteOpen(false);
}}
open={isDeleteOpen}
confirmationButtonLabel="Yes, delete status page"
description="Once deleted, your status page cannot be retrieved."
confirmationButtonLabel={t("deleteStatusPageConfirm")}
description={t("deleteStatusPageDescription")}
isLoading={isDeleting || isLoading}
/>
</Stack>