Skip to content

feat(i18n): add internationalization support - #3523

Merged
setchy merged 10 commits into
mainfrom
feat/i18n-support
Oct 29, 2026
Merged

setchy merged 10 commits into
mainfrom
feat/i18n-support

Conversation

@setchy

@setchy setchy commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds i18n support to the renderer using i18next / react-i18next. English is the only language for now; adding one is a locale file plus a list entry (see CONTRIBUTING → Translations).

Refs #1952.

How it works

  • English lives in code: t('key', 'English'), and <Trans defaults="…"> for sentences with markup. en.json is generated by pnpm i18n:extract.
  • The app follows the OS language until the user picks one; only an explicit choice is saved.
  • The Language selector stays hidden until a second language ships.

CI checks

  • i18n:check: locale files in sync, every t()/<Trans> has an English default, no empty values in en.json.
  • i18n:lint: fails on hardcoded strings and split sentences.

Not in scope (needed once a second language lands)

Plurals, date formatting, <html lang>, and main-process strings (tray menu, native notifications).

setchy added 2 commits October 4, 2026 17:02
Signed-off-by: Adam Setch <adam.setch@outlook.com>
# Conflicts:
#	CONTRIBUTING.md
#	package.json
#	pnpm-lock.yaml
#	src/renderer/__helpers__/vitest.setup.ts
#	src/renderer/components/AllRead.tsx
#	src/renderer/components/Sidebar.tsx
#	src/renderer/components/filters/AccountFilter.tsx
#	src/renderer/components/filters/ReasonFilter.tsx
#	src/renderer/components/filters/RequiresDetailedNotificationsWarning.tsx
#	src/renderer/components/filters/ReviewRequestTypeFilter.tsx
#	src/renderer/components/filters/SearchFilter.tsx
#	src/renderer/components/filters/StateFilter.tsx
#	src/renderer/components/filters/SubjectTypeFilter.tsx
#	src/renderer/components/filters/UserTypeFilter.tsx
#	src/renderer/components/icons/VolumeDownIcon.tsx
#	src/renderer/components/icons/VolumeUpIcon.tsx
#	src/renderer/components/layout/AppLayout.tsx
#	src/renderer/components/login/LoginWithPersonalAccessTokenForm.tsx
#	src/renderer/components/metrics/CommentsPill.tsx
#	src/renderer/components/metrics/LinkedIssuesPill.tsx
#	src/renderer/components/metrics/ParentPill.tsx
#	src/renderer/components/metrics/StackedPrsPill.tsx
#	src/renderer/components/notifications/AccountHeader.tsx
#	src/renderer/components/notifications/NotificationHeader.tsx
#	src/renderer/components/notifications/NotificationRow.test.tsx
#	src/renderer/components/notifications/NotificationRow.tsx
#	src/renderer/components/notifications/RepositoryHeader.tsx
#	src/renderer/components/primitives/Header.tsx
#	src/renderer/components/settings/AppearanceSettings.tsx
#	src/renderer/components/settings/NotificationSettings.tsx
#	src/renderer/components/settings/SettingsFooter.tsx
#	src/renderer/components/settings/SettingsReset.tsx
#	src/renderer/components/settings/SystemSettings.tsx
#	src/renderer/components/settings/TraySettings.tsx
#	src/renderer/hooks/useNotifications.ts
#	src/renderer/routes/AccountScopes.tsx
#	src/renderer/routes/Accounts.test.tsx
#	src/renderer/routes/Accounts.tsx
#	src/renderer/routes/Filters.tsx
#	src/renderer/routes/Login.tsx
#	src/renderer/routes/Notifications.tsx
#	src/renderer/routes/Settings.tsx
#	src/renderer/routes/__snapshots__/Login.test.tsx.snap
#	src/renderer/routes/__snapshots__/Settings.test.tsx.snap
#	src/renderer/routes/bitbucket/LoginWithPersonalAccessToken.tsx
#	src/renderer/routes/gitea/LoginWithPersonalAccessToken.tsx
#	src/renderer/routes/github/LoginWithDeviceFlow.tsx
#	src/renderer/routes/github/LoginWithGitHubCLI.tsx
#	src/renderer/routes/github/LoginWithOAuthApp.tsx
#	src/renderer/routes/github/LoginWithPersonalAccessToken.tsx
#	src/renderer/routes/gitlab/LoginWithPersonalAccessToken.tsx
#	src/renderer/routes/gitlab/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap
#	src/renderer/utils/notifications/filters/reviewRequestType.ts
#	src/renderer/utils/notifications/filters/state.ts
#	src/renderer/utils/notifications/filters/subjectType.ts
#	src/renderer/utils/notifications/filters/userType.ts
#	src/renderer/utils/notifications/reason.ts
#	src/renderer/utils/ui/icons.ts
@github-actions github-actions Bot added dependency Dependency updates enhancement New feature or enhancement to existing functionality labels Oct 25, 2026
Resolve conflicts with #3449, #3557, #3558 and the metric pill changes:
keep main's structure (device-flow wrapper, custom OAuth app, removed
test IDs, chevron directions) and wrap its strings for translation.
Translate the screens main added since this branch was cut
(DeviceFlowAuthorize, LoginWithCustomOAuthApp, device-flow start errors,
ScopeStatusIcon, HelpPopover) and regenerate en.json.
Port Atlassify's check-t-defaults and check-en-locales guards, adapted to
Gitify's t('key', 'English') form and <Trans defaults>. Document the
convention, the <Trans> rule for marked-up sentences, and the
--trust-derived pitfall in CONTRIBUTING.
@setchy
setchy marked this pull request as ready for review October 29, 2026 01:02
@setchy
setchy requested a review from afonsojramos as a code owner October 29, 2026 01:02
- Resolve regional locales to their base language and restrict detection
  to supported languages; only persist an explicit choice (setLanguage).
- Hide the language selector until a second locale ships.
- Fail CI on hardcoded strings and split sentences (i18n:lint).
- Load i18n first in the test setup.
@sonarqubecloud

Copy link
Copy Markdown

@setchy
setchy merged commit f5b1698 into main Oct 29, 2026
23 checks passed
@setchy
setchy deleted the feat/i18n-support branch October 29, 2026 01:46
@github-actions github-actions Bot added this to the Release 8.0.0 milestone Oct 29, 2026
setchy added a commit that referenced this pull request Oct 29, 2026
…e-alerts

Resolve conflicts with #3449 (drop the retired auth callback from preload),
#3523 (i18n) and #3530 (TSDoc): translate the new Alerts settings and the
native summary notification, keep the native-notification contributor notes
alongside the Translations guide, and document the new preload/shared APIs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency Dependency updates enhancement New feature or enhancement to existing functionality

Development

Successfully merging this pull request may close these issues.

1 participant