Skip to content

Three lang/ msgids never resolve, and nothing checks the msgid pairing#617

Merged
xroche merged 3 commits into
masterfrom
fix-lang-integrity
Jul 17, 2026
Merged

Three lang/ msgids never resolve, and nothing checks the msgid pairing#617
xroche merged 3 commits into
masterfrom
fix-lang-integrity

Conversation

@xroche

@xroche xroche commented Jul 16, 2026

Copy link
Copy Markdown
Owner

lang/*.txt are consecutive line pairs, an English msgid then its translation, and nothing validates that shape. Finnish.txt had ended with a blank line since 2012, which was harmless while it was the last line. #588 appended new strings after it, so the blank became interior and knocked every pair past it out of phase: all 14 strings #588 added to Finnish, one of which 938a873 later reworded into the CONNECT proxy string, were keyed off a translation instead of an msgid and rendered as English. Dropping the blank restores the phase. Italiano and Portugues-Brasil separately each carry one msgid that matches nothing in English.txt (ISO 9660 for ISO9660, Relative URL for Relative URI), so those two entries never resolved either.

The test matters more than the three fixes. It rebuilds the msgid set from English.txt and checks every file against it byte-wise, since each file is in its own declared legacy charset and lang.def is CRLF. It also checks lang.def's English values, which are the join key into the msgids, so rewording one without moving the msgids no longer silently drops all 30 translations. Both parses assert a floor on what they extracted, so a parse that breaks fails instead of passing on an empty set. On unfixed master it reports all three defects with line numbers; it passes here.

It does not check translation text, empty translations, or a file missing trailing entries, since a partial translation is legitimate and common. It also does not check the declared LANGUAGE_CHARSET: Latin-1 and Latin-2 decode any byte sequence, so a decode check would pass vacuously and could never catch the known-wrong Svenska header.

Context for #306 (Turkish), which needs the msgid join to be sound, but does not close it.

@xroche
xroche force-pushed the fix-lang-integrity branch from 340e017 to 55be9ba Compare July 17, 2026 04:48
xroche and others added 3 commits July 17, 2026 07:24
lang/*.txt are consecutive line pairs, an English msgid then its translation,
and nothing validates that shape. Finnish.txt had ended with a blank line since
2012, which was harmless while it was the last line; #588 appended new strings
after it, so the blank became an interior line and knocked every pair past it
out of phase. All 14 strings #588 added to Finnish, plus the CONNECT proxy one
from 938a873, were keyed off a translation instead of an msgid and rendered as
English. Drop the blank.

Italiano and Portugues-Brasil each carry one msgid that matches nothing in
English.txt ("ISO 9660" for "ISO9660", "Relative URL" for "Relative URI"), so
those two entries never resolved either.

The test is the point: it rebuilds the msgid set from English.txt and checks
every file pairs against it, byte-wise, since each file is in its own legacy
charset. It also checks lang.def's English values, which are the join key into
the msgids. It fails on all three defects before this change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
The engine continues a msgid ending in \ onto the next line; the test does
not. Latent today: no lang line ends in one.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche force-pushed the fix-lang-integrity branch from 55be9ba to 0cd7b0b Compare July 17, 2026 05:26
@xroche
xroche merged commit 088f071 into master Jul 17, 2026
21 checks passed
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