Custom sidebar section translations break after changing the site's default locale

Hello :waving_hand:

[EDGE CASE]

There is an issue with the translation/localization feature for Custom Sidebar Sections/Links.

If a custom sidebar section or link is created while the site’s default locale setting is set to Language A (e.g., English), but the site’s default locale is later changed to Language B (e.g., Hungarian), the existing custom sidebar records do not adapt to the new default locale.

As a result, the UI misinterprets the base/default input field, causing language options in the translation dropdown to be completely swapped and scrambled.

Steps to Reproduce

  1. Set default locale Site Setting to English.

  2. Create a new custom sidebar section/link, but enter the text in Hungarian (because the user locale was Hungarian for me) (e.g., set base label as "Főoldal" and path as "/"). I didn’t localized it because there wasn’t a feature to do this yet.

  3. Change the site’s default locale Site Setting to Hungarian (hu).

  4. Edit the custom sidebar section created in Step 2 and try to translate it:

    • Observed behavior: The system now assumes the base input field ("Főoldal") is the Hungarian base value because the site default is Hungarian.

    • In the translation dropdown, Hungarian is no longer available (since it’s now treated as the base language), but English appears as a selectable translation option.

    • Selecting English in the dropdown and entering the English translation ("Homepage") causes the localized values to be inverted or mismapped.

Thanks