Przeglądaj źródła

Merge pull request #1992 from visuddhinanda/agile

完成nissaya翻译功能
visuddhinanda 2 lat temu
rodzic
commit
601560ed1a

+ 1 - 0
dashboard/src/components/api/Corpus.ts

@@ -154,6 +154,7 @@ export interface ISentenceRequest {
   prUuid?: string;
   prEditAt?: string;
   channels?: string;
+  html?: boolean;
 }
 
 export interface ISentenceData {

+ 6 - 3
dashboard/src/components/dict/MyCreate.tsx

@@ -59,15 +59,18 @@ export const UserWbwPost = (data: IDictRequest[], view: string) => {
       const factors: IDictRequest[] = value.factors
         .split("+")
         .map((item, id) => {
+          const currWord = item.replaceAll("-", "");
+          console.debug("currWord", currWord);
           return {
-            word: item,
+            word: currWord,
             type: ".part.",
             grammar: "",
-            mean: fm ? fm[id] ?? "" : "",
+            mean: fm ? fm[id].replaceAll("-", "") ?? "" : "",
             confidence: value.confidence,
             language: value.language,
           };
-        });
+        })
+        .filter((value) => value.mean !== "");
       wordData = [...wordData, ...factors];
     }
   });

+ 12 - 1
dashboard/src/components/template/Nissaya.tsx

@@ -1,3 +1,6 @@
+import { useAppSelector } from "../../hooks";
+import { settingInfo } from "../../reducers/setting";
+import { GetUserSetting } from "../auth/setting/default";
 import NissayaMeaning from "./Nissaya/NissayaMeaning";
 import PaliText from "./Wbw/PaliText";
 
@@ -7,8 +10,16 @@ interface IWidgetNissayaCtl {
   children?: React.ReactNode;
 }
 const NissayaCtl = ({ pali, meaning, children }: IWidgetNissayaCtl) => {
+  const settings = useAppSelector(settingInfo);
+  const layout = GetUserSetting("setting.nissaya.layout.read", settings);
+  console.debug("NissayaCtl layout", layout);
   return (
-    <span style={{ marginRight: 10 }}>
+    <span
+      style={{
+        display: layout === "inline" ? "inline-block" : "block",
+        marginRight: 10,
+      }}
+    >
       <PaliText
         lookup={true}
         text={pali}

+ 1 - 1
dashboard/src/components/template/Nissaya/NissayaMeaning.tsx

@@ -10,7 +10,7 @@ export interface IMeaning {
 }
 
 export const nissayaBase = (item: string, endings: string[]): IMeaning => {
-  let word = item.replaceAll("။", "");
+  let word = item.trim().replaceAll("။", "");
   let end: string[] = [];
   for (let loop = 0; loop < 3; loop++) {
     for (let i = 0; i < word.length; i++) {

+ 1 - 0
dashboard/src/components/template/SentEdit.tsx

@@ -59,6 +59,7 @@ export interface ISentenceId {
 export const toISentence = (apiData: ISentenceData): ISentence => ({
   id: apiData.id,
   content: apiData.content,
+  contentType: apiData.content_type,
   html: apiData.html,
   book: apiData.book,
   para: apiData.paragraph,

+ 2 - 1
dashboard/src/components/template/SentEdit/SentCanRead.tsx

@@ -64,6 +64,7 @@ const SentCanReadWidget = ({
               editor: item.editor,
               studio: item.studio,
               channel: item.channel,
+              contentType: item.content_type,
               suggestionCount: item.suggestionCount,
               translationChannels: channelsId,
               forkAt: item.fork_at,
@@ -157,7 +158,7 @@ const SentCanReadWidget = ({
             isPr={false}
             editMode={item.openInEditMode}
             onChange={(value: ISentence) => {
-              console.log("onChange", value);
+              console.debug("onChange", value);
               setSentData((origin) => {
                 origin.forEach((value1, index, array) => {
                   if (value1.id === value.id) {

+ 82 - 40
dashboard/src/components/template/SentEdit/SentCell.tsx

@@ -20,7 +20,7 @@ import { anchor, message } from "../../../reducers/discussion";
 import TextDiff from "../../general/TextDiff";
 import { sentSave as _sentSave } from "./SentCellEditable";
 import { IDeleteResponse } from "../../api/Article";
-import { delete_ } from "../../../request";
+import { delete_, get } from "../../../request";
 
 import "./style.css";
 import StudioName from "../../auth/Studio";
@@ -29,6 +29,15 @@ import store from "../../../store";
 import { randomString } from "../../../utils";
 import User from "../../auth/User";
 
+interface ISnowFlakeResponse {
+  ok: boolean;
+  message?: string;
+  data: {
+    rows: string;
+    count: number;
+  };
+}
+
 interface IWidget {
   initValue?: ISentence;
   value?: ISentence;
@@ -53,6 +62,7 @@ const SentCellWidget = ({
   onChange,
   onDelete,
 }: IWidget) => {
+  console.debug("SentCell render", value);
   const intl = useIntl();
   const [isEditMode, setIsEditMode] = useState(editMode);
   const [sentData, setSentData] = useState<ISentence | undefined>(initValue);
@@ -216,49 +226,81 @@ const SentCellWidget = ({
               break;
           }
         }}
-        onConvert={(format: string) => {
+        onConvert={async (format: string) => {
           switch (format) {
             case "json":
               const wbw: IWbw[] = sentData?.content
-                ? sentData.content.split("\n").map((item, id) => {
-                    const parts = item.split("=");
-                    const word = my_to_roman(parts[0]);
-                    const meaning: string =
-                      parts.length > 1 ? parts[1].trim() : "";
-                    let parent: string = "";
-                    let factors: string = "";
-                    if (!meaning.includes(" ") && endings) {
-                      const base = nissayaBase(meaning, endings);
-                      parent = base.base;
-                      const end = base.ending ? base.ending : [];
-                      factors = [base.base, ...end].join("+");
-                    } else {
-                      factors = meaning.replaceAll(" ", "+");
-                    }
-                    return {
-                      book: sentData.book,
-                      para: sentData.para,
-                      sn: [id],
-                      word: { value: word ? word : parts[0], status: 0 },
-                      real: { value: meaning, status: 0 },
-                      meaning: { value: "", status: 0 },
-                      parent: { value: parent, status: 0 },
-                      factors: {
-                        value: factors,
-                        status: 0,
-                      },
-                      confidence: 0.5,
-                    };
-                  })
+                ? sentData.content
+                    .split("\n")
+                    .filter((value) => value.trim().length > 0)
+                    .map((item, id) => {
+                      const parts = item.split("=");
+                      const word = my_to_roman(parts[0]);
+                      const meaning: string =
+                        parts.length > 1
+                          ? parts[1]
+                              .trim()
+                              .replaceAll("။", "")
+                              .replaceAll("(", " ( ")
+                              .replaceAll(")", " ) ")
+                          : "";
+                      const translation: string =
+                        parts.length > 2 ? parts[2].trim() : "";
+                      let parent: string = "";
+                      let factors: string = "";
+                      const factor1 = meaning
+                        .split(" ")
+                        .filter((value) => value !== "");
+                      factors = factor1
+                        .map((item) => {
+                          if (endings) {
+                            const base = nissayaBase(item, endings);
+                            if (factor1.length === 1) {
+                              parent = base.base;
+                            }
+                            const end = base.ending ? base.ending : [];
+                            return [base.base, ...end]
+                              .filter((value) => value !== "")
+                              .join("-");
+                          } else {
+                            return item;
+                          }
+                        })
+                        .join("+");
+                      return {
+                        uid: "0",
+                        book: sentData.book,
+                        para: sentData.para,
+                        sn: [id],
+                        word: { value: word ? word : parts[0], status: 0 },
+                        real: { value: meaning, status: 0 },
+                        meaning: { value: translation, status: 0 },
+                        parent: { value: parent, status: 0 },
+                        factors: {
+                          value: factors,
+                          status: 0,
+                        },
+                        confidence: 0.5,
+                      };
+                    })
                 : [];
-              setSentData((origin) => {
-                if (origin) {
-                  origin.contentType = "json";
-                  origin.content = JSON.stringify(wbw);
-                  sentSave(origin, intl);
-                  return origin;
-                }
-              });
+              if (wbw.length > 0) {
+                const snowflake = await get<ISnowFlakeResponse>(
+                  `/v2/snowflake?count=${wbw.length}`
+                );
+                wbw.forEach((value: IWbw, index: number, array: IWbw[]) => {
+                  array[index].uid = snowflake.data.rows[index];
+                });
+              }
+
+              if (sentData) {
+                const newData = JSON.parse(JSON.stringify(sentData));
+                newData.contentType = "json";
+                newData.content = JSON.stringify(wbw);
+                setSentData(newData);
+                sentSave(newData, intl);
+              }
+
               setIsEditMode(true);
               break;
             case "markdown":

+ 0 - 1
dashboard/src/components/template/SentEdit/SentContent.tsx

@@ -132,7 +132,6 @@ const SentContentWidget = ({
                 para={para}
                 wordStart={wordStart}
                 wordEnd={wordEnd}
-                magicDict={magicDict}
                 channelId={item.channel.id}
                 channelType={item.channel.type}
                 channelLang={item.channel.lang}

+ 41 - 46
dashboard/src/components/template/SentEdit/SentWbwEdit.tsx

@@ -4,56 +4,50 @@ import { Button, message } from "antd";
 import { EyeOutlined } from "@ant-design/icons";
 
 import { put } from "../../../request";
-import { ISentenceRequest, ISentenceResponse } from "../../api/Corpus";
+import {
+  ISentenceData,
+  ISentenceRequest,
+  ISentenceResponse,
+} from "../../api/Corpus";
 import { ISentence } from "../SentEdit";
 import { WbwSentCtl } from "../WbwSent";
 import { IWbw } from "../Wbw/WbwWord";
 import store from "../../../store";
 import { statusChange } from "../../../reducers/net-status";
 
-export const sentSave = (sent: ISentence, intl: IntlShape) => {
+export const sentSave = async (
+  sent: ISentence,
+  intl: IntlShape
+): Promise<ISentenceData> => {
   store.dispatch(statusChange({ status: "loading" }));
-  put<ISentenceRequest, ISentenceResponse>(
-    `/v2/sentence/${sent.book}_${sent.para}_${sent.wordStart}_${sent.wordEnd}_${sent.channel.id}`,
-    {
-      book: sent.book,
-      para: sent.para,
-      wordStart: sent.wordStart,
-      wordEnd: sent.wordEnd,
-      channel: sent.channel.id,
-      content: sent.content,
-      contentType: sent.contentType,
-    }
-  )
-    .then((json) => {
-      console.log(json);
-      if (json.ok) {
-        store.dispatch(
-          statusChange({
-            status: "success",
-            message: intl.formatMessage({ id: "flashes.success" }),
-          })
-        );
-      } else {
-        message.error(json.message);
-        store.dispatch(
-          statusChange({
-            status: "fail",
-            message: json.message,
-          })
-        );
-      }
-    })
-    .catch((e) => {
-      console.error("catch", e);
-      message.error(e.message);
-      store.dispatch(
-        statusChange({
-          status: "fail",
-          message: e.message,
-        })
-      );
-    });
+  const url = `/v2/sentence/${sent.book}_${sent.para}_${sent.wordStart}_${sent.wordEnd}_${sent.channel.id}`;
+  console.info("SentWbwEdit url", url);
+  const res = await put<ISentenceRequest, ISentenceResponse>(url, {
+    book: sent.book,
+    para: sent.para,
+    wordStart: sent.wordStart,
+    wordEnd: sent.wordEnd,
+    channel: sent.channel.id,
+    content: sent.content,
+    contentType: sent.contentType,
+  });
+  if (res.ok) {
+    store.dispatch(
+      statusChange({
+        status: "success",
+        message: intl.formatMessage({ id: "flashes.success" }),
+      })
+    );
+  } else {
+    message.error(res.message);
+    store.dispatch(
+      statusChange({
+        status: "fail",
+        message: res.message,
+      })
+    );
+  }
+  return res.data;
 };
 
 interface IWidget {
@@ -72,7 +66,7 @@ const SentWbwEditWidget = ({ data, onSave, onClose }: IWidget) => {
   }, [data.content, data.contentType]);
 
   return (
-    <div>
+    <div style={{ width: "100%" }}>
       <WbwSentCtl
         book={data.book}
         para={data.para}
@@ -93,10 +87,11 @@ const SentWbwEditWidget = ({ data, onSave, onClose }: IWidget) => {
         channelId={data.channel.id}
         channelType={data.channel.type}
         channelLang={data.channel.lang}
-        onChange={(wbwData: IWbw[]) => {
+        onChange={async (wbwData: IWbw[]) => {
           let newSent = data;
           newSent.content = JSON.stringify(wbwData);
-          sentSave(newSent, intl);
+          const newData = await sentSave(newSent, intl);
+          newSent.html = newData.html;
           if (typeof onSave !== "undefined") {
             onSave(newSent);
           }

+ 1 - 1
dashboard/src/components/template/Wbw/WbwDetailBasic.tsx

@@ -169,7 +169,7 @@ const WbwDetailBasicWidget = ({
           <div style={{ display: "flex" }}>
             <WbwDetailFm
               factors={factors}
-              initValue={data.factorMeaning?.value?.split("+")}
+              value={data.factorMeaning?.value?.split("+")}
               onChange={(value: string[]) => {
                 console.log("fm change", value);
                 if (typeof onChange !== "undefined") {

+ 1 - 1
dashboard/src/components/template/Wbw/WbwDetailFactor.tsx

@@ -51,7 +51,7 @@ const WbwDetailFactorWidget = ({ data, onChange }: IWidget) => {
     ) {
       return;
     }
-    lookup(data.factors?.value.split("+"));
+    lookup(data.factors?.value.replaceAll("-", "+").split("+"));
   }, [data.factors]);
 
   useEffect(() => {

+ 49 - 48
dashboard/src/components/template/Wbw/WbwDetailFm.tsx

@@ -25,7 +25,7 @@ interface IWFMI {
 }
 const WbwFactorMeaningItem = ({ pali, meaning = "", onChange }: IWFMI) => {
   const intl = useIntl();
-  console.debug("meaning", meaning);
+  console.debug("WbwFactorMeaningItem meaning", meaning);
   const defaultMenu: ItemType[] = [
     {
       key: "_lookup",
@@ -177,57 +177,44 @@ const WbwFactorMeaningItem = ({ pali, meaning = "", onChange }: IWFMI) => {
     </Dropdown>
   );
 };
-
+const resizeArray = (input: string[], factors: string[]) => {
+  const newFm = factors.map((item, index) => {
+    if (index < input.length) {
+      return input[index];
+    } else {
+      return "";
+    }
+  });
+  return newFm;
+};
 interface IWidget {
   factors?: string[];
-  initValue?: string[];
+  value?: string[];
   onChange?: Function;
   onJoin?: Function;
 }
 const WbwDetailFmWidget = ({
   factors = [],
-  initValue = [],
+  value = [],
   onChange,
   onJoin,
 }: IWidget) => {
+  console.debug("WbwDetailFmWidget render");
   const [factorInputEnable, setFactorInputEnable] = useState(false);
-  const [factorMeaning, setFactorMeaning] = useState<string[]>(initValue);
 
-  const resizeArray = (input: string[]) => {
-    const newFm = factors.map((item, index) => {
-      if (index < input.length) {
-        return input[index];
-      } else {
-        return "";
-      }
-    });
-    return newFm;
-  };
-
-  useEffect(() => {
-    console.log("value", initValue);
-    setFactorMeaning(resizeArray(initValue));
-  }, []);
-
-  useEffect(() => {
-    if (factors.length === factorMeaning.length) {
-      return;
-    }
-    setFactorMeaning(resizeArray(factorMeaning));
-  }, [factors]);
+  const currValue = resizeArray(value, factors);
 
   return (
-    <div style={{ width: "100%" }}>
+    <div className="wbw_word_item" style={{ width: "100%" }}>
       <div style={{ display: "flex", width: "100%" }}>
         <Input
           key="input"
           allowClear
           hidden={!factorInputEnable}
-          value={factorMeaning.join("+")}
+          value={currValue.join("+")}
           onChange={(e) => {
             console.log(e.target.value);
-            const newData = resizeArray(e.target.value.split("+"));
-            setFactorMeaning(newData);
+            const newData = resizeArray(e.target.value.split("+"), factors);
             if (typeof onChange !== "undefined") {
               onChange(newData);
             }
@@ -244,24 +231,37 @@ const WbwDetailFmWidget = ({
       </div>
       {!factorInputEnable ? (
         <Space size={0} key="space">
-          {factorMeaning.map((item, index) => {
+          {currValue.map((item, index) => {
+            const fm = item.split("-");
             return (
               <span key={index} style={{ display: "flex" }}>
-                <WbwFactorMeaningItem
-                  key={index}
-                  pali={factors[index]}
-                  meaning={item}
-                  onChange={(value: string) => {
-                    const newData = [...factorMeaning];
-                    newData[index] = value;
-                    setFactorMeaning(newData);
-                    if (typeof onChange !== "undefined") {
-                      onChange(newData);
-                    }
-                  }}
-                />
+                {factors[index]?.split("-").map((item1, index1) => {
+                  return (
+                    <WbwFactorMeaningItem
+                      key={index1}
+                      pali={item1}
+                      meaning={fm[index1]}
+                      onChange={(value: string) => {
+                        const newData = [...currValue];
+                        let currFm = currValue[index].split("-");
+                        currFm.length = factors[index].split("-").length;
+                        currFm.forEach(
+                          (value3: string, index3: number, array: string[]) => {
+                            if (index3 === index1) {
+                              array[index3] = value;
+                            }
+                          }
+                        );
+                        newData[index] = currFm.join("-");
+                        if (typeof onChange !== "undefined") {
+                          onChange(newData);
+                        }
+                      }}
+                    />
+                  );
+                })}
 
-                {index < factorMeaning.length - 1 ? (
+                {index < currValue.length - 1 ? (
                   <PlusOutlined key={`icon-${index}`} />
                 ) : (
                   <>
@@ -283,9 +283,10 @@ const WbwDetailFmWidget = ({
                         onClick={() => {
                           if (typeof onJoin !== "undefined") {
                             onJoin(
-                              factorMeaning
+                              currValue
                                 .filter((value) => !value.includes("["))
-                                .join(" ")
+                                .map((item) => item.replaceAll("-", ""))
+                                .join("")
                             );
                           }
                         }}

+ 6 - 3
dashboard/src/components/template/Wbw/WbwWord.tsx

@@ -227,7 +227,10 @@ const WbwWordWidget = ({
               wordData.factors?.value !== "" &&
               wordData.factors?.value !== null
             ) {
-              words = [...words, ...wordData.factors.value.split("+")];
+              words = [
+                ...words,
+                ...wordData.factors.value.replaceAll("-", "+").split("+"),
+              ];
             }
             intervalRef.current = window.setInterval(lookup, 300, words);
           }
@@ -327,8 +330,8 @@ const WbwWordWidget = ({
           ) : undefined}
           {fieldDisplay?.factorMeaning2 ? (
             <WbwDetailFm
-              factors={data.factors?.value?.split("+")}
-              initValue={data.factorMeaning?.value?.split("+")}
+              factors={wordData.factors?.value?.split("+")}
+              value={wordData.factorMeaning?.value?.split("+")}
               onChange={(value: string[]) => {
                 const newData: IWbw = JSON.parse(JSON.stringify(wordData));
                 newData.factorMeaning = {

+ 2 - 1
dashboard/src/components/template/Wbw/wbw.css

@@ -15,7 +15,7 @@
   display: flex;
 }
 .layout-v .wbw_body {
-  display: flex;
+  display: unset;
 }
 .wbw_word {
   margin: 0 0 0.2em 0;
@@ -83,6 +83,7 @@
 }
 .layout-v .wbw_word_item {
   margin-right: 8px;
+  flex: 5;
 }
 .case {
   padding: 0 2px;

+ 35 - 37
dashboard/src/components/template/WbwSent.tsx

@@ -144,7 +144,6 @@ interface IWidget {
   display?: TWbwDisplayMode;
   fields?: IWbwFields;
   layoutDirection?: "h" | "v";
-  magicDict?: string;
   refreshable?: boolean;
   mode?: ArticleMode;
   wbwProgress?: boolean;
@@ -164,7 +163,6 @@ export const WbwSentCtl = ({
   fields,
   layoutDirection = "h",
   mode,
-  magicDict,
   refreshable = false,
   wbwProgress = false,
   onChange,
@@ -175,7 +173,6 @@ export const WbwSentCtl = ({
   const [wbwMode, setWbwMode] = useState(display);
   const [fieldDisplay, setFieldDisplay] = useState(fields);
   const [displayMode, setDisplayMode] = useState<ArticleMode>();
-  const [magic, setMagic] = useState<string>();
   const [loading, setLoading] = useState(false);
   const [progress, setProgress] = useState(0);
   const [showProgress, setShowProgress] = useState(false);
@@ -221,10 +218,6 @@ export const WbwSentCtl = ({
     setProgress(progress);
   }, [wordData]);
 
-  useEffect(() => {
-    setMagic(magicDict);
-  }, [magicDict]);
-
   const newMode = useAppSelector(_mode);
 
   const update = (data: IWbw[]) => {
@@ -308,10 +301,7 @@ export const WbwSentCtl = ({
     }
   }, [newMode, mode]);
 
-  useEffect(() => {
-    if (typeof magic === "undefined") {
-      return;
-    }
+  const magicDictLookup = () => {
     let _lang = GetUserSetting("setting.dict.lang", settings);
     const url = `/v2/wbwlookup`;
     console.log("magic dict url", url);
@@ -330,19 +320,20 @@ export const WbwSentCtl = ({
         if (json.ok) {
           console.log("magic dict result", json.data);
           update(json.data);
-          updateWbwAll(json.data);
+          if (channelType !== "nissaya") {
+            saveWbwAll(json.data);
+          }
         } else {
           console.error(json.message);
         }
       })
       .finally(() => {
-        setMagic(undefined);
         setLoading(false);
         if (typeof onMagicDictDone !== "undefined") {
           onMagicDictDone();
         }
       });
-  }, [magic]);
+  };
 
   const wbwToXml = (item: IWbw) => {
     return {
@@ -373,7 +364,7 @@ export const WbwSentCtl = ({
     };
   };
 
-  const updateWbwAll = (wbwData: IWbw[]) => {
+  const saveWbwAll = (wbwData: IWbw[]) => {
     let arrSn: number[] = [];
     wbwData.forEach((value) => {
       if (!arrSn.includes(value.sn[0])) {
@@ -483,25 +474,30 @@ export const WbwSentCtl = ({
     let wordData: IDictRequest[] = [];
 
     wbwData.forEach((data) => {
-      const [wordType, wordGrammar] = data.case?.value
-        ? data.case?.value?.split("#")
-        : ["", ""];
-      let conf = data.confidence * 100;
-      if (data.confidence.toString() === "0.5") {
-        conf = 100;
+      if (
+        typeof data.meaning?.value === "string" &&
+        data.meaning?.value.trim().length > 0
+      ) {
+        const [wordType, wordGrammar] = data.case?.value
+          ? data.case?.value?.split("#")
+          : ["", ""];
+        let conf = data.confidence * 100;
+        if (data.confidence.toString() === "0.5") {
+          conf = 100;
+        }
+        wordData.push({
+          word: data.real.value ? data.real.value : "",
+          type: wordType,
+          grammar: wordGrammar,
+          mean: data.meaning?.value,
+          parent: data.parent?.value,
+          factors: data.factors?.value,
+          factormean: data.factorMeaning?.value,
+          note: data.note?.value,
+          confidence: conf,
+          language: channelLang,
+        });
       }
-      wordData.push({
-        word: data.real.value ? data.real.value : "",
-        type: wordType,
-        grammar: wordGrammar,
-        mean: data.meaning?.value,
-        parent: data.parent?.value,
-        factors: data.factors?.value,
-        factormean: data.factorMeaning?.value,
-        note: data.note?.value,
-        confidence: conf,
-        language: channelLang,
-      });
     });
 
     UserWbwPost(wordData, "wbw")
@@ -647,11 +643,11 @@ export const WbwSentCtl = ({
     });
     message.info(`已经重置${count}个`);
     update(newData);
-    updateWbwAll(newData);
+    saveWbwAll(newData);
   };
 
   return (
-    <div>
+    <div style={{ width: "100%" }}>
       <div
         className="progress"
         style={{ display: showProgress ? "block" : "none" }}
@@ -664,7 +660,9 @@ export const WbwSentCtl = ({
             items: [
               {
                 key: "magic-dict-current",
-                label: "神奇字典",
+                label: intl.formatMessage({
+                  id: "buttons.magic-dict",
+                }),
               },
               {
                 key: "progress",
@@ -696,7 +694,7 @@ export const WbwSentCtl = ({
               switch (key) {
                 case "magic-dict-current":
                   setLoading(true);
-                  setMagic("curr");
+                  magicDictLookup();
                   break;
                 case "wbw-dict-publish-all":
                   wbwPublish(wordData);

+ 1 - 1
dashboard/src/locales/zh-Hans/setting/index.ts

@@ -29,7 +29,7 @@ const items = {
   "setting.dict.lang.label": "字典语言",
   "setting.dict.lang.description": "字典查询结果的语言排序",
   "setting.nissaya.layout.read.label": "阅读排版方式",
-  "setting.nissaya.layout.edit.label": "阅读排版方式",
+  "setting.nissaya.layout.edit.label": "编辑排版方式",
   "setting.nissaya.layout.inline.label": "连续",
   "setting.nissaya.layout.list.label": "列表",
   "setting.wbw.order.label": "显示输入顺序提示",