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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
This commit is contained in:
2026-10-08 09:13:23 +02:00
parent c7aade4079
commit 803af4798d
26 changed files with 227 additions and 53 deletions
@@ -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")