From 0967ad51458ec848d8e34296c30073d89a8164a1 Mon Sep 17 00:00:00 2001 From: hjlarry Date: Sun, 12 Apr 2026 16:38:57 +0800 Subject: [PATCH] fix(web): localize workflow comments panel filters across locales --- .../panel/comments-panel/__tests__/index.spec.tsx | 6 +++--- .../components/workflow/panel/comments-panel/index.tsx | 8 ++++---- web/i18n/ar-TN/workflow.json | 4 ++++ web/i18n/de-DE/workflow.json | 4 ++++ web/i18n/en-US/workflow.json | 4 ++++ web/i18n/es-ES/workflow.json | 4 ++++ web/i18n/fa-IR/workflow.json | 4 ++++ web/i18n/fr-FR/workflow.json | 4 ++++ web/i18n/hi-IN/workflow.json | 4 ++++ web/i18n/id-ID/workflow.json | 4 ++++ web/i18n/it-IT/workflow.json | 4 ++++ web/i18n/ja-JP/workflow.json | 4 ++++ web/i18n/ko-KR/workflow.json | 4 ++++ web/i18n/nl-NL/workflow.json | 4 ++++ web/i18n/pl-PL/workflow.json | 4 ++++ web/i18n/pt-BR/workflow.json | 4 ++++ web/i18n/ro-RO/workflow.json | 4 ++++ web/i18n/ru-RU/workflow.json | 4 ++++ web/i18n/sl-SI/workflow.json | 4 ++++ web/i18n/th-TH/workflow.json | 4 ++++ web/i18n/tr-TR/workflow.json | 4 ++++ web/i18n/uk-UA/workflow.json | 4 ++++ web/i18n/vi-VN/workflow.json | 4 ++++ web/i18n/zh-Hans/workflow.json | 4 ++++ web/i18n/zh-Hant/workflow.json | 4 ++++ 25 files changed, 99 insertions(+), 7 deletions(-) diff --git a/web/app/components/workflow/panel/comments-panel/__tests__/index.spec.tsx b/web/app/components/workflow/panel/comments-panel/__tests__/index.spec.tsx index fcb93b68f2..cec6bc1a94 100644 --- a/web/app/components/workflow/panel/comments-panel/__tests__/index.spec.tsx +++ b/web/app/components/workflow/panel/comments-panel/__tests__/index.spec.tsx @@ -132,8 +132,8 @@ describe('CommentsPanel', () => { expect(screen.getByText('my open thread')).toBeInTheDocument() expect(screen.getByText('others resolved thread')).toBeInTheDocument() - fireEvent.click(screen.getByLabelText('Filter comments')) - fireEvent.click(screen.getByText('Only your threads')) + fireEvent.click(screen.getByLabelText('workflow.comments.aria.filterComments')) + fireEvent.click(screen.getByText('workflow.comments.filter.onlyYourThreads')) expect(screen.queryByText('others resolved thread')).not.toBeInTheDocument() expect(screen.getByText('my open thread')).toBeInTheDocument() @@ -159,7 +159,7 @@ describe('CommentsPanel', () => { it('toggles show-resolved state from filter panel switch', () => { render() - fireEvent.click(screen.getByLabelText('Filter comments')) + fireEvent.click(screen.getByLabelText('workflow.comments.aria.filterComments')) fireEvent.click(screen.getByTestId('show-resolved-switch')) expect(mockSetShowResolvedComments).toHaveBeenCalledWith(false) diff --git a/web/app/components/workflow/panel/comments-panel/index.tsx b/web/app/components/workflow/panel/comments-panel/index.tsx index 6b1c1efe43..744e3899df 100644 --- a/web/app/components/workflow/panel/comments-panel/index.tsx +++ b/web/app/components/workflow/panel/comments-panel/index.tsx @@ -75,7 +75,7 @@ const CommentsPanel = () => { 'group flex h-6 w-6 items-center justify-center rounded-md hover:bg-state-accent-active', hasActiveFilter && 'bg-state-accent-active', )} - aria-label="Filter comments" + aria-label={t('comments.aria.filterComments', { ns: 'workflow' })} onClick={() => setShowFilter(v => !v)} > { setShowFilter(false) }} > - All + {t('comments.filter.all', { ns: 'workflow' })} {!showOnlyMine && } @@ -113,7 +113,7 @@ const CommentsPanel = () => { e.stopPropagation() }} > - Show resolved + {t('comments.filter.showResolved', { ns: 'workflow' })}