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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
125 lines
4.9 KiB
HTML
125 lines
4.9 KiB
HTML
{# Gestión → Textos: what the software says, and how to say it differently.
|
|
|
|
The form is drawn from the catalogue rather than written out, so a string
|
|
extracted later appears here by itself. That is the point of the screen and
|
|
the reason there is no field list anywhere in it.
|
|
|
|
Each box shows the shipped word as its placeholder and what was typed as its
|
|
value — never the other way round. A field prefilled with the default saves
|
|
the default the first time anybody presses the button, and the default is
|
|
frozen from then on, which is the trap `identity_form.html` carries the same
|
|
warning about. #}
|
|
{% extends "base.html" %}
|
|
{% block title %}{{ t('nav.gestion') }} · Textos{% endblock %}
|
|
|
|
{% block main %}
|
|
<div class="feed-head">
|
|
<h1>Textos</h1>
|
|
<a class="linkish" href="{{ url_for('home.gestion') }}">Volver a {{ t('nav.gestion') }}</a>
|
|
</div>
|
|
|
|
<p class="muted">
|
|
Las palabras que dice el programa: los nombres de las secciones, los botones
|
|
y los avisos. Deja una casilla vacía para que siga diciendo lo de siempre —
|
|
sólo se guarda lo que cambias, así que una mejora de la próxima versión te
|
|
llega sola si no la has tocado.
|
|
</p>
|
|
|
|
{% if state.updated_at and not state.published_at %}
|
|
<section class="panel panel--attention">
|
|
<div class="panel__head"><h2>Pendiente de publicar</h2></div>
|
|
<p class="panel__row">
|
|
Guardado aquí, pero las palabras del sitio público no han salido: no se
|
|
pudo contactar con el servidor de git la última vez. Las del área privada
|
|
ya están puestas.
|
|
</p>
|
|
<form method="post" action="{{ url_for('ui.publish') }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<button class="btn" type="submit">Reintentar publicar</button>
|
|
</form>
|
|
</section>
|
|
{% endif %}
|
|
|
|
{# Areas as tabs and a search box beside them. Server-side, because the CSP has
|
|
no 'unsafe-inline' and a filter that needs a script is a filter that silently
|
|
does nothing. #}
|
|
<nav class="tabs" aria-label="Apartados">
|
|
{% for name in areas %}
|
|
<a class="tab {{ 'tab--on' if area == name }}"
|
|
href="{{ url_for('ui.edit', area=name, q=q or None) }}">{{ name }}</a>
|
|
{% endfor %}
|
|
<a class="tab {{ 'tab--on' if area == 'todo' }}"
|
|
href="{{ url_for('ui.edit', area='todo', q=q or None) }}">todo</a>
|
|
</nav>
|
|
|
|
<form class="card" method="get" action="{{ url_for('ui.edit') }}">
|
|
<input type="hidden" name="area" value="todo">
|
|
<label for="q">Buscar en todos los apartados</label>
|
|
<input id="q" name="q" type="search" maxlength="80" value="{{ q }}"
|
|
placeholder="una palabra que salga en pantalla">
|
|
<p class="muted small">
|
|
Busca en la clave, en la nota y en el texto mismo. Si no sabes dónde está
|
|
una palabra, escríbela aquí.
|
|
</p>
|
|
<button class="btn btn--quiet" type="submit">Buscar</button>
|
|
</form>
|
|
|
|
<form class="card" method="post"
|
|
action="{{ url_for('ui.edit', area=area, q=q or None) }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
|
|
{% if not rows %}
|
|
<p class="muted">No hay nada aquí con «{{ q }}».</p>
|
|
{% else %}
|
|
{% for row in rows %}
|
|
<div class="stringrow">
|
|
<div class="stringrow__head">
|
|
<span class="mono small">{{ row.key }}</span>
|
|
{% if row.public %}<span class="tag tag--quiet">sitio público</span>{% endif %}
|
|
</div>
|
|
{% if row.note %}<p class="muted small">{{ row.note }}</p>{% endif %}
|
|
|
|
{% for lang in row.langs %}
|
|
{% if row.public %}<label for="{{ row.key }}:{{ lang.code }}">{{ lang.label }}</label>{% endif %}
|
|
{% if row.long %}
|
|
<textarea id="{{ row.key }}:{{ lang.code }}" name="{{ row.key }}:{{ lang.code }}"
|
|
rows="3" maxlength="2000"
|
|
placeholder="{{ lang.default }}">{{ lang.stored }}</textarea>
|
|
{% else %}
|
|
<input id="{{ row.key }}:{{ lang.code }}" name="{{ row.key }}:{{ lang.code }}"
|
|
type="text" maxlength="2000"
|
|
value="{{ lang.stored }}" placeholder="{{ lang.default }}">
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
|
|
<div class="actions">
|
|
<button class="btn" type="submit">Guardar</button>
|
|
</div>
|
|
{% endif %}
|
|
</form>
|
|
|
|
{% if rows and rows[0].public %}
|
|
<p class="muted small">
|
|
Lo marcado <span class="tag tag--quiet">sitio público</span> va a
|
|
vienalatina.com y tarda un par de minutos en salir. Un idioma que dejes vacío
|
|
lo rellena la traducción automática en la siguiente publicación — que para
|
|
una palabra suelta acierta poco, así que merece la pena escribirlo.
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% if state.customised %}
|
|
<form class="card" method="post" action="{{ url_for('ui.restore') }}"
|
|
data-confirm="Se vuelve a los textos originales en todos los apartados. ¿Seguro?">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<h2 class="section-title">Restaurar los textos originales</h2>
|
|
<p class="muted small">
|
|
Deja todas las palabras como venían. No toca nada más: ni los colores, ni
|
|
la identidad, ni lo que haya escrito la gente.
|
|
</p>
|
|
<button class="btn btn--danger" type="submit">Restaurar los textos originales</button>
|
|
</form>
|
|
{% endif %}
|
|
{% endblock %}
|