Footer links stay Swedish when the Forgejo UI is set to English #333
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#333
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
The three Bitborg links in the Forgejo footer render in Swedish regardless of the UI language.
With the interface set to English, the footer still reads "Användarvillkor" and
"Integritetspolicy" next to correctly translated Forgejo strings ("Powered by Forgejo",
"Licenses").
Reproduce
The three links are byte-identical to the
sv-SEresponse.Cause
ansible/roles/forgejo/templates/custom/extra_links_footer.tmpl.j2:4-6is plain HTML withhardcoded Swedish labels. Forgejo's
custom/templates/custom/*hook fragments are not routedthrough the translation pipeline unless they ask for it explicitly. Nothing upstream is at
fault — this is our fragment.
Fix
Forgejo exposes
ctx(and thereforectx.Locale) to every template as a per-request funcmapentry —
modules/templates/htmlrenderer.goon thev16.0.1tag — includingcustom/*fragments, which are included with the full page context
(
templates/base/footer_content.tmpl:{{template "custom/extra_links_footer" .}}). So thefragment can branch on
{{ctx.Locale.Lang}}(sv-SE/en-US) and emit the right label.Use English wording that matches the portal's own navigation: Terms of Service and
Privacy Policy. Swedish output must stay exactly as it is today.
Do not try to add custom translation keys under
custom/options/locale/: locale files areread through a layered asset filesystem whose
ReadFilereturns the first matching layer andstops (
modules/options/base.go,modules/assetfs/layered.go), so a customlocale_en-US.iniwould replace the whole built-in English locale rather than extend it.Done when
curlcommands above against production.local/(podman) before the production apply.Part of gitborg/gitborg-docs#70.
supernaut refererade till detta ärende från bitborg/bitborg-docs2026-08-02 12:32:47 +00:00