mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-16 10:03:12 -07:00
feat: i18n fix
This commit is contained in:
parent
d19bf07382
commit
3d67022b38
12 changed files with 25 additions and 31 deletions
43
frontend/src/components/Settings/Settings.jsx
Normal file
43
frontend/src/components/Settings/Settings.jsx
Normal file
|
@ -0,0 +1,43 @@
|
|||
import {
|
||||
Accordion,
|
||||
AccordionSummary,
|
||||
AccordionDetails,
|
||||
Checkbox,
|
||||
Divider,
|
||||
Grid,
|
||||
Typography,
|
||||
TextField,
|
||||
Select,
|
||||
} from "@material-ui/core";
|
||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||
|
||||
import API from "utils/API";
|
||||
import { parseValue, replaceValue, setValue } from "utils/ChangeHelper";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
function Settings() {
|
||||
const { t, i18n } = useTranslation();
|
||||
|
||||
const handleChange = () => (event) => {
|
||||
i18n.changeLanguage(event.target.value);
|
||||
};
|
||||
|
||||
return (
|
||||
<Accordion>
|
||||
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
||||
<Typography>{t("language")}</Typography>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails>
|
||||
<Grid item>
|
||||
<Select native value={i18n.language} onChange={handleChange()}>
|
||||
<option value={"en"}>English</option>
|
||||
<option value={"es-ES"}>Español</option>
|
||||
</Select>
|
||||
</Grid>
|
||||
</AccordionDetails>
|
||||
</Accordion>
|
||||
);
|
||||
}
|
||||
|
||||
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";
|
Loading…
Add table
Add a link
Reference in a new issue