Files
orca/config/scripts
18b5ee3a4f fix(i18n): re-render memoized translated UI on language changes (#35358)
* fix(i18n): re-render memoized translated UI on language and catalog changes

Memoized components and useMemo/module caches that call translate() kept the
previous language after a switch or a plugin language-pack reload, because
react-i18next only re-renders components that subscribe themselves.

Add useUiLanguageRevision() (language + catalog revision via
useSyncExternalStore), call it in the 34 memoized translating components, key
translated useMemo results and module caches on it, and add a ratchet so new
memoized translating components must subscribe.

Fixes the composer pickers reported in #34783.

Co-authored-by: Vyacheslav Scherbinin <14369958+gentslava@users.noreply.github.com>

* fix(i18n): drive the language revision from the resource version

Tests that mock @/i18n/i18n have no i18n instance, so subscribe through
translation-resource-version (now also bumped on languageChanged) and give
useSyncExternalStore a server snapshot for renderToString tests.

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
Co-authored-by: Vyacheslav Scherbinin <14369958+gentslava@users.noreply.github.com>
2026-10-28 14:49:02 -07:00
..