Skip to content

fix(thread): translate the branch picker's PR-tab strings - #5273

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/branch-picker-pr-tab-i18n-strings
Jul 27, 2026
Merged

fix(thread): translate the branch picker's PR-tab strings#5273
pedrofrxncx merged 1 commit into
mainfrom
fix/branch-picker-pr-tab-i18n-strings

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Source

Repo-wide i18n rule (CLAUDE.md): "Never hardcode user-facing strings in apps/web/src". BranchPicker's "Branches" tab already goes through t(), but its "PRs" tab — added in a later PR — hardcoded every one of its strings in English.

Why

pt-BR users hit raw English text ("Search pull requests…", "Branches"/"PRs" tab labels, loading/error/empty states, the open-PRs group heading, the fork-hidden-count footer, and the "Last 7 days" branch group heading) inside an otherwise fully-translated picker. This is the same proven i18n-hardening lane as #5048/#5062/#5099/#5110/#5141/#5170/#5214/#5218.

Changes

  • apps/web/src/components/thread/github/branch-picker.tsx — replaced 9 hardcoded strings with t("thread.branchPicker.*") calls (tab labels, PR loading/error/empty states, open-PRs heading, hidden-fork-count message with {count} interpolation, and the "Last 7 days" branch group heading).
  • apps/web/src/i18n/en/thread.ts / apps/web/src/i18n/pt-br/thread.ts — added the matching thread.branchPicker.* keys (pt-BR mirrors English exactly, following the existing pattern in this dictionary).

No logic change — pure string extraction, same behavior in English, now translated in pt-BR.

How to verify

  • cd apps/web && bunx tsc --noEmit — the satisfies Record<keyof typeof enDomain, string> constraint on pt-br/thread.ts fails to compile if a key is missing, so a clean typecheck proves translation completeness.
  • Manually: open a repo-linked thread's branch picker, switch to the "PRs" tab with the pt-BR language preference set, confirm every label renders in Portuguese.

Local checks run

  • bun run fmt — clean.
  • bunx tsc --noEmit in apps/web — clean (this also validates translation-key completeness, see above).
  • No unit test added: this is a pure i18n string-key substitution (no branching logic touched), matching prior i18n-only PRs in this repo (e.g. fix(i18n): translate assignee picker strings #5170) which didn't add tests either. Full CI (lint, other workspaces) will run on the PR.

Summary by cubic

Localized the Branch Picker PR tab by moving all user-facing strings to i18n. This fixes untranslated English text for pt-BR users and aligns with the repo i18n rule.

  • Bug Fixes
    • Replaced 9 hardcoded PR-tab strings in apps/web/src/components/thread/github/branch-picker.tsx with t("thread.branchPicker.*") (search placeholder, tab labels, loading/error/empty states, open-PRs heading, hidden fork count with {count}, and "Last 7 days").
    • Added matching keys in apps/web/src/i18n/en/thread.ts and apps/web/src/i18n/pt-br/thread.ts.

Written for commit 4b74aa5. Summary will update on new commits.

Review in cubic

The branches tab already went through i18n, but the PR tab (added later)
hardcoded its labels/messages in English, so pt-BR users saw untranslated
"Search pull requests…", "Branches"/"PRs" tabs, loading/empty states, and
the fork-hidden-count message.
@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) July 27, 2026 18:43
@pedrofrxncx
pedrofrxncx merged commit 37822b0 into main Jul 27, 2026
20 of 21 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/branch-picker-pr-tab-i18n-strings branch July 27, 2026 18:45
decocms Bot pushed a commit that referenced this pull request Jul 27, 2026
PR: #5273 fix(thread): translate the branch picker's PR-tab strings
Bump type: patch

- decocms (apps/api/package.json): 4.133.7 -> 4.133.8

Deploy-Scope: web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant