refactor(i18n): share i18next across Electron processes - #1529
Merged
ewen-poch merged 4 commits intoAug 25, 2026
Conversation
roxi3906
marked this pull request as ready for review
August 21, 2026 08:29
roxi3906
marked this pull request as draft
August 21, 2026 09:05
roxi3906
force-pushed
the
codex/refactor/main-process-i18next
branch
4 times, most recently
from
August 24, 2026 03:33
ea87a7a to
aae77e6
Compare
roxi3906
marked this pull request as ready for review
August 24, 2026 07:27
roxi3906
force-pushed
the
codex/refactor/main-process-i18next
branch
5 times, most recently
from
August 25, 2026 01:50
f2480fd to
cd0bc18
Compare
roxi3906
force-pushed
the
codex/refactor/main-process-i18next
branch
from
August 25, 2026 06:54
cd0bc18 to
a30dfd2
Compare
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.
Problem
The renderer used i18next with complete locale catalogs, while Electron main separately maintained native-message maps, manual interpolation, and a Notebook-specific plural branch. Catalog authorship was also split physically between renderer files and shared namespace files.
Architecture
Before:
replaceAllinterpolation, andIntl.PluralRuleskey switchingAfter:
src/shared/i18nowns process-neutral instance initialization, direct-English fallback, interpolation, plural behavior, resource assembly, and six authoritative locale filescommon,native, andrenderernamespace objectscommon+nativecommon+renderer, and addsinitReactI18nextonly in its adapterLocalePreferenceOwnerremains main's locale authority, so startup, tray, and dialog copy works before renderer creation and changes immediately with the preferenceNativeTranslatorremains the small main-process call interface; no renderer import or translation IPC is introducedCatalog ownership
common: copy whose meaning and reviewed translation are identical in both processesnative: tray, Electron dialog, picker, export, and Notebook-conflict copyrenderer: React UI copy, including context-specific meanings that must not be shared merely because the English key matchessrc/shared/i18n/locales; namespace keys are pairwise disjoint in every localecommonowner; distinct meanings use explicit context such asReload_windowLOCALE_SELF_NAMES, not dormant translation entriesConflict resolution
The branch is rebased onto current
upstream/mainee88badc.Author: {{author}}andPublisher: {{publisher}}, removesBy {{publisher}}, and preserves both placeholdersImport Connector configurationalready had a shared owner; after feat(connectors): add MCP config transfer #1698 removed its renderer consumer, the unchanged reviewed translation moved fromcommontonativecommonandnativevalues stayed unchanged, no namespace overlap was introduced, andsrc/renderer/src/localesremains deletedPlural behavior
keySeparator: falseandnsSeparator: falsedefaultValue_oneBundle impact
out/mainJS chunks exclude renderer-only Russian MCP transfer sentinels while retaining native Connector-picker and Notebook sentinelsVerification
npm run typechecknpm run lint: 0 errors and 0 warningsgit diff --check upstream/main...HEADnpm run buildThe Windows global classifier coverage test still exposes an upstream #1695 baseline gap for
restricted-runtime-profile.ts; the same gap exists at the fixed base and neither that production file nor the classifier implementation is changed by this PR.Rollback
Revert the four task commits in reverse order:
a30dfd22- strict single-owner catalog contracts, technical-term guards, and contextual reload ownership1a9fb2be- guard, fallback, E2E, and ownership hardening8461c8db- single-file shared locale catalogsdc093872- shared i18next architecture and main-process migrationNo persisted-settings schema or data migration is involved. This remains an independent PR against
main; it does not reuse or modify the merged Russian-localization branch or PR #1443.Authors