v0.250.0: i18n slice 1 release C — the language switch on every dashboard page (R-556)
gates / gates (push) Successful in 20s
gates / gates (push) Successful in 20s
- addLanguageData: the v0.247.0 hide condition (switch only on non-Hungarian pages or with ?lang=) is deleted; every template is converted, so the offer no longer leads to a half-English page. - 89 layout parity fixtures re-captured; each equals its predecessor plus exactly one switch form after the version span (checked byte-for-byte, 89 of 89). The 17 standalone fixtures are unchanged. - TestLanguageSwitch_EndToEnd: a Hungarian household with no ?lang= sees the form (red-proofed by restoring the condition: this test and 89 parity cases fail). - CHANGELOG v0.250.0, README §18, CONTEXT. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -20,18 +20,13 @@ import (
|
||||
|
||||
// addLanguageData puts the request's language and the switch state into a page's data.
|
||||
//
|
||||
// The switch is shown only when the page is NOT in Hungarian, or the request carries ?lang=. That is a
|
||||
// deliberate property of this release, not an oversight: English covers three pages, so offering it to
|
||||
// every household would put a half-English dashboard one click away. A Hungarian household therefore
|
||||
// sees nothing new; the way back from English is always on screen. Slice 1 of the plan makes the
|
||||
// switch visible to everyone once the remaining pages are converted.
|
||||
// The switch is on every dashboard page, in every language (v0.250.0, slice 1 release C). Until then it
|
||||
// was hidden from Hungarian pages without ?lang=, because English covered only part of the dashboard;
|
||||
// every template is converted now, so the offer no longer leads to a half-English page. Pinned by
|
||||
// TestLanguageSwitch_EndToEnd (a Hungarian household with no ?lang= sees the form).
|
||||
func (s *Server) addLanguageData(data map[string]interface{}, r *http.Request, lang string) {
|
||||
data["Lang"] = lang
|
||||
show := lang != i18n.Default
|
||||
if r != nil && r.URL.Query().Get("lang") != "" {
|
||||
show = true
|
||||
}
|
||||
if show && r != nil {
|
||||
if r != nil {
|
||||
data["LangSwitch"] = true
|
||||
data["LangSwitchBack"] = r.URL.Path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user