Merge pull request #2255 from bluewave-labs/Fix-untranslated-strings
Fix untranslated strings
This commit is contained in:
9 files changed
+127
-58
No files matched your search
@@ -8,6 +8,7 @@ import TabContext from "@mui/lab/TabContext";
|
||||
import ProfilePanel from "../../Components/TabPanels/Account/ProfilePanel";
|
||||
import PasswordPanel from "../../Components/TabPanels/Account/PasswordPanel";
|
||||
import TeamPanel from "../../Components/TabPanels/Account/TeamPanel";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import "./index.css";
|
||||
|
||||
/**
|
||||
@@ -24,24 +25,34 @@ const Account = ({ open = "profile" }) => {
|
||||
navigate(`/account/${newTab}`);
|
||||
};
|
||||
const { user } = useSelector((state) => state.auth);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const requiredRoles = ["superadmin", "admin"];
|
||||
let tabList = ["Profile", "Password", "Team"];
|
||||
let tabList = [
|
||||
{ name: t("menu.profile"), value: "profile" },
|
||||
{ name: t("menu.password"), value: "password" },
|
||||
{ name: t("menu.team"), value: "team" }
|
||||
];
|
||||
const hideTeams = !requiredRoles.some((role) => user.role.includes(role));
|
||||
if (hideTeams) {
|
||||
tabList = ["Profile", "Password"];
|
||||
tabList = [
|
||||
{ name: t("menu.profile"), value: "profile" },
|
||||
{ name: t("menu.password"), value: "password" }
|
||||
];
|
||||
}
|
||||
|
||||
// Remove password for demo
|
||||
if (user.role.includes("demo")) {
|
||||
tabList = ["Profile"];
|
||||
tabList = [
|
||||
{ name: t("menu.profile"), value: "profile" }
|
||||
];
|
||||
}
|
||||
|
||||
const handleKeyDown = (event) => {
|
||||
const currentIndex = tabList.findIndex((label) => label.toLowerCase() === tab);
|
||||
const currentIndex = tabList.findIndex((item) => item.value === tab);
|
||||
if (event.key === "Tab") {
|
||||
const nextIndex = (currentIndex + 1) % tabList.length;
|
||||
setFocusedTab(tabList[nextIndex].toLowerCase());
|
||||
setFocusedTab(tabList[nextIndex].value);
|
||||
} else if (event.key === "Enter") {
|
||||
event.preventDefault();
|
||||
navigate(`/account/${focusedTab}`);
|
||||
@@ -60,13 +71,13 @@ const Account = ({ open = "profile" }) => {
|
||||
>
|
||||
<TabContext value={tab}>
|
||||
<CustomTabList value={tab} onChange={handleTabChange} aria-label="account tabs">
|
||||
{tabList.map((label, index) => (
|
||||
{tabList.map((item, index) => (
|
||||
<Tab
|
||||
label={label}
|
||||
label={item.name}
|
||||
key={index}
|
||||
value={label.toLowerCase()}
|
||||
value={item.value}
|
||||
onKeyDown={handleKeyDown}
|
||||
onFocus={() => handleFocus(label.toLowerCase())}
|
||||
onFocus={() => handleFocus(item.value)}
|
||||
tabIndex={index}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -166,7 +166,7 @@ const ForgotPassword = () => {
|
||||
</IconBox>
|
||||
</Stack>
|
||||
<Typography component="h1">{t("authForgotPasswordTitle")}</Typography>
|
||||
<Typography>No worries, we'll send you reset instructions.</Typography>
|
||||
<Typography>{t("authForgotPasswordInstructions")}</Typography>
|
||||
</Box>
|
||||
<Box
|
||||
component="form"
|
||||
@@ -179,9 +179,9 @@ const ForgotPassword = () => {
|
||||
<TextInput
|
||||
type="email"
|
||||
id="forgot-password-email-input"
|
||||
label="Email"
|
||||
label={t("email")}
|
||||
isRequired={true}
|
||||
placeholder="Enter your email"
|
||||
placeholder={t("enterEmail")}
|
||||
value={form.email}
|
||||
onChange={handleChange}
|
||||
error={errors.email ? true : false}
|
||||
|
||||
@@ -11,12 +11,15 @@ import { useState } from "react";
|
||||
import IncidentTable from "./Components/IncidentTable";
|
||||
import GenericFallback from "../../Components/GenericFallback";
|
||||
import NetworkError from "../../Components/GenericFallback/NetworkError";
|
||||
import { useTranslation } from "react-i18next";
|
||||
//Constants
|
||||
const BREADCRUMBS = [{ name: `Incidents`, path: "/incidents" }];
|
||||
|
||||
const Incidents = () => {
|
||||
// Redux state
|
||||
const { user } = useSelector((state) => state.auth);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const BREADCRUMBS = [{ name: t("incidentsPageTitle", "Incidents"), path: "/incidents" }];
|
||||
|
||||
// Local state
|
||||
const [selectedMonitor, setSelectedMonitor] = useState("0");
|
||||
|
||||
Reference in new issue
Block a user