Copy code entries instead of translating them - #53
Merged
Conversation
P07 says a doctest or a literal block is byte-identical to its msgid,
because these are copied and never translated. 31 entries in the corpus
were not, and the two ways they got there are both a layer being more
forgiving than the one that checks it.
26 came in as human. sync.human_segments took any translated non-fuzzy
entry from the mirror, and 136 of those are code. human is a provenance
and not a grade: it says a person typed the string, and 30 of the 136
are a person having typed over the code. From tutorial/introduction.po:
File "<stdin>", line 1, in <module> the English
File "1", line 1, in 2 the translation
<stdin> and <module> are gone. Elsewhere it is the indentation inside a
for body flattened to one space, the carets under a syntax error no
longer under what they point at, and a column-aligned option table
reflowed to single spaces. Every one is an example a reader copies out
and then has to debug. What they were made for is the comment
translation, and that is worth less than the code: comments are M8,
with a prompt of their own and a check that every code line came back
byte-identical.
The other 106 are already byte-identical and lose nothing by going.
apply mints them from the msgid with passthrough=doctest on them, which
is the same string with an accurate account of where it came from.
5 came in as machine, from a run made before the classifier could
recognise them. batch filters non-prose out, so nothing queues one now,
but the segments outlived the rule that let them be asked: python fibo.py
<arguments> was written into the corpus as python fibo.py <đối số>.
apply now copies a code entry whatever the memory holds, so the
guarantee does not depend on no stale segment existing. The classifier
has got stricter twice and will again, and each time it does the memory
acquires another handful of translations of things that turned out to be
code.
The human guard still comes first, so neither clause can quietly replace
a reviewed string with the English. --refuzzy is the only way past it,
which is how the 136 already in the corpus were rebuilt.
load_human reconciles now rather than extending. An extend leaves all
136 in the memory for apply to write back, and the alternative was
editing them out of the manifest by hand, which would make the memory
something the content repo can no longer be rebuilt from. Dropping is
safe because the mirror is the only place a human segment comes from:
there is no command that promotes a string to human, deliberately, so
anything of that provenance was read out of Transifex and can be read
again. Machine segments are left alone, being the one thing here that
cannot be rebuilt without spending the run.
Only code is dropped, not everything the classifier calls non-prose. One
no-op is a :ref: whose display text a person translated correctly, and
that is a bug in is_noop rather than a licence to throw the translation
away.
Kind.code is one property where P07 and human_segments held a copy of
the set each, and they disagreed about that :ref: entry.
Measured over the corpus: P07 31 to 0, P05 1 to 0, six hard checks
failing to four, 1 492 findings to 1 459.
This was referenced Aug 18, 2026
Merged
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.
P07says a doctest or a literal block is byte-identical to itsmsgid, because these are copied and never translated. 31 entries in the corpus were not, and the two ways they got there are both a layer being more forgiving than the one that checks it.26 came in as
humansync.human_segmentstook any translated non-fuzzy entry from the mirror, and 136 of those are code.humanis a provenance and not a grade: it says a person typed the string, and 30 of the 136 are a person having typed over the code. Fromtutorial/introduction.po:<stdin>and<module>are gone. Elsewhere it is the indentation inside aforbody flattened to one space, the carets under a syntax error no longer under what they point at, and a column-aligned option table reflowed to single spaces. Every one is an example a reader copies out and then has to debug.What they were made for is the comment translation, and that is worth less than the code. Comments are M8, with a prompt of their own and a check that every code line came back byte-identical, which is what
classify.is_doctesthas said all along.The other 106 are already byte-identical and lose nothing by going.
applymints them from themsgidwithpassthrough=docteston them, which is the same string with an accurate account of where it came from instead of a claim that somebody translated it.5 came in as
machineFrom a run made before the classifier could recognise them.
batchfilters non-prose out, so nothing queues one now, but the segments outlived the rule that let them be asked.python fibo.py <arguments>was written into the corpus aspython fibo.py <đối số>.applynow copies a code entry whatever the memory holds, so the guarantee does not depend on no stale segment existing. The classifier has got stricter twice and will again, and each time it does the memory acquires another handful of translations of things that turned out to be code. What a string is worth is decided by what it is now, not by what an earlier run thought when it asked.What is not touched
The human guard still comes first, so neither clause can quietly replace a reviewed string with the English.
--refuzzyis the only way past it, which is how the 136 already in the corpus were rebuilt, and it was measured first: it touches those 136 and nothing else.Only code is dropped, not everything the classifier calls non-prose. One no-op in the corpus is a
:ref:whose display text a person translated correctly, and that is a bug inis_nooprather than a licence to throw the translation away.load_humanreconcilesIt used to extend. An extend leaves all 136 in the memory for
applyto write back, and the alternative was editing them out of the manifest by hand, which would make the memory something the content repo can no longer be rebuilt from.Dropping is safe because the mirror is the only place a
humansegment comes from. There is no command that promotes a string tohuman, deliberately, so anything of that provenance was read out of Transifex and can be read again. Machine segments are left alone, being the one thing here that cannot be rebuilt without spending the run.Measured
Over the real corpus, not a fixture.
P07code entries copied exactlyP05format specifiers matchP05's single finding was inside one of the same doctests:% operatorread as a% ospecifier, and the translation turned it into% t.apply --checkis clean.make checkis green at 1,376 tests and 97.45% coverage.Refs #11.