feat(desktop): add i18n infrastructure with French (fr) support - #38183
Open
Foolafroos wants to merge 1 commit into
Open
feat(desktop): add i18n infrastructure with French (fr) support#38183Foolafroos wants to merge 1 commit into
Foolafroos wants to merge 1 commit into
Conversation
- Add I18nProvider React context with useTranslation hook - Extract ~270 UI keys to en.json (source of truth) - Complete French translation in fr.json - Language selector dropdown in titlebar (subtle, locale code) - Locale persistence via localStorage with browser language fallback - Bilingual fallback copy in intro component - Zero TypeScript errors, tsc -b passes clean
5 tasks
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the French translation work. Current main already has a typed, config-backed desktop i18n system, while French itself is still not registered.
Problems
- This patch adds a second i18n implementation instead of extending the current contract:
apps/desktop/src/i18n/context.tsx:107-146persistsdisplay.language,types.ts:8defines supported locales, andcatalog.ts:7-12registers locale tables. The PR's JSON/localStorage provider conflicts with that architecture. - The diff only invokes the new string-key
t(...)API in the titlebar dropdown; itsLanguageSelectoris unused. Therefore the bundled French JSON does not translate the broader current UI, consistent with the PR body noting that JSX migration is deferred. - No tests cover French locale normalization, config persistence, or runtime fallback; existing conventions are in
apps/desktop/src/i18n/context.test.tsx:60-76,155-230andruntime.test.ts:18-74.
Suggested changes
- Salvage the French copy as a typed
frlocale registered throughtypes.ts,languages.ts, andcatalog.ts, using the existing provider anddisplay.languagepersistence. - Add French coverage alongside the existing context and runtime tests.
This is an automated hermes-sweeper review.
| return 'en' | ||
| } | ||
|
|
||
| // ---------- message loading ---------- |
Contributor
There was a problem hiding this comment.
Current main already has a config-backed I18nProvider and typed locale catalog. Please extend that contract with fr rather than adding a second JSON/dynamic-import provider; otherwise this conflicts with the established display.language persistence path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a scalable internationalization (i18n) layer to the Hermes Agent desktop app, with complete French (
fr) support. The architecture is designed so additional languages can be added by simply dropping in a new.jsonfile — zero refactoring required.What changed
New files
apps/desktop/src/i18n/context.tsxI18nProviderReact Context +useTranslation()hook. Lazy-loads locale bundles, falls back to EN, persists choice inlocalStoragewith browser language detection.apps/desktop/src/i18n/index.tsapps/desktop/src/i18n/messages/en.jsonapps/desktop/src/i18n/messages/fr.jsonapps/desktop/src/i18n/language-selector.tsxLanguageSelectorcomponent (unused — language dropdown is built directly into titlebar for subtlety)Modified files
apps/desktop/src/main.tsx<I18nProvider>above<ThemeProvider>in the root treeapps/desktop/src/app/shell/titlebar-controls.tsxLanguageDropdown— subtle locale code button (e.g.EN/FR) in the titlebar system tools, between haptics and settingsapps/desktop/src/components/chat/intro.tsxArchitecture
XX.jsontomessages/+ one line inLOCALESarraylocalStorageValidation
tsc -b— zero TypeScript errorsen.jsonandfr.jsonlocales/en.yaml↔locales/fr.yamlalready alignedScreenshots
The language selector appears as a subtle locale code in the titlebar:
Clicking it opens a dropdown to switch between English and Français.
Note: This PR only wires the infrastructure and translates the UI layer. Replacing every individual hardcoded string with
t("key")calls across all 1200+ JSX text nodes is a follow-up — but the system is ready to consume them.