diff --git a/public/locales/en-US/application.json b/public/locales/en-US/application.json index 06c40ac..500bc9f 100644 --- a/public/locales/en-US/application.json +++ b/public/locales/en-US/application.json @@ -400,6 +400,25 @@ "createdAt": "Created at", "action": "Action", "listEmpty": "No records.", - "createNewAccount": "Create new account" + "createNewAccount": "Create new account", + "taskType": "Task type", + "taskStatus": "Status", + "lastProgress": "Last progress", + "errorDetails": "Error details", + "queueing": "Queueing", + "processing": "Processing", + "failed": "Failed", + "canceled": "Canceled", + "finished": "Finished", + "fileTransfer": "File transfer", + "importFiles": "Import external files", + "transferProgress": "{{num}} files done", + "waiting": "Pending", + "compressing": "Compressing", + "decompressing": "Decompressing", + "downloading": "Downloading", + "transferring": "Transferring", + "indexing": "Indexing", + "listing": "Inserting" } } \ No newline at end of file diff --git a/public/locales/zh-CN/application.json b/public/locales/zh-CN/application.json index 76cc356..ab3c34c 100644 --- a/public/locales/zh-CN/application.json +++ b/public/locales/zh-CN/application.json @@ -390,6 +390,25 @@ "createdAt": "创建日期", "action": "操作", "listEmpty": "没有记录", - "createNewAccount": "创建新账号" + "createNewAccount": "创建新账号", + "taskType": "任务类型", + "taskStatus": "状态", + "lastProgress": "最后进度", + "errorDetails": "错误信息", + "queueing": "排队中", + "processing": "处理中", + "failed": "失败", + "canceled": "取消", + "finished": "已完成", + "fileTransfer": "文件中转", + "importFiles": "导入外部目录", + "transferProgress": "已完成 {{num}} 个文件", + "waiting": "等待中", + "compressing": "压缩中", + "decompressing": "解压缩中", + "downloading": "下载中", + "transferring": "转存中", + "indexing": "索引中", + "listing": "插入中" } } \ No newline at end of file diff --git a/src/component/Download/DownloadingCard.js b/src/component/Download/DownloadingCard.js index 6271433..d8f0a31 100644 --- a/src/component/Download/DownloadingCard.js +++ b/src/component/Download/DownloadingCard.js @@ -34,6 +34,7 @@ import { hex2bin, sizeToString } from "../../utils"; import TypeIcon from "../FileManager/TypeIcon"; import SelectFileDialog from "../Modals/SelectFile"; import { useHistory } from "react-router"; +import { useTranslation } from "react-i18next"; const ExpansionPanel = withStyles({ root: { maxWidth: "100%", diff --git a/src/component/Setting/Tasks.js b/src/component/Setting/Tasks.js index 6d87baf..8aedf34 100644 --- a/src/component/Setting/Tasks.js +++ b/src/component/Setting/Tasks.js @@ -13,6 +13,7 @@ import Pagination from "@material-ui/lab/Pagination"; import { formatLocalTime } from "../../utils/datetime"; import { toggleSnackbar } from "../../redux/explorer"; import Nothing from "../Placeholder/Nothing"; +import { useTranslation } from "react-i18next"; const useStyles = makeStyles((theme) => ({ layout: { @@ -49,6 +50,7 @@ const useStyles = makeStyles((theme) => ({ })); export default function Tasks() { + const { t } = useTranslation(); const [tasks, setTasks] = useState([]); const [total, setTotal] = useState(0); const [page, setPage] = useState(1); @@ -84,7 +86,7 @@ export default function Tasks() { const res = JSON.parse(error); return `${res.msg}: ${res.error}`; } catch (e) { - return "未知"; + return t("uploader.unknownStatus"); } }; @@ -93,23 +95,27 @@ export default function Tasks() { return (