#23792: fix(i18n): trigger UI re-render on page load by calling notify() in loadLocale()
app: web-ui
size: XS
Cluster:
Multilingual Support Enhancements
## Summary
Fixes #23784
When the page loads, loadLocale() reads the saved locale from localStorage but does not trigger a UI re-render. The notify() method was only called when setLocale() was explicitly invoked by the user. This caused the UI to remain in English even though the correct language was selected in the dropdown.
## Changes
- Add `this.notify()` at the end of `loadLocale()` method in `ui/src/i18n/lib/translate.ts`
This fix ensures the UI updates immediately when the page loads with a saved locale.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added `this.notify()` call at the end of `loadLocale()` method to trigger UI re-render when the page loads with a saved locale from localStorage. Previously, the UI remained in English even when a different locale was saved because subscribers weren't notified during initialization. The fix ensures that the `I18nController` (which uses the subscribe mechanism) receives the initial locale state and can trigger UI updates via `requestUpdate()`.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The fix is a single-line addition that correctly addresses the root cause. The `notify()` method is already used in `setLocale()` to trigger UI updates, and applying the same pattern to `loadLocale()` ensures consistency. The change follows the existing architecture (subscriber pattern) and has no side effects since `notify()` is idempotent and subscribers are designed to be called multiple times.
- No files require special attention
<sub>Last reviewed commit: 03b1ff7</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#21619: fix(i18n): load saved locale translations on page refresh
by zerone0x · 2026-02-20
82.3%
#23813: Fix UI locale persistence
by kamal-ayman · 2026-02-22
74.7%
#22165: feat(i18n): translate hardcoded button labels to all 4 locales
by NikolaVujovic1988 · 2026-02-20
73.3%
#13622: feat(i18n): add complete multi-language support (EN, TR, FR, DE)
by vaur94 · 2026-02-10
73.2%
#10657: feat(ui): add i18n support with English, Chinese, and Portuguese
by SalimBinYousuf1 · 2026-02-06
71.7%
#20408: Control UI: show refresh in-flight state on Overview
by tanyabrownmac · 2026-02-18
70.1%
#22332: i18n: add Korean (ko-KR) locale support
by arusia88 · 2026-02-21
69.7%
#9490: Add Internationalization (i18n) Support
by luuman · 2026-02-05
69.4%
#21617: feat(i18n): added korean locale
by Jaejuna · 2026-02-20
68.1%
#10275: feat: add multiligual support for UI
by fmyuan2000 · 2026-02-06
67.9%