From bdc57655d6dea1e2593f7a8e8e63fdf044797dfb Mon Sep 17 00:00:00 2001 From: qiongyu1999 <2694684348@qq.com> Date: Thu, 21 May 2026 17:00:28 +0800 Subject: [PATCH] localize handoff editor button --- apps/web/src/components/HandoffButton.tsx | 16 ++--- apps/web/src/i18n/locales/ar.ts | 6 ++ apps/web/src/i18n/locales/de.ts | 6 ++ apps/web/src/i18n/locales/en.ts | 6 ++ apps/web/src/i18n/locales/es-ES.ts | 6 ++ apps/web/src/i18n/locales/fa.ts | 6 ++ apps/web/src/i18n/locales/fr.ts | 6 ++ apps/web/src/i18n/locales/hu.ts | 6 ++ apps/web/src/i18n/locales/id.ts | 6 ++ apps/web/src/i18n/locales/it.ts | 6 ++ apps/web/src/i18n/locales/ja.ts | 6 ++ apps/web/src/i18n/locales/ko.ts | 6 ++ apps/web/src/i18n/locales/pl.ts | 6 ++ apps/web/src/i18n/locales/pt-BR.ts | 6 ++ apps/web/src/i18n/locales/ru.ts | 6 ++ apps/web/src/i18n/locales/th.ts | 6 ++ apps/web/src/i18n/locales/tr.ts | 6 ++ apps/web/src/i18n/locales/uk.ts | 6 ++ apps/web/src/i18n/locales/zh-CN.ts | 6 ++ apps/web/src/i18n/locales/zh-TW.ts | 6 ++ apps/web/src/i18n/types.ts | 6 ++ .../tests/components/HandoffButton.test.tsx | 61 +++++++++++++++++++ 22 files changed, 190 insertions(+), 7 deletions(-) create mode 100644 apps/web/tests/components/HandoffButton.test.tsx diff --git a/apps/web/src/components/HandoffButton.tsx b/apps/web/src/components/HandoffButton.tsx index 966936c0a1..593188fc64 100644 --- a/apps/web/src/components/HandoffButton.tsx +++ b/apps/web/src/components/HandoffButton.tsx @@ -11,6 +11,7 @@ import type { HostEditorsResponse, } from '@open-design/contracts'; import { fetchHostEditors, openProjectInEditor } from '../providers/registry'; +import { useT } from '../i18n'; import { Icon } from './Icon'; import { EditorIcon } from './EditorIcon'; @@ -42,6 +43,7 @@ function writePreferred(id: HostEditorId): void { } export function HandoffButton({ projectId, onRequestRevealInFinder }: Props) { + const t = useT(); const [editors, setEditors] = useState([]); const [platform, setPlatform] = useState('unknown'); const [loaded, setLoaded] = useState(false); @@ -135,7 +137,7 @@ export function HandoffButton({ projectId, onRequestRevealInFinder }: Props) {