diff --git a/desktop/renderer-app/src/components/AppUpgradeModal/index.tsx b/desktop/renderer-app/src/components/AppUpgradeModal/index.tsx index 8165b003a1b..32e5ea89dd3 100644 --- a/desktop/renderer-app/src/components/AppUpgradeModal/index.tsx +++ b/desktop/renderer-app/src/components/AppUpgradeModal/index.tsx @@ -3,6 +3,7 @@ import { Button, Modal } from "antd"; import { observer } from "mobx-react-lite"; import React, { useEffect, useState } from "react"; import { ipcAsyncByMainWindow, ipcReceive, ipcReceiveRemove } from "../../utils/ipc"; +import { useTranslation } from "react-i18next"; export interface AppUpgradeModalProps { /** open modal when newVersion has truthy value */ @@ -15,6 +16,7 @@ export const AppUpgradeModal = observer(function AppUpgrad newVersion, onClose, }) { + const { t } = useTranslation(); const [upgradePercent, setUpgradePercent] = useState(0); const [showUpgradeProgress, setShowUpgradeProgress] = useState(false); const [upgradeFail, setUpgradeFail] = useState(false); @@ -37,7 +39,7 @@ export const AppUpgradeModal = observer(function AppUpgrad }, [showUpgradeProgress]); const renderModalTitle = (): React.ReactNode => { - return
版本更新
; + return
{t("version-updates")}
; }; const cancelUpgrade = (): void => { @@ -64,7 +66,7 @@ export const AppUpgradeModal = observer(function AppUpgrad {showUpgradeProgress ? (
- 下载中 ({upgradePercent.toFixed(2)}%)... + {t("downloading")} ({upgradePercent.toFixed(2)}%)...
(function AppUpgrad >
{upgradeFail && (
- 更新失败,请重新打开程序 + + {t("update-failed-tips")} +
@@ -85,11 +89,11 @@ export const AppUpgradeModal = observer(function AppUpgrad ) : (
- 发现新版本{newVersion || " "}, 请更新到最新版本获取更好的产品体验 + {t("new-version-tips", { version: newVersion || " " })}
diff --git a/packages/flat-components/src/containers/CloudStorageContainer/index.tsx b/packages/flat-components/src/containers/CloudStorageContainer/index.tsx index fe6a5ebe085..86bf05b42df 100644 --- a/packages/flat-components/src/containers/CloudStorageContainer/index.tsx +++ b/packages/flat-components/src/containers/CloudStorageContainer/index.tsx @@ -9,6 +9,7 @@ import { CloudStorageUploadPanel } from "../../components/CloudStorage"; import { CloudStorageUploadListContainer } from "./CloudStorageUploadListContainer"; import { CloudStorageFileListContainer } from "./CloudStorageFileListContainer"; import classNames from "classnames"; +import { useTranslation } from "react-i18next"; export * from "./store"; @@ -20,6 +21,7 @@ export interface CloudStorageContainerProps { /** CloudStorage page with MobX Store */ export const CloudStorageContainer = observer( function CloudStorageContainer({ store }) { + const { t } = useTranslation(); const containerBtns = (
); + (window as any).aaa = store; + return (
{!store.compact && (
-

我的云盘

+

{t("my-cloud ")}

- {store.totalUsageHR ? `已使用 ${store.totalUsageHR}` : "-"} + {store.totalUsageHR + ? t("used-storage", { usage: store.totalUsageHR }) + : "-"}
{containerBtns} diff --git a/packages/flat-i18n/locales/en.json b/packages/flat-i18n/locales/en.json index 3aded21b42a..e70a3ca3d19 100644 --- a/packages/flat-i18n/locales/en.json +++ b/packages/flat-i18n/locales/en.json @@ -158,5 +158,14 @@ "roomtype": "Room type: ", "theme": "Theme", "theme-can-be-up-to-50-characters": "Subject is up to 50 characters", - "type": "Type" + "type": "Type", + "delete": "Delete", + "my-cloud ": "My cloud disk", + "upload": "Upload", + "used-storage": "Used {{usage}}", + "downloading": "Downloading", + "new-version-tips": "Found a new version: {{version}}, please update to the latest version for a better product experience", + "update-failed-tips": "Update failed, please reopen the program", + "update-now": "Update immediately", + "version-updates": "New version update" } diff --git a/packages/flat-i18n/locales/zh-CN.json b/packages/flat-i18n/locales/zh-CN.json index 3eb7ca379ee..020a52bfb40 100644 --- a/packages/flat-i18n/locales/zh-CN.json +++ b/packages/flat-i18n/locales/zh-CN.json @@ -158,5 +158,14 @@ "maximum-of-50-rooms-allowed": "最多允许预定 50 个房间", "end-series-date-cannot-be-less-than-the-begin-time-date": "结束重复日期不能小于开始时间日期", "periodic-room-tip": "结束于 {{date}},共 {{rate}} 个房间", - "room-duration-limit": "房间时长最少 {{minutes}} 分钟" + "room-duration-limit": "房间时长最少 {{minutes}} 分钟", + "used-storage": "已使用 {{usage}}", + "delete": "删除", + "upload": "上传", + "my-cloud ": "我的云盘", + "version-updates": "版本更新", + "downloading": "下载中", + "update-failed-tips": "更新失败,请重新打开程序", + "update-now": "立即更新", + "new-version-tips": "发现新版本:{{version}}, 请更新到最新版本获取更好的产品体验" }