mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-15 01:23:12 -07:00
feat: i18n fix
This commit is contained in:
parent
d19bf07382
commit
3d67022b38
12 changed files with 25 additions and 31 deletions
|
@ -50,7 +50,7 @@ function HomeLoggedIn() {
|
|||
<Typography variant="h5">{t("controllerNetworks")}</Typography>
|
||||
{networks[0] && t("controllerAddress")}
|
||||
<Box fontWeight="fontWeightBold">
|
||||
{networks[0] && String(networks[0]["id"]).slice(0, 10)}
|
||||
{networks[0] && networks[0]["id"].slice(0, 10)}
|
||||
</Box>
|
||||
</Grid>
|
||||
<Grid item xs="auto">
|
||||
|
|
|
@ -12,7 +12,6 @@ function LogIn() {
|
|||
<Divider orientation="vertical" />
|
||||
</>
|
||||
)}
|
||||
|
||||
<LogInUser />
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -30,7 +30,7 @@ function AddMember({ nwid, callback }) {
|
|||
|
||||
return (
|
||||
<>
|
||||
<Typography>{t("addMemberMan")}</Typography>
|
||||
<Typography>{t("addMemberManually")}</Typography>
|
||||
<List
|
||||
disablePadding={true}
|
||||
style={{
|
||||
|
|
|
@ -51,7 +51,7 @@ function NetworkSettings({ network, setNetwork }) {
|
|||
<AccordionDetails>
|
||||
<Grid container direction="column" spacing={3}>
|
||||
<Grid item>
|
||||
<Typography>{t("netId")}</Typography>
|
||||
<Typography>{t("networkId")}</Typography>
|
||||
<Typography variant="h5">
|
||||
<span>{network["config"]["id"]}</span>
|
||||
</Typography>
|
||||
|
@ -129,7 +129,7 @@ function NetworkSettings({ network, setNetwork }) {
|
|||
color="primary"
|
||||
onChange={handleChange("config", "enableBroadcast", "checkbox")}
|
||||
/>
|
||||
<span>{t("enaBroadcast")}</span>
|
||||
<span>{t("enableBroadcast")}</span>
|
||||
</Grid>
|
||||
{/* TODO: */}
|
||||
{/* <Grid item>
|
||||
|
|
|
@ -16,7 +16,7 @@ import { parseValue, replaceValue, setValue } from "utils/ChangeHelper";
|
|||
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
function SettingsComponent() {
|
||||
function Settings() {
|
||||
const { t, i18n } = useTranslation();
|
||||
|
||||
const handleChange = () => (event) => {
|
||||
|
@ -40,4 +40,4 @@ function SettingsComponent() {
|
|||
);
|
||||
}
|
||||
|
||||
export default SettingsComponent;
|
||||
export default Settings;
|
1
frontend/src/components/Settings/index.jsx
Normal file
1
frontend/src/components/Settings/index.jsx
Normal file
|
@ -0,0 +1 @@
|
|||
export { default } from "./Settings";
|
|
@ -1 +0,0 @@
|
|||
export { default } from "./SettingsComponent";
|
|
@ -11,14 +11,12 @@ i18n
|
|||
.use(Backend)
|
||||
.init({
|
||||
compatibilityJSON: "v4",
|
||||
//lng: "en",
|
||||
fallbackLng: "en",
|
||||
detection: {
|
||||
order: ["path", "cookie", "localStorage", "htmlTag"],
|
||||
caches: ["localStorage", "cookie"], // cache user language on
|
||||
caches: ["localStorage", "cookie"],
|
||||
},
|
||||
debug: true,
|
||||
//keySeparator: false, // we use content as keys
|
||||
interpolation: {
|
||||
escapeValue: true,
|
||||
},
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { Grid, Link, Typography } from "@material-ui/core";
|
||||
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
|
||||
import SettingsComponent from "components/SettingsComponent";
|
||||
import SettingsComponent from "components/Settings";
|
||||
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Link as RouterLink, useHistory, useParams } from "react-router-dom";
|
||||
import { Link as RouterLink } from "react-router-dom";
|
||||
import { useLocalStorage } from "react-use";
|
||||
import API from "utils/API";
|
||||
|
||||
import useStyles from "./Settings.styles";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
@ -13,10 +12,8 @@ import { useTranslation } from "react-i18next";
|
|||
function Settings() {
|
||||
const { t, i18n } = useTranslation();
|
||||
const [loggedIn] = useLocalStorage("loggedIn", false);
|
||||
const [network, setNetwork] = useState({});
|
||||
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
|
||||
if (loggedIn) {
|
||||
return (
|
||||
|
@ -45,9 +42,7 @@ function Settings() {
|
|||
}}
|
||||
>
|
||||
<Grid item xs={10}>
|
||||
<Typography variant="h5">
|
||||
You are not authorized. Please Log In
|
||||
</Typography>
|
||||
<Typography variant="h5">{t("notAuthorized")}</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue