From 7326796df258c8dbda1530ad8529cf7afa84d933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Salavisa?= Date: Sun, 2 Aug 2026 19:45:46 +0200 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20localize=20Settings=20=E2=86=92?= =?UTF-8?q?=20Integrations=20=E2=86=92=20GitLab=20(#2160)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kandev Agent Co-authored-by: Claude Opus 5 (1M context) --- .../gitlab/action-presets-section.tsx | 58 ++++--- .../components/gitlab/delete-watch-dialog.tsx | 15 +- .../web/components/gitlab/gitlab-settings.tsx | 98 +++++++----- .../gitlab/review-watch-table.test.tsx | 55 +++++++ apps/web/components/gitlab/watch-dialog.tsx | 127 +++++++++------ apps/web/components/gitlab/watch-form.ts | 5 + apps/web/components/gitlab/watch-settings.tsx | 86 +++++----- apps/web/components/gitlab/watch-table.tsx | 92 +++++++---- .../e2e/tests/gitlab/gitlab-watches.spec.ts | 3 +- apps/web/eslint.i18n.options.mjs | 24 +++ apps/web/src/locales/en/gitlab.json | 151 ++++++++++++++++++ apps/web/src/locales/pseudo/gitlab.json | 151 ++++++++++++++++++ 12 files changed, 680 insertions(+), 185 deletions(-) create mode 100644 apps/web/src/locales/en/gitlab.json create mode 100644 apps/web/src/locales/pseudo/gitlab.json diff --git a/apps/web/components/gitlab/action-presets-section.tsx b/apps/web/components/gitlab/action-presets-section.tsx index 99530561dc..ac22425b4b 100644 --- a/apps/web/components/gitlab/action-presets-section.tsx +++ b/apps/web/components/gitlab/action-presets-section.tsx @@ -13,7 +13,12 @@ import { useSettingsSaveContributor } from "@/components/settings/settings-save- import { useToast } from "@/components/toast-provider"; import { useGitLabActionPresets } from "@/hooks/domains/gitlab/use-gitlab-action-presets"; import type { GitLabActionPreset, GitLabActionPresets } from "@/lib/types/gitlab"; +import { useTranslation } from "react-i18next"; +// `label` is PERSISTED to workspace settings as part of `GitLabActionPreset`, and +// the row below is immediately editable, so it must stay locale-neutral: a preset +// seeded in one locale and saved unedited would keep that locale's text forever. +// Same contract as `newPreset` in components/github/action-presets-section.tsx. function newPreset(): GitLabActionPreset { return { id: `preset_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 7)}`, @@ -33,6 +38,7 @@ function PresetList({ onChange: (next: GitLabActionPreset[]) => void; addLabel: string; }) { + const { t } = useTranslation(); const patch = (index: number, change: Partial) => onChange( presets.map((preset, current) => (current === index ? { ...preset, ...change } : preset)), @@ -43,15 +49,15 @@ function PresetList({
patch(index, { label: event.target.value })} /> patch(index, { hint: event.target.value })} />