From c9335601029a31c740da8392c0471bd389f692d8 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Thu, 4 Jul 2024 14:18:21 +0800 Subject: [PATCH] fix: locale typo --- src/components/profile/groups-editor-viewer.tsx | 12 ++++++------ src/components/profile/rules-editor-viewer.tsx | 12 ++++++------ src/locales/en.json | 2 +- src/locales/fa.json | 2 ++ src/locales/ru.json | 2 ++ src/locales/zh.json | 2 +- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/components/profile/groups-editor-viewer.tsx b/src/components/profile/groups-editor-viewer.tsx index 7f0d56a..31a44b0 100644 --- a/src/components/profile/groups-editor-viewer.tsx +++ b/src/components/profile/groups-editor-viewer.tsx @@ -58,7 +58,7 @@ export const GroupsEditorViewer = (props: Props) => { const themeMode = useThemeMode(); const [prevData, setPrevData] = useState(""); const [currData, setCurrData] = useState(""); - const [visible, setVisible] = useState(true); + const [visualization, setVisualization] = useState(true); const [match, setMatch] = useState(() => (_: string) => true); const { control, watch, register, ...formIns } = useForm({ @@ -147,7 +147,7 @@ export const GroupsEditorViewer = (props: Props) => { useEffect(() => { if (currData === "") return; - if (visible !== true) return; + if (visualization !== true) return; let obj = yaml.load(currData) as { prepend: []; @@ -157,7 +157,7 @@ export const GroupsEditorViewer = (props: Props) => { setPrependSeq(obj?.prepend || []); setAppendSeq(obj?.append || []); setDeleteSeq(obj?.delete || []); - }, [visible]); + }, [visualization]); useEffect(() => { if (prependSeq && appendSeq && deleteSeq) @@ -273,10 +273,10 @@ export const GroupsEditorViewer = (props: Props) => { variant="contained" size="small" onClick={() => { - setVisible((prev) => !prev); + setVisualization((prev) => !prev); }} > - {visible ? t("Advanced") : t("Visible")} + {visualization ? t("Advanced") : t("Visualization")} @@ -286,7 +286,7 @@ export const GroupsEditorViewer = (props: Props) => { - {visible ? ( + {visualization ? ( <> { const [prevData, setPrevData] = useState(""); const [currData, setCurrData] = useState(""); - const [visible, setVisible] = useState(true); + const [visualization, setVisualization] = useState(true); const [match, setMatch] = useState(() => (_: string) => true); const [ruleType, setRuleType] = useState<(typeof rules)[number]>(rules[0]); @@ -305,13 +305,13 @@ export const RulesEditorViewer = (props: Props) => { useEffect(() => { if (currData === "") return; - if (visible !== true) return; + if (visualization !== true) return; let obj = yaml.load(currData) as ISeqProfileConfig | null; setPrependSeq(obj?.prepend || []); setAppendSeq(obj?.append || []); setDeleteSeq(obj?.delete || []); - }, [visible]); + }, [visualization]); useEffect(() => { if (prependSeq && appendSeq && deleteSeq) @@ -416,10 +416,10 @@ export const RulesEditorViewer = (props: Props) => { variant="contained" size="small" onClick={() => { - setVisible((prev) => !prev); + setVisualization((prev) => !prev); }} > - {visible ? t("Advanced") : t("Visible")} + {visualization ? t("Advanced") : t("Visualization")} @@ -429,7 +429,7 @@ export const RulesEditorViewer = (props: Props) => { - {visible ? ( + {visualization ? ( <>