Skip to content

Language dropdown selection on overview page resets to English after refresh #48015

@git-jxj

Description

@git-jxj

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

  1. Go to the Overview page.
  2. Under Gateway Access, select any language other than English from the language dropdown.
  3. Observe the UI is translated correctly.
  4. Refresh the page.
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions