Skip to content

v8.1.1.dev2277

@Patch76 Patch76 tagged this 08 Aug 10:44
* fix: keep hardcoded config-flow labels untranslated

The 2026-08-08 locale-sync run failed its content-completeness verification
and pushed nothing: filling `nl` for the first time, the engine translated
the on-screen option in `common.connect_local_lan` ("Local network" ->
"Lokaal netwerk"), which sends the reader looking for an option that is not
on the form. The prompt already asked for that literal to survive; nothing
enforced it, so the only thing that caught it was the parity test after the
run, which blocks the push for every locale at once.

`_validate` now rejects a translation that localises a selector label the
config flow hardcodes in Python. Quoting alone is not the signal: catalogs
correctly translate quoted cross-references to their own option labels, and
Home Assistant translates its own buttons — all six shipped catalogs
translate "Add entry" and all six keep "Local network". The label set is
read from `config_flow.py` at runtime rather than duplicated here, so a
rename cannot strand a stale copy; the existing
`test_connect_local_lan_quotes_the_bind_host_option` guards the rename
against the catalogs.

Authoring the `nl` string as well takes the key out of the work plan, so the
next run is clean rather than merely unblocked. Its English is unchanged
since the last baseline repin, so the sync will not retranslate it and no
repin is needed here — repinning now would freeze the strings that are
legitimately waiting for retranslation.

The workflow header and the module docstring both list what gets validated,
so both name the new check; the `.github/` edit is that comment only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: type the regex results the label check reads

`re.findall` is typed as `list[Any]`, so returning one of its elements made
`_untranslatable_label_dropped` return `Any` from a function declared
`str | None` — which the repository's mypy settings reject. Annotating both
call sites keeps the values typed as the strings the patterns already
guarantee.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: read the quoted label through typographic quote marks too

The label check pulled quoted text out of the English source with a straight
double quote on both sides, so an English string that quoted the option the
way two shipped strings already do — `“…”` — never reached the comparison and
the label was free to be translated. Which quote mark an author reaches for
should not decide whether the option on the form is protected.

Widening the class leaves the measurement unchanged: still zero violations
across the 3232 English/translation pairs in the shipped catalogs, and the
string that failed the sync run is still rejected in both spellings.

The workflow header lists what the script validates and had been one item
short of the module docstring since before this change; it now names
formatting-tag parity as well, so the two lists read the same.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assets 2
Loading