Summary
The authorize error page mixes languages: its page title comes from the message catalog, its heading is a hardcoded English string. A pt-BR user meeting an authorize error sees a localized tab title and an English heading.
Details
renderErrorUi, the closure inside HandleAuthorizeGet in src/authserver/internal/handlers/handler_authorize.go, binds the heading as a Go string literal:
renderErrorUi := func(message string) {
bind := map[string]interface{}{
"title": "Unable to authorize",
"error": message,
}
err := httpHelper.RenderTemplate(w, r, "/layouts/no_menu_layout.html", "/auth_error.html", bind)
...
}
auth_error.html renders {{.title}} as its <h1>, and separately renders its <title> from the catalog key auth_error.page_title, which exists in both locales:
$ grep -n "auth_error" src/core/i18n/catalogs/active.en.toml src/core/i18n/catalogs/active.pt-BR.toml
src/core/i18n/catalogs/active.en.toml:92:"auth_error.page_title" = "Error"
src/core/i18n/catalogs/active.pt-BR.toml:90:"auth_error.page_title" = "Erro"
There is no catalog key for the heading, so nothing to translate it with.
Impact
Cosmetic, and only on the error path, but it is a user-visible language mix on a page a non-English user can reach through an ordinary bad authorize request.
Suggested fix
Add a key for the heading to active.en.toml and active.pt-BR.toml and render it through i18n.T, the way the page title already is. Worth checking the other render sites of auth_error.html for the same pattern while there.
Found while grounding #79, which adds its own strings to both catalogs and does not touch this call site.
Summary
The authorize error page mixes languages: its page title comes from the message catalog, its heading is a hardcoded English string. A pt-BR user meeting an authorize error sees a localized tab title and an English heading.
Details
renderErrorUi, the closure insideHandleAuthorizeGetinsrc/authserver/internal/handlers/handler_authorize.go, binds the heading as a Go string literal:auth_error.htmlrenders{{.title}}as its<h1>, and separately renders its<title>from the catalog keyauth_error.page_title, which exists in both locales:There is no catalog key for the heading, so nothing to translate it with.
Impact
Cosmetic, and only on the error path, but it is a user-visible language mix on a page a non-English user can reach through an ordinary bad authorize request.
Suggested fix
Add a key for the heading to
active.en.tomlandactive.pt-BR.tomland render it throughi18n.T, the way the page title already is. Worth checking the other render sites ofauth_error.htmlfor the same pattern while there.Found while grounding #79, which adds its own strings to both catalogs and does not touch this call site.