Browse Source

多语言

visuddhinanda 2 years ago
parent
commit
c675bbae64
1 changed files with 8 additions and 2 deletions
  1. 8 2
      dashboard/src/components/template/Wbw/WbwDetailFm.tsx

+ 8 - 2
dashboard/src/components/template/Wbw/WbwDetailFm.tsx

@@ -1,3 +1,4 @@
+import { useIntl } from "react-intl";
 import { Button, Dropdown, Input, MenuProps, Space } from "antd";
 import { Button, Dropdown, Input, MenuProps, Space } from "antd";
 import { useEffect, useState } from "react";
 import { useEffect, useState } from "react";
 import {
 import {
@@ -20,13 +21,16 @@ interface IWFMI {
   onChange?: Function;
   onChange?: Function;
 }
 }
 const WbwFactorMeaningItem = ({ pali, meaning, onChange }: IWFMI) => {
 const WbwFactorMeaningItem = ({ pali, meaning, onChange }: IWFMI) => {
+  const intl = useIntl();
   const defaultMenu: MenuProps["items"] = [
   const defaultMenu: MenuProps["items"] = [
     {
     {
       key: "_lookup",
       key: "_lookup",
       label: (
       label: (
         <Space>
         <Space>
           <SearchOutlined />
           <SearchOutlined />
-          {"查字典"}
+          {intl.formatMessage({
+            id: "buttons.lookup",
+          })}
         </Space>
         </Space>
       ),
       ),
     },
     },
@@ -35,7 +39,9 @@ const WbwFactorMeaningItem = ({ pali, meaning, onChange }: IWFMI) => {
       label: (
       label: (
         <Space>
         <Space>
           <EditOutlined />
           <EditOutlined />
-          {"修改"}
+          {intl.formatMessage({
+            id: "buttons.edit",
+          })}
         </Space>
         </Space>
       ),
       ),
     },
     },