Skip to content

fix(i18n): stop the glossary checker reporting a false green - #37

Merged
helmihyo merged 1 commit into
mainfrom
fix/glossary-checker-false-green
Aug 5, 2026
Merged

fix(i18n): stop the glossary checker reporting a false green#37
helmihyo merged 1 commit into
mainfrom
fix/glossary-checker-false-green

Conversation

@helmihyo

@helmihyo helmihyo commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

check_glossary.py was reporting a false green: it matched a prescribed term inside any longer word containing it, so a term nobody had used counted as used.

Finnish virtalähde (power supply) is a substring of vakiovirtalähde (constant current source). Those are two unrelated components, but the unanchored pattern virtala\w* matches inside the longer word, and the script would print "Every prescribed term is in use" while one of them appeared nowhere on its own.

Why it never showed here

It is latent in this repository — no page happens to hit the case, and no verdict changes. It surfaced in hatlabs/halmet#21, whose board has a constant current source described in the same list as its power supply. The two repositories share this script, so a fault found in one is owed to the other.

Reproduced both ways before fixing

A glossary row whose translation appears only inside a compound:

| enclosure | zyxkotelo | probe |

with a page that only ever writes metallizyxkotelo:

before the fix:  Every prescribed term is in use.
after the fix:   enclosure  ->  zyxkotelo   (English 77×, translation never)

The probe was removed. All nine translated languages are unchanged in both directions — they passed before and they pass now, which is the point: this must not alter any existing verdict.

The boundary is conditional

\b is applied only when the term starts with a word character. A row like −32 V and +32 V opens with a minus sign, and a word boundary before a non-word character asserts the opposite of what is meant — it would demand a letter immediately before the minus and match nothing. That was caught by the fix's own first run in the sibling repository, which is the habit worth keeping: run a new check against pages already reviewed and fixed, and if it reports a defect there, the defect is in the check.

Why this one matters more than the others

Five earlier corrections to these checkers were false alarms — the checker cried wolf, someone looked, the fault was in the checker. Those cost a reviewer some time.

This is the opposite. A false green means the check was never doing its job, and both repositories have leaned on it across nineteen language directories.

🤖 Generated with Claude Code

The pattern was unanchored, so a prescribed term counted as used when
only a longer word containing it was present. Finnish 'virtalähde' (power
supply) is a substring of 'vakiovirtalähde' (constant current source),
two unrelated components, and the checker would report every prescribed
term in use while one was never used at all.

No verdict in this repository changes: the fault is latent here because
no page happens to hit the case. It surfaced in hatlabs/halmet, whose
board has a constant current source, and the two repositories share this
script — a fault found in one is owed to the other.

A false alarm costs a reviewer some time; a false green means the check
was never doing its job, and both repositories have leaned on it.

The boundary applies only when the term starts with a word character. A
row like '−32 V and +32 V' opens with a minus sign, where \b asserts the
opposite of what is meant and matches nothing — caught by the fix's own
first run in the sibling repository.

Reproduced both ways before committing: a glossary row whose term appears
only inside a compound passes unnoticed without the fix and is reported
with it. All nine languages here are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@helmihyo
helmihyo merged commit 80e200b into main Aug 5, 2026
1 check passed
@helmihyo
helmihyo deleted the fix/glossary-checker-false-green branch August 5, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant