# -*- 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('