fix(i18n): stop the glossary checker reporting a false green - #37
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check_glossary.pywas 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 ofvakiovirtalähde(constant current source). Those are two unrelated components, but the unanchored patternvirtala\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:
with a page that only ever writes
metallizyxkotelo: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
\bis applied only when the term starts with a word character. A row like−32 V and +32 Vopens 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