v0.247.0: i18n spike — the dashboard can speak English, Hungarian byte-identical
gates / gates (push) Successful in 19s
gates / gates (push) Successful in 19s
Message bundles (internal/i18n) expanded into templates before parsing, one template set per language. Launcher, /backups, /apps/<slug> and the layout converted; household language setting, POST /settings/language, ?lang= override, report field. Parity test against fixtures captured from unconverted templates; copy gates read templates expanded; new i18n_missing_gate. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -27,6 +27,9 @@ import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
import i18n_bundle # noqa: E402
|
||||
|
||||
_HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
TEMPLATES = os.path.join(_HERE, "..", "internal", "web", "templates")
|
||||
|
||||
@@ -119,7 +122,11 @@ def scan():
|
||||
sources.append((os.path.basename(gp), gp, GO_COMMENT))
|
||||
files = files + [os.path.basename(gp)]
|
||||
for name, path, stripper in sources:
|
||||
text = stripper.sub("", open(path, encoding="utf-8").read())
|
||||
# v0.247.0: a template's copy lives in the i18n bundle; judge the page as it renders in
|
||||
# Hungarian (the stems are Hungarian). English retrieval claims are not scanned yet -- R-row
|
||||
# in 10-localisation.md; the English bundle covers three pages today.
|
||||
raw = open(path, encoding="utf-8").read()
|
||||
text = stripper.sub("", i18n_bundle.expand(raw, "hu") if path.endswith(".html") else raw)
|
||||
for stem in STEMS:
|
||||
for m in re.finditer(re.escape(stem) + r"[a-záéíóöőúüű]*", text):
|
||||
line = text[: m.start()].count("\n") + 1
|
||||
|
||||
Reference in New Issue
Block a user