diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 00840770..146be119 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -43,7 +43,8 @@ "unmute": "Unmute", "mark_read": "Mark As Read", "hide_session": "Hide Session", - "reload": "reload" + "reload": "reload", + "download_origin": "Download original" }, "status": { "uploading": "Uploading" diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index a24f3666..ddef07f4 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -45,7 +45,8 @@ "unmute": "取消静默", "mark_read": "标记已读", "hide_session": "隐藏会话", - "reload": "刷新页面" + "reload": "刷新页面", + "download_origin": "下载原图" }, "status": { "uploading": "上传中" diff --git a/src/common/component/ImagePreviewModal.tsx b/src/common/component/ImagePreviewModal.tsx index d76f63b8..9c2518af 100644 --- a/src/common/component/ImagePreviewModal.tsx +++ b/src/common/component/ImagePreviewModal.tsx @@ -2,6 +2,7 @@ import { useRef, useState, useEffect, FC } from "react"; import { useOutsideClick, useKey } from "rooks"; import { Ring } from "@uiball/loaders"; import Modal from "./Modal"; +import { useTranslation } from "react-i18next"; export interface PreviewImageData { @@ -19,6 +20,7 @@ interface Props { } const ImagePreviewModal: FC = ({ download = true, data, closeModal }) => { + const { t } = useTranslation(); const [url, setUrl] = useState(data?.thumbnail); const [loading, setLoading] = useState(true); const wrapperRef = useRef(null); @@ -53,7 +55,7 @@ const ImagePreviewModal: FC = ({ download = true, data, closeModal }) => return (
-
+
= ({ download = true, data, closeModal }) => href={downloadLink || originUrl} rel="noreferrer" > - Download original + {t("action.download_origin")} )} {loading && ( -
+
)}