feat: i18n

This commit is contained in:
Andres 2023-10-16 17:34:52 +02:00
parent d65e6fb71a
commit 61fd0e7186
24 changed files with 416 additions and 79 deletions

View file

@ -17,7 +17,11 @@ import debounce from "lodash/debounce";
import { useState } from "react";
import API from "utils/API";
import { useTranslation, Trans } from "react-i18next";
function NetworkRules({ network, callback }) {
const { t, i18n } = useTranslation();
const [editor, setEditor] = useState(null);
const [flowData, setFlowData] = useState({
rules: [...network.config.rules],
@ -87,12 +91,12 @@ function NetworkRules({ network, callback }) {
return (
<Accordion>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<Typography>Flow Rules</Typography>
<Typography>{t("flowRules")}</Typography>
</AccordionSummary>
<AccordionDetails>
{/* Important note: value in CodeMirror instance means INITAIL VALUE
or it could be used to replace editor state with the new value.
No need to update on every user character input
No need to update on every user character input Flow Rules
*/}
<CodeMirror
value={network["rulesSource"]}