From 8936f296eae8ff5336dda953ce326616d869837e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 12:35:10 +0000 Subject: [PATCH] Textos: the words are data now, starting with the navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renaming «Inicio» was six edits — base.html, home.py's section list, config.yaml three times, an aria-label, and the breadcrumb schema — and none of them reachable from Gestión. That is the thing Identidad exists to end for the site's name, and it stopped before it reached the labels. The mechanism, and the navigation through it. The rest of the ~560 strings follow in later commits; this one is the path proved end to end. apps/board/strings/*.yaml is the catalogue, shipped in the image through the Dockerfile's existing COPY. Only the differences are stored, which is brand.FACTORY's rule and buys the same thing: a wording I improve later improves for everyone who has not deliberately overridden it. The `site.` prefix decides everything — one box or three, SQLite or a commit of data/ui.yaml, this page load or the next pipeline run. The fallback order is a judgement rather than an accident: an override for the asked-for language, then the *shipped* word in that language, then Spanish. Somebody who reworded only the Spanish has said nothing about German, and showing a German reader Spanish would be reading an intention into silence. Verified in a real build: with es overridden, the Spanish menu says «Escritorio» and the German still says «Start». The screen is generic — it iterates the catalogue, so extracting another hundred strings costs nothing here. There is no field list in ui.py and there must never be one. Two guards are what make a 560-string extraction mechanical rather than risky: every t("…") used must exist, and every key defined must be used. A typo renders as nav.incio on a page; an orphan is a box in Gestión that changes nothing. Both fail the suite instead. I proved all three guards (including the one holding t.html to the catalogue) by introducing the bug each describes and watching it go red. Two things fixed on the way, both found by the extraction rather than looked for: home.py and base.html held two copies of the same six words, so a rename would have reached the members area and not the strip on the public site; and memberbar.js hardcoded two more in a fingerprinted script, the one surface no setting could ever reach. No migration — `strings` is a new table, so CREATE TABLE IF NOT EXISTS makes it, as activity and site arrived. The erase guard caught the new members(id) reference by itself, which is the mechanism working. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn --- apps/board/activity.py | 2 + apps/board/app.py | 16 +- apps/board/home.py | 24 +- apps/board/members.py | 3 + apps/board/schema.sql | 22 ++ apps/board/static/board.css | 22 ++ apps/board/strings.py | 198 +++++++++++ apps/board/strings/nav.yaml | 68 ++++ apps/board/strings/sitio.yaml | 142 ++++++++ apps/board/templates/base.html | 26 +- apps/board/templates/gestion.html | 15 + apps/board/templates/ui_form.html | 124 +++++++ apps/board/tests/test_strings.py | 313 ++++++++++++++++++ apps/board/tests/test_tools.py | 1 + apps/board/ui.py | 211 ++++++++++++ config.yaml | 12 + docs/server-setup.md | 67 ++++ themes/vienalatina/assets/js/memberbar.js | 8 +- .../vienalatina/layouts/_default/single.html | 6 +- .../vienalatina/layouts/partials/header.html | 12 +- themes/vienalatina/layouts/partials/t.html | 21 +- 21 files changed, 1283 insertions(+), 30 deletions(-) create mode 100644 apps/board/strings.py create mode 100644 apps/board/strings/nav.yaml create mode 100644 apps/board/strings/sitio.yaml create mode 100644 apps/board/templates/ui_form.html create mode 100644 apps/board/tests/test_strings.py create mode 100644 apps/board/ui.py diff --git a/apps/board/activity.py b/apps/board/activity.py index f2c4984..b749d58 100644 --- a/apps/board/activity.py +++ b/apps/board/activity.py @@ -44,6 +44,8 @@ SENTENCES = { "brand.saved": "cambió el aspecto del sitio", "brand.restored": "restauró el aspecto de fábrica", "identity.saved": "cambió la identidad del sitio", + "ui.saved": "cambió los textos del sitio", + "ui.restored": "restauró los textos originales", "media.deleted": "borró la imagen {object}", } diff --git a/apps/board/app.py b/apps/board/app.py index 169f3d4..9c5b3ee 100644 --- a/apps/board/app.py +++ b/apps/board/app.py @@ -97,11 +97,12 @@ def create_app(overrides: dict | None = None) -> Flask: from . import (activity, auth, board, brand, content, events, home, identity, media, members, messages, profiles, status, - submissions, uploads) + strings, submissions, ui, uploads) app.register_blueprint(auth.bp, url_prefix=URL_PREFIX) app.register_blueprint(home.bp, url_prefix=URL_PREFIX) app.register_blueprint(brand.bp, url_prefix=URL_PREFIX) app.register_blueprint(identity.bp, url_prefix=URL_PREFIX) + app.register_blueprint(ui.bp, url_prefix=URL_PREFIX) app.register_blueprint(status.bp, url_prefix=URL_PREFIX) app.register_blueprint(activity.bp, url_prefix=URL_PREFIX) app.register_blueprint(media.bp, url_prefix=URL_PREFIX) @@ -137,6 +138,12 @@ def create_app(overrides: dict | None = None) -> Flask: #