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

**URL:** https://meta.discourse.org/t/custom-sidebar-section-translations-break-after-changing-the-sites-default-locale/408327
**Category:** Bug
**Tags:** sidebar, localization, fixed
**Created:** [23 juli 2026 om 05:30 UTC](https://meta.discourse.org/t/custom-sidebar-section-translations-break-after-changing-the-sites-default-locale/408327 "2026-07-23T05:30:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [23 juli 2026 om 05:30 UTC](https://meta.discourse.org/t/custom-sidebar-section-translations-break-after-changing-the-sites-default-locale/408327/1 "2026-07-23T05:30:33Z")

</div>

Hello 👋

**[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:

Thanks

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [24 juli 2026 om 16:35 UTC](https://meta.discourse.org/t/custom-sidebar-section-translations-break-after-changing-the-sites-default-locale/408327/2 "2026-07-24T16:35:56Z")

</div>

I gave this one a quick shot

> <https://github.com/discourse/discourse/pull/42027>
>
> Previously, the custom sidebar section editor and the server assumed a section's… base title and link names were written in the site's current \*default\* locale, so changing the default locale scrambled which language each stored value mapped to and offered the wrong set of translation targets (\[meta\](https://meta.discourse.org/t/408327)).
> 
> This change keys the editor, the same-locale de-duplication and the collision cleanup off each record's own source locale — now surfaced as an editable "Section language" — and reorganises the translation UI around languages rather than fields.
> 
> \### Notable behaviour changes
> 
> \- Links keep their own source language, so saving a section no longer relabels a link authored in a different one.
> \- A localization colliding with its record's source is now destroyed instead of being left behind to shadow the base string. The collision is matched \*\*exactly\*\*, so a regional variant like \`en\_GB\` under an \`en\` source is preserved.
> \- Localization permissions are evaluated against the visibility being \*submitted\*, so making a section public and translating it in one save no longer 403s and loses the edit.
> \- \`create\` now enforces localization permissions, which it previously skipped entirely — an admin could write localizations onto a private section. A non-admin submitting localizations on create now gets a \`403\` instead of a silent drop, matching \`update\`.
> \- A submitted locale is validated at the request boundary: an unsupported or over-long value returns \`400\` rather than an unhandled \`500\`. A value already stored on the record is still accepted, so AI-detected locales outside the supported list stay editable.
> 
> \### UI
> 
> \<img width="821" height="646" alt="2026-07-29 @ 14 56 10" src="https://github.com/user-attachments/assets/19dad480-9f77-4f5b-b1a6-ed29689839a8" /\>
> \<img width="820" height="666" alt="2026-07-29 @ 14 56 16" src="https://github.com/user-attachments/assets/a9377282-d4b2-43af-91a6-700e10c50ce6" /\>
> 
> 
> Translations moved from inline per-field rows to a single "Manage translations" entry point opening a language-major panel — one group per language holding the section title and every link name. The old layout rendered \`1 + links × languages\` rows with an add button per field, which stopped being usable at three links and two languages.
> 
> A blank field means "not translated yet" rather than invalid, and clearing a saved translation now asks for confirmation before removing it.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [21 augustus 2026 om 15:20 UTC](https://meta.discourse.org/t/custom-sidebar-section-translations-break-after-changing-the-sites-default-locale/408327/6 "2026-08-21T15:20:17Z")

</div>


