From b32a427ecd29cb74da541de03d8d1137b4f40d99 Mon Sep 17 00:00:00 2001 From: JimmFly <447268514@qq.com> Date: Wed, 6 Dec 2023 08:13:56 +0000 Subject: [PATCH] chore: adjust banner content text (#5153) ![image](https://github.com/toeverything/AFFiNE/assets/102217452/86a77f1f-1be5-4d05-bdfa-9e1b321c0d9e) --- .../components/affine-banner/local-demo-tips.tsx | 14 +++++++------- packages/frontend/i18n/src/resources/en.json | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/frontend/component/src/components/affine-banner/local-demo-tips.tsx b/packages/frontend/component/src/components/affine-banner/local-demo-tips.tsx index ea251d895a..770ab3340a 100644 --- a/packages/frontend/component/src/components/affine-banner/local-demo-tips.tsx +++ b/packages/frontend/component/src/components/affine-banner/local-demo-tips.tsx @@ -1,4 +1,5 @@ import { Button, IconButton } from '@affine/component/ui/button'; +import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { CloseIcon } from '@blocksuite/icons'; import { useCallback } from 'react'; @@ -17,13 +18,10 @@ export const LocalDemoTips = ({ onLogin, onEnableCloud, }: LocalDemoTipsProps) => { - const content = isLoggedIn - ? 'This is a local demo workspace, and the data is stored locally. We recommend enabling AFFiNE Cloud.' - : 'This is a local demo workspace, and the data is stored locally in the browser. We recommend Enabling AFFiNE Cloud or downloading the client for a better experience.'; - + const t = useAFFiNEI18N(); const buttonLabel = isLoggedIn - ? 'Enable AFFiNE Cloud' - : 'Sign in with AFFiNE Cloud'; + ? t['Enable AFFiNE Cloud']() + : t['Sign in and Enable'](); const handleClick = useCallback(() => { if (isLoggedIn) { @@ -34,7 +32,9 @@ export const LocalDemoTips = ({ return (
-
{content}
+
+ {t['com.affine.banner.local-warning']()} +
diff --git a/packages/frontend/i18n/src/resources/en.json b/packages/frontend/i18n/src/resources/en.json index 22f5d6072f..70ede531fa 100644 --- a/packages/frontend/i18n/src/resources/en.json +++ b/packages/frontend/i18n/src/resources/en.json @@ -480,6 +480,7 @@ "com.affine.auth.toast.title.signed-in": "Signed in", "com.affine.backButton": "Back", "com.affine.banner.content": "This demo is limited. <1>Download the AFFiNE Client for the latest features and Performance.", + "com.affine.banner.local-warning": "Your local data is stored in the browser and may be lost. Don't risk it - enable cloud now!", "com.affine.brand.affineCloud": "AFFiNE Cloud", "com.affine.cloudTempDisable.description": "We are upgrading the AFFiNE Cloud service and it is temporarily unavailable on the client side. If you wish to stay updated on the progress and be notified on availability, you can fill out the <1>AFFiNE Cloud Signup.", "com.affine.cloudTempDisable.title": "AFFiNE Cloud is upgrading now.",