langtool: Mark strings that are deliberately the same as the English one

Plenty of strings are legitimately identical in the target language - "Vsync",
"Status", "Ad Hoc multiplayer" - but the only test we had for "is this
translated" is "does it differ from English", so those got sent to the AI again
on every single run of finish-language-with-ai, costing tokens and giving it
another chance to translate something that shouldn't be.

They now get a "# same as English" comment and are skipped. finish-language-with-ai
writes it when the AI hands the English string back unchanged (which the
validation added earlier was throwing away as an error), and import-single writes
it when a language's line matches the en_US one. Deleting the comment puts the
key back in play.

Also stop comparing values with their comments still attached while working out
what's untranslated, which was leaking "# AI translated" into the context block
of the prompt.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0164UKoXpz9r155TRfQsoc3H
This commit is contained in:
Henrik RydgårdandClaude Opus 5 committed 2026-08-23 16:18:07 +02:00
1 parent a1d205539c
commit c9ff8f55fe
5 files changed
+68 -14

No files matched your search

+3 -1
View File
@@ -203,7 +203,9 @@ from `Tools/langtool`:
No trailing `# comments` on those lines, they'd end up inside the translation. Placeholders have to
survive verbatim. If you don't know a language well enough, leave it out - a key that's missing from
a language file falls back to the English string at runtime, which is much better than a confident
guess.
guess. If a language deliberately keeps the English string (a term like "Vsync" that isn't
translated), do include it with the English text - it gets written with a `# same as English`
comment, which stops langtool from trying to translate it again on every later run.
3. `cargo run -- import-single <scratch-file> <Section> "<Key>"` writes them all in, including a new
key in en_US.ini, tagged `# AI translated` except for the en_US line, which is the string the rest
were translated from. Note it overwrites existing values for that key, so take care with keys that