Skip to content

feat(i18n): add Portuguese (pt-BR) language support to entire frontend#1696

Open
PauloHenriqueJr wants to merge 3 commits intopaperclipai:masterfrom
PauloHenriqueJr:feat/i18n-portuguese-support
Open

feat(i18n): add Portuguese (pt-BR) language support to entire frontend#1696
PauloHenriqueJr wants to merge 3 commits intopaperclipai:masterfrom
PauloHenriqueJr:feat/i18n-portuguese-support

Conversation

@PauloHenriqueJr
Copy link
Copy Markdown

@PauloHenriqueJr PauloHenriqueJr commented Mar 24, 2026

Add complete internationalization infrastructure and Portuguese translations covering all pages, components, and UI strings in the Paperclip frontend.

What's included

  • New LanguageContext with automatic browser locale detection and localStorage persistence
  • New locale.ts with t() translation function and ~1450 en/pt-BR translation entries
  • Language toggle (EN/PT-BR) in the bottom bar of the layout
  • All 27+ pages translated (Dashboard, Issues, Agents, Skills, Settings, etc.)
  • All 60+ components translated (Sidebar, CommandPalette, dialogs, forms, cards, etc.)
  • Status labels, agent roles, dates, and currency formatted per locale
  • Migrated all legacy isPt ? "..." : "..." patterns to centralized t() calls

How it works

  • t("English key") returns the Portuguese translation when pt-BR is active, or falls back to English
  • Language preference is auto-detected from browser locale and persisted in localStorage
  • Components subscribe to language changes via useLanguage() hook for reactive re-renders

Files not translated (intentional)

  • DesignGuide.tsx — internal dev component showcase, not user-facing

Thinking Path:

  • Paperclip orchestrates AI agents for zero-human companies
  • The UI subsystem only supports English, limiting adoption in non-English markets
  • Portuguese-speaking users see a mix of translated and untranslated strings, creating
    inconsistent UX
  • A centralized i18n system with full pt-BR coverage addresses this gap
  • This pull request adds a complete translation infrastructure with ~1450 keys
  • The benefit is enabling Portuguese-speaking teams to use Paperclip natively, and establishing
    the pattern for future language additions

What Changed:

  • New ui/src/lib/locale.ts — centralized t() translation function with ~1450 en/pt-BR key
    pairs
  • New ui/src/context/LanguageContext.tsx — React context for language state, browser detection,
    and localStorage persistence
  • All 27+ pages updated to use t() for user-visible strings
  • All 60+ components updated — migrated inline isPt ? "pt" : "en" patterns to t() calls
  • ui/src/lib/utils.ts and ui/src/lib/timeAgo.ts updated for locale-aware formatting
  • Language toggle button added to Layout footer (EN / PT-BR)

Verification:

  • TypeScript compiles cleanly (tsc --noEmit — zero errors)
  • All 642 existing tests pass (no regressions)
  • Production build succeeds in ~9.5s
  • Manually verified all major pages in both EN and PT-BR
  • Language persists across page refreshes via localStorage
  • Browser locale auto-detection works (Portuguese browser → PT-BR default)

Risks:

  • Translation keys use English strings as keys — a typo in a key falls back to displaying the
    English string (safe degradation, never blank)
  • Components without useLanguage() hook won't re-render on language switch until next navigation
    (acceptable since language changes are infrequent)
  • DesignGuide.tsx intentionally not translated (internal dev tool)

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have run tests locally and they pass
  • I have added or updated tests where applicable
  • If this change affects the UI, I have included before/after screenshots
  • I have updated relevant documentation to reflect my changes
  • I have considered and documented any risks above
  • I will address all Greptile and reviewer comments before requesting merge

Add complete internationalization infrastructure and Portuguese translations
covering all pages, components, and UI strings in the Paperclip frontend.

## What's included

- New `LanguageContext` with automatic browser locale detection and localStorage persistence
- New `locale.ts` with `t()` translation function and ~1450 en/pt-BR translation entries
- Language toggle (EN/PT-BR) in the bottom bar of the layout
- All 27+ pages translated (Dashboard, Issues, Agents, Skills, Settings, etc.)
- All 60+ components translated (Sidebar, CommandPalette, dialogs, forms, cards, etc.)
- Status labels, agent roles, dates, and currency formatted per locale
- Migrated all legacy `isPt ? "..." : "..."` patterns to centralized `t()` calls

## How it works

- `t("English key")` returns the Portuguese translation when pt-BR is active,
  or falls back to English
- Language preference is auto-detected from browser locale and persisted in localStorage
- Components subscribe to language changes via `useLanguage()` hook for reactive re-renders

## Files not translated (intentional)

- `DesignGuide.tsx` — internal dev component showcase, not user-facing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 24, 2026

Too many files changed for review. (106 files found, 100 file limit)

PauloHenriqueJr and others added 2 commits March 24, 2026 16:04
Accept upstream removal of Join Requests section while keeping
all i18n translations intact.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Accept upstream refactor of IssuesSearchInput component
- Accept upstream removal of execution workspace options from IssueProperties
- Accept upstream portal-based mention dropdown in MarkdownEditor (keep t() on Project label)
- Accept upstream help text updates in agent-config-primitives (keep t() wrapper)
- Accept upstream new "mine" tab in Inbox (add pt-BR translation for "Inbox zero.")
- Keep all i18n translations intact

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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