mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-05 20:41:43 -07:00
feat: i18n
This commit is contained in:
parent
2cf3a64cc8
commit
ee73374c29
8 changed files with 30 additions and 17 deletions
|
@ -58,5 +58,10 @@
|
||||||
"logInFailed": "Invalid username or password",
|
"logInFailed": "Invalid username or password",
|
||||||
"tooManyAttempts": "Too many login attempts, please try again in 15 minutes.",
|
"tooManyAttempts": "Too many login attempts, please try again in 15 minutes.",
|
||||||
"language": "Language",
|
"language": "Language",
|
||||||
"notAuthorized": "You are not authorized. Please Log In."
|
"notAuthorized": "You are not authorized. Please Log In.",
|
||||||
|
"saveChanges": "Save changes",
|
||||||
|
"optional": "Optional",
|
||||||
|
"destination": "Destination",
|
||||||
|
"username": "Username",
|
||||||
|
"password": "Password"
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,12 +51,17 @@
|
||||||
"start": "Inicio",
|
"start": "Inicio",
|
||||||
"end": "Final",
|
"end": "Final",
|
||||||
"autoAssignPool": "Rango de IPv4 autoasignables",
|
"autoAssignPool": "Rango de IPv4 autoasignables",
|
||||||
"ipv4AutoAssign": "IPv4 Auto-Assign",
|
"ipv4AutoAssign": "Rangos de IPv4 automáticos",
|
||||||
"addIPv4Pool": "Añadir rango IPv4",
|
"addIPv4Pool": "Añadir rango IPv4",
|
||||||
"multicastLimit": "Límite de destinatarios multicast",
|
"multicastLimit": "Límite de destinatarios multicast",
|
||||||
"enableBroadcast": "Habilitar broadcast",
|
"enableBroadcast": "Habilitar broadcast",
|
||||||
"logInFailed": "Nombre de usuario o contraseña incorrecto",
|
"logInFailed": "Nombre de usuario o contraseña incorrecto",
|
||||||
"tooManyAttempts": "Demasiados intentos de inicio de sesión. Vuelvee a intentarlo en 15 minutos",
|
"tooManyAttempts": "Demasiados intentos de inicio de sesión. Vuelvee a intentarlo en 15 minutos",
|
||||||
"language": "Idioma",
|
"language": "Idioma",
|
||||||
"notAuthorized": "No estás autorizado. Por favor, inicia sesión."
|
"notAuthorized": "No estás autorizado. Por favor, inicia sesión.",
|
||||||
|
"saveChanges": "Guardar cambios",
|
||||||
|
"optional": "Opcional",
|
||||||
|
"destination": "Destino",
|
||||||
|
"username": "Nombre de usuario",
|
||||||
|
"password": "Contraseña"
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ function LogInUser() {
|
||||||
setUsername(e.target.value);
|
setUsername(e.target.value);
|
||||||
}}
|
}}
|
||||||
margin="dense"
|
margin="dense"
|
||||||
label="username"
|
label={t("username")}
|
||||||
type="username"
|
type="username"
|
||||||
fullWidth
|
fullWidth
|
||||||
/>
|
/>
|
||||||
|
@ -101,7 +101,7 @@ function LogInUser() {
|
||||||
setPassword(e.target.value);
|
setPassword(e.target.value);
|
||||||
}}
|
}}
|
||||||
margin="dense"
|
margin="dense"
|
||||||
label="password"
|
label={t("password")}
|
||||||
type="password"
|
type="password"
|
||||||
fullWidth
|
fullWidth
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -33,7 +33,9 @@ function MemberSettings({ member, network, handleChange }) {
|
||||||
<BuildIcon style={{ fontSize: 20 }} />
|
<BuildIcon style={{ fontSize: 20 }} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open} onClose={handleClose}>
|
||||||
<DialogTitle>{"Member " + member.config.id + " settings"}</DialogTitle>
|
<DialogTitle>
|
||||||
|
{t("member") + member.config.id + t("settings")}
|
||||||
|
</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
|
|
@ -134,7 +134,7 @@ function NetworkRules({ network, callback }) {
|
||||||
</Typography>
|
</Typography>
|
||||||
) : (
|
) : (
|
||||||
<Button variant="contained" color="primary" onClick={saveChanges}>
|
<Button variant="contained" color="primary" onClick={saveChanges}>
|
||||||
Save Changes
|
{t("saveChanges")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -145,7 +145,7 @@ function IPv4AutoAssign({ ipAssignmentPools, handleChange }) {
|
||||||
<TextField
|
<TextField
|
||||||
value={start}
|
value={start}
|
||||||
onChange={handleStartInput}
|
onChange={handleStartInput}
|
||||||
placeholder={"Start"}
|
placeholder={t("start")}
|
||||||
/>
|
/>
|
||||||
<Divider
|
<Divider
|
||||||
orientation="vertical"
|
orientation="vertical"
|
||||||
|
@ -157,7 +157,7 @@ function IPv4AutoAssign({ ipAssignmentPools, handleChange }) {
|
||||||
<TextField
|
<TextField
|
||||||
value={end}
|
value={end}
|
||||||
onChange={handleEndInput}
|
onChange={handleEndInput}
|
||||||
placeholder={"End"}
|
placeholder={t("end")}
|
||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
size="small"
|
size="small"
|
||||||
|
|
|
@ -74,12 +74,12 @@ function ManagedRoutes({ routes, handleChange }) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "target",
|
id: "target",
|
||||||
name: "Target",
|
name: t("target"),
|
||||||
cell: (row) => row["target"],
|
cell: (row) => row["target"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "via",
|
id: "via",
|
||||||
name: "via",
|
name: t("via"),
|
||||||
cell: (row) => (row["via"] ? row["via"] : "(LAN)"),
|
cell: (row) => (row["via"] ? row["via"] : "(LAN)"),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -103,7 +103,7 @@ function ManagedRoutes({ routes, handleChange }) {
|
||||||
<TextField
|
<TextField
|
||||||
value={destination}
|
value={destination}
|
||||||
onChange={handleDestinationInput}
|
onChange={handleDestinationInput}
|
||||||
placeholder={"Destination (CIDR)"}
|
placeholder={t("destination") + " (CIDR)"}
|
||||||
/>
|
/>
|
||||||
<Divider
|
<Divider
|
||||||
orientation="vertical"
|
orientation="vertical"
|
||||||
|
@ -115,7 +115,7 @@ function ManagedRoutes({ routes, handleChange }) {
|
||||||
<TextField
|
<TextField
|
||||||
value={via}
|
value={via}
|
||||||
onChange={handleViaInput}
|
onChange={handleViaInput}
|
||||||
placeholder={"Via (Optional)"}
|
placeholder={t("via") + " (" + t("optional") + ")"}
|
||||||
/>
|
/>
|
||||||
<IconButton size="small" color="primary" onClick={addRouteReq}>
|
<IconButton size="small" color="primary" onClick={addRouteReq}>
|
||||||
<AddIcon
|
<AddIcon
|
||||||
|
|
|
@ -11,7 +11,10 @@ import { useLocalStorage } from "react-use";
|
||||||
import API from "utils/API";
|
import API from "utils/API";
|
||||||
import useStyles from "./Network.styles";
|
import useStyles from "./Network.styles";
|
||||||
|
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
function Network() {
|
function Network() {
|
||||||
|
const { t, i18n } = useTranslation();
|
||||||
const { nwid } = useParams();
|
const { nwid } = useParams();
|
||||||
const [loggedIn] = useLocalStorage("loggedIn", false);
|
const [loggedIn] = useLocalStorage("loggedIn", false);
|
||||||
const [network, setNetwork] = useState({});
|
const [network, setNetwork] = useState({});
|
||||||
|
@ -42,7 +45,7 @@ function Network() {
|
||||||
<div className={classes.breadcrumbs}>
|
<div className={classes.breadcrumbs}>
|
||||||
<Link color="inherit" component={RouterLink} to="/" underline="none">
|
<Link color="inherit" component={RouterLink} to="/" underline="none">
|
||||||
<ArrowBackIcon className={classes.backIcon}></ArrowBackIcon>
|
<ArrowBackIcon className={classes.backIcon}></ArrowBackIcon>
|
||||||
Networks
|
{t("network", { count: 2 })}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.container}>
|
<div className={classes.container}>
|
||||||
|
@ -73,9 +76,7 @@ function Network() {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grid item xs={10}>
|
<Grid item xs={10}>
|
||||||
<Typography variant="h5">
|
<Typography variant="h5">{t("notAuthorized")}</Typography>
|
||||||
You are not authorized. Please Log In
|
|
||||||
</Typography>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue