website: the language switch becomes a globe like the dashboard's (Magyar / English list, current marked, no JS); site.css v3; gate 13 checks the globe from one LANGS list; 5 decoys
gates / gates (push) Successful in 3m54s
gates / gates (push) Successful in 3m54s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
This commit is contained in:
@@ -829,8 +829,11 @@ that**, and it is the same walk R-516 is waiting for in the other language.
|
||||
`/en/download`. No twin, by name: the hidden prices page and `404.html` (Hungarian first, one English line).
|
||||
Section anchors are English on the English page (`#apps`, not `#alkalmazasok`).
|
||||
|
||||
**[DESIGN] The switch is a link, not a redirect.** Each page carries one nav item naming the other language in
|
||||
that language („English" / „Magyar"), pointing at its own twin, with `lang` and `hreflang`. No Accept-Language
|
||||
**[DESIGN] The switch is a globe, not a redirect** (ruling 11, 2026-10-08 — it replaced the first day's text link).
|
||||
Each page's nav carries one `<details>` globe like the dashboard's (§10.3): a list naming every language in its own
|
||||
language (Magyar, English — the same order everywhere), the page's own language marked and pointing at the page
|
||||
itself, every other item at that language's twin, with `lang` and `hreflang`. A third language is one list entry
|
||||
plus its pages. It works without JavaScript. No Accept-Language
|
||||
redirect, no cookie: a visitor lands on the page they asked for — the same reasoning as §3, where a household's
|
||||
choice lives in its own setting and a stranger's in their own browser.
|
||||
|
||||
@@ -870,3 +873,5 @@ These are rulings, not proposals. Anything specced against a different assumptio
|
||||
live immediately"): indexed, in `sitemap.xml` with `xhtml:link` alternates, and a language switch in the nav of
|
||||
every page in both languages. No Accept-Language redirect and no cookie: a visitor always lands on the page they
|
||||
asked for.
|
||||
11. **The website's language switch is a globe with a list of languages, matching the controller; text links are
|
||||
retired** (operator ruling 2026-10-08, the globe brief). §10.7.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
### site/globe-wrong-page rc=1
|
||||
mutation (website/en/apps.html): '<a href="/alkalmazasok" lang="hu" hreflang="hu" class="lang-globe-item">Magyar</a>' -> '<a href="/" lang="hu" hreflang="hu" class="lang-globe-item">Magyar</a>'
|
||||
FAIL: en/apps.html: the globe's hu item points at '/' — its twin is '/alkalmazasok'
|
||||
|
||||
### site/globe-two-current rc=1
|
||||
mutation (website/en/apps.html): '<a href="/alkalmazasok" lang="hu" hreflang="hu" class="lang-globe-item">Magyar</a>' -> '<a href="/alkalmazasok" lang="hu" hreflang="hu" class="lang-globe-item current" aria-curre'
|
||||
FAIL: en/apps.html: the globe marks 'hu' as current (class current=True, aria-current=True) — only the page's own language 'en' is
|
||||
|
||||
### site/globe-missing-language rc=1
|
||||
mutation (website/en/apps.html): '<li><a href="/alkalmazasok" lang="hu" hreflang="hu" class="lang-globe-item">Magyar</a></li' -> ''
|
||||
FAIL: en/apps.html: the globe lists [('en', 'English')] — every page lists exactly [('hu', 'Magyar'), ('en', 'English')], in that order
|
||||
|
||||
### site/globe-wrong-order rc=1
|
||||
mutation (website/en/apps.html): '<li><a href="/alkalmazasok" lang="hu" hreflang="hu" class="lang-globe-item">Magyar</a></li' -> '<li><a href="/en/apps" lang="en" hreflang="en" class="lang-globe-item current" aria-curren'
|
||||
FAIL: en/apps.html: the globe lists [('en', 'English'), ('hu', 'Magyar')] — every page lists exactly [('hu', 'Magyar'), ('en', 'English')], in that order
|
||||
|
||||
### site/leftover-text-switch rc=1
|
||||
mutation (website/en/apps.html): '<li class="lang-globe-li">' -> '<li><a href="/alkalmazasok" lang="hu" hreflang="hu" class="lang-switch">Magyar</a></li><li'
|
||||
FAIL: en/apps.html: <nav> differs from en/index.html (after active-marker normalization)
|
||||
FAIL: en/apps.html: a leftover text language switch (class="lang-switch") — the globe replaced it
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Replace the nav's text language switch with the globe on every page (2026-10-08 ruling: a globe with a list of
|
||||
languages, matching the controller). One language list; each page's own URL and its twins' URLs."""
|
||||
import io, os, re, sys
|
||||
W = "/mnt/5_hdd/felhom.eu/git/felhom.eu/website"
|
||||
LANGS = [("hu", "Magyar"), ("en", "English")] # order on every page
|
||||
LABEL = {"hu": "Nyelv", "en": "Language"}
|
||||
# page -> {lang: url}; NO_TWIN pages point their foreign item at the other language's home
|
||||
SETS = [("index.html", "/", "en/index.html", "/en/"), ("alkalmazasok.html", "/alkalmazasok", "en/apps.html", "/en/apps"),
|
||||
("technologiak.html", "/technologiak", "en/technology.html", "/en/technology"),
|
||||
("biztonsagimentes.html", "/biztonsagimentes", "en/backups.html", "/en/backups"),
|
||||
("gyik.html", "/gyik", "en/faq.html", "/en/faq"), ("kapcsolat.html", "/kapcsolat", "en/contact.html", "/en/contact"),
|
||||
("letoltes.html", "/letoltes", "en/download.html", "/en/download")]
|
||||
PAGES = {}
|
||||
for hu, hu_u, en, en_u in SETS:
|
||||
PAGES[hu] = ("hu", {"hu": hu_u, "en": en_u})
|
||||
PAGES[en] = ("en", {"hu": hu_u, "en": en_u})
|
||||
PAGES["404.html"] = ("hu", {"hu": "/", "en": "/en/"})
|
||||
PAGES["szolgaltatasok-nonpublic.html"] = ("hu", {"hu": "/szolgaltatasok-nonpublic", "en": "/en/"})
|
||||
|
||||
|
||||
def globe(lang, urls):
|
||||
items = []
|
||||
for code, name in LANGS:
|
||||
cur = code == lang
|
||||
items.append('<li><a href="%s" lang="%s" hreflang="%s" class="lang-globe-item%s"%s>%s</a></li>'
|
||||
% (urls[code], code, code, " current" if cur else "", ' aria-current="true"' if cur else "", name))
|
||||
return ('<li class="lang-globe-li"><details class="lang-globe"><summary class="lang-globe-btn" aria-label="%s" title="%s">'
|
||||
'<svg class="ico-lg" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-globe"/></svg></summary>'
|
||||
'<ul class="lang-globe-menu">%s</ul></details></li>') % (LABEL[lang], LABEL[lang], "".join(items))
|
||||
|
||||
|
||||
SW = re.compile(r'<li><a href="[^"]*" lang="(?:hu|en)" hreflang="(?:hu|en)" class="lang-switch">[^<]*</a></li>')
|
||||
for p, (lang, urls) in PAGES.items():
|
||||
path = os.path.join(W, p)
|
||||
s = io.open(path, encoding="utf-8-sig").read()
|
||||
s, n = SW.subn(lambda m: globe(lang, urls), s)
|
||||
assert n == 1, (p, n)
|
||||
s, k = re.subn(r"/assets/site\.css\?v=2\b", "/assets/site.css?v=3", s)
|
||||
assert k == 1, (p, k)
|
||||
with io.open(path, "w", encoding="utf-8-sig", newline="\n") as f:
|
||||
f.write(s)
|
||||
print(p, "globe + css v3")
|
||||
Reference in New Issue
Block a user