diff --git a/public/locales/en-US/dashboard.json b/public/locales/en-US/dashboard.json index 3432038..96831b6 100644 --- a/public/locales/en-US/dashboard.json +++ b/public/locales/en-US/dashboard.json @@ -358,6 +358,29 @@ "remoteAddress": "Slave node address", "testCommunicationDes": "After completing the above steps, you can test if the communication is working by clicking the test button below.", "testCommunication": "Test slave communication", - "pathMagicVarDesRemote": "Enter the physical path to the folder you want to store files. Either absolute or relative (relative to slave Cloudreve executable) path is supported. You can use magic variables in the path, which will be automatically replaced with the corresponding values when the file is uploaded; see <0>List of path magic variables0> for available magic variables." + "pathMagicVarDesRemote": "Enter the physical path to the folder you want to store files. Either absolute or relative (relative to slave Cloudreve executable) path is supported. You can use magic variables in the path, which will be automatically replaced with the corresponding values when the file is uploaded; see <0>List of path magic variables0> for available magic variables.", + "storageBucket": "Storage bucket", + "editQiniuStoragePolicy": "Edit Qiniu storage policy", + "addQiniuStoragePolicy": "Add Qiniu storage policy", + "qiniuSiteURLDes": "Before using the Qiniu policy, please make sure that the address you entered in Basic Settings - Site Information - Site URL matches the actual address and <0>can be accessed properly by WAN0>.", + "createQiniuBucket": "Go to <0>Qiniu dashboard0> to create a storage bucket.。", + "enterQiniuBucket": "Enter the \"bucket name\" you just created:", + "qiniuBucketName": "Bucket name", + "bucketTypeDes": "Select the type of bucket you just created. We recommend selecting \"Private bucket\" for higher security, private bucket does not support \"Get Source Link\" feature.", + "privateBucket": "Private bucket", + "publicBucket": "Public bucket", + "bucketCDNDes": "Fill in the CDN-accelerated domain name you have bound for the storage bucket.", + "bucketCDNDomain": "CDN domain", + "qiniuCredentialDes": "Go to Personal Center - Credential Management in the Qiniu dashboard and fill in the obtained AK, SK.", + "ak": "AK", + "sk": "SK", + "cannotEnableForPrivateBucket": "This feature is not supported under private bucket.", + "limitMimeType": "Do you want to limit MimeTypes of file that can be uploaded?", + "mimeTypeDes": "Enter the MimeType of the allowed files, and separate multiple MimeTypes with a comma. Qiniu will detect the file content to determine the MimeType, and allow the upload if the MimeType is presented in your list.", + "mimeTypeList": "MimeTypes list", + "chunkSizeLabelQiniu": "Specify the chunk size for resumable uploads. Allowed range is 1 MB - 1 GB.", + "createPlaceholderDes": "Do you want to create a placeholder file and deduct user capacity when users start uploading? If enabled, Cloudreve will prevent users from maliciously initiating multiple upload requests but not completing the upload.", + "createPlaceholder": "Create placeholder files", + "notCreatePlaceholder": "Don't create" } } \ No newline at end of file diff --git a/public/locales/zh-CN/dashboard.json b/public/locales/zh-CN/dashboard.json index ab96544..0482f95 100644 --- a/public/locales/zh-CN/dashboard.json +++ b/public/locales/zh-CN/dashboard.json @@ -278,7 +278,7 @@ "policyAdded": "存储策略已添加", "policySaved": "存储策略已保存", "editLocalStoragePolicy": "修改本机存储策略", - "addLocalStoragePolicy": "添加存储策略", + "addLocalStoragePolicy": "添加本机存储策略", "optional": "可选", "pathMagicVarDes": "请在下方输入文件的存储目录路径,可以为绝对路径或相对路径(相对于 Cloudreve)。路径中可以使用魔法变量,文件在上传时会自动替换这些变量为相应值; 可用魔法变量可参考 <0>路径魔法变量列表0>。", "pathOfFolderToStoreFiles": "存储目录", @@ -357,6 +357,29 @@ "remoteAddress": "从机地址", "testCommunicationDes": "完成以上步骤后,你可以点击下方的测试按钮测试通信是否正常。", "testCommunication": "测试从机通信", - "pathMagicVarDesRemote": "请在下方输入文件的存储目录路径,可以为绝对路径或相对路径(相对于 从机的 Cloudreve)。路径中可以使用魔法变量,文件在上传时会自动替换这些变量为相应值; 可用魔法变量可参考 <0>路径魔法变量列表0>。" + "pathMagicVarDesRemote": "请在下方输入文件的存储目录路径,可以为绝对路径或相对路径(相对于 从机的 Cloudreve)。路径中可以使用魔法变量,文件在上传时会自动替换这些变量为相应值; 可用魔法变量可参考 <0>路径魔法变量列表0>。", + "storageBucket": "存储空间", + "editQiniuStoragePolicy": "修改七牛存储策略", + "addQiniuStoragePolicy": "添加七牛存储策略", + "qiniuSiteURLDes": "在使用七牛存储策略前,请确保您在 参数设置 - 站点信息 - 站点URL 中填写的 地址与实际相符,并且 <0>能够被外网正常访问0>。", + "createQiniuBucket": "前往 <0>七牛控制面板0> 创建对象存储资源。", + "enterQiniuBucket": "在下方填写您在七牛创建存储空间时指定的“存储空间名称”:", + "qiniuBucketName": "存储空间名称", + "bucketTypeDes": "在下方选择您创建的空间类型,推荐选择“私有空间”以获得更高的安全性,私有空间无法开启“获取直链”功能。", + "privateBucket": "私有", + "publicBucket": "公有", + "bucketCDNDes": "填写您为存储空间绑定的 CDN 加速域名。", + "bucketCDNDomain": "CDN 加速域名", + "qiniuCredentialDes": "在七牛控制面板进入 个人中心 - 密钥管理,在下方填写获得到的 AK、SK。", + "ak": "AK", + "sk": "SK", + "cannotEnableForPrivateBucket": "私有空间无法开启此功能", + "limitMimeType": "是否限制上传文件 MimeType?", + "mimeTypeDes": "输入允许上传的 MimeType,多个请以半角逗号 , 隔开。七牛服务器会侦测文件内容以判断 MimeType,再用判断值跟指定值进行匹配,匹配成功则允许上传。", + "mimeTypeList": "MimeType 列表", + "chunkSizeLabelQiniu": "请指定分片上传时的分片大小,范围 1 MB - 1 GB。", + "createPlaceholderDes": "是否要再用户开始上传时就创建占位符文件并扣除用户容量?开启后,可以防止用户恶意发起多个上传请求但不完成上传。", + "createPlaceholder": "创建占位符文件", + "notCreatePlaceholder": "不创建" } } \ No newline at end of file diff --git a/src/component/Admin/Policy/Guid/QiniuGuide.js b/src/component/Admin/Policy/Guid/QiniuGuide.js index 63d70e9..1e8153e 100644 --- a/src/component/Admin/Policy/Guid/QiniuGuide.js +++ b/src/component/Admin/Policy/Guid/QiniuGuide.js @@ -21,6 +21,8 @@ import { getNumber } from "../../../../utils"; import DomainInput from "../../Common/DomainInput"; import SizeInput from "../../Common/SizeInput"; import MagicVar from "../../Dialogs/MagicVar"; +import { Trans, useTranslation } from "react-i18next"; + const useStyles = makeStyles((theme) => ({ stepContent: { @@ -68,28 +70,29 @@ const useStyles = makeStyles((theme) => ({ const steps = [ { - title: "存储空间", + title: "storageBucket", optional: false, }, { - title: "上传路径", + title: "storagePathStep", optional: false, }, { - title: "直链设置", + title: "sourceLinkStep", optional: false, }, { - title: "上传设置", + title: "uploadSettingStep", optional: false, }, { - title: "完成", + title: "finishStep", optional: false, }, ]; export default function RemoteGuide(props) { + const { t } = useTranslation("dashboard", { keyPrefix: "policy" }); const classes = useStyles(); const history = useHistory(); @@ -185,7 +188,7 @@ export default function RemoteGuide(props) { ToggleSnackbar( "top", "right", - "存储策略已" + (props.policy ? "保存" : "添加"), + props.policy ? t("policySaved") : t("policyAdded"), "success" ); setActiveStep(5); @@ -203,7 +206,9 @@ export default function RemoteGuide(props) { return (