-
-
Notifications
You must be signed in to change notification settings - Fork 69.2k
Language dropdown selection on overview page resets to English after refresh #48015
Description
Bug Description
When selecting a different language (e.g. 简体中文) from the language dropdown on the overview page, the UI updates to the selected language successfully. However, upon refreshing the page, the dropdown value resets and gets stuck on "English" despite the UI remaining in the correctly selected language.
Steps to Reproduce
- Go to the Overview page.
- Under Gateway Access, select any language other than English from the language dropdown.
- Observe the UI is translated correctly.
- Refresh the page.
- Observe that while the UI is still in the selected language, the dropdown menu shows "English".
Cause & Solution
This is a race condition between Lit's rendering and the asynchronous loading of the i18n locale translations. Before the translations are fully loaded, i18n.getLocale() returns the fallback locale ("en"). Lit evaluates this, sets the <select> value to "en", and even when it re-renders after the locale is loaded, the DOM state might not correctly reflect the change without an explicit ?selected binding.