Skip to content

Restore the 31 code entries the corpus had translated - #52

Merged
tamnd merged 1 commit into
mainfrom
restore-code-entries
Aug 18, 2026
Merged

Restore the 31 code entries the corpus had translated#52
tamnd merged 1 commit into
mainfrom
restore-code-entries

Conversation

@tamnd

@tamnd tamnd commented Aug 18, 2026

Copy link
Copy Markdown
Owner

A doctest and a literal block are copied, not translated, which is what P07 checks and what 31 entries in the corpus were not.

From tutorial/introduction.po, on the page a reader meets in their first hour:

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 somebody types out and then has to debug.

Where they came from

26 arrived as human, from the Transifex mirror, where a person translated the comments inside the code and the surrounding lines came along with it. 5 arrived as machine, from a run made before the classifier could recognise them.

Both are refused at the source now, in pydocvi 0.1.6 (tamnd/python-docs-vi-translator#53). This repo is a projection, so nothing here was hand-edited: sync --human reconciled the memory and apply --refuzzy rebuilt the files.

The comment translation those 26 were made for is not lost work so much as early work. Comments are M8, with a prompt of their own and a check that every code line came back byte-identical.

What is in the diff

--refuzzy was measured before it was run: it reaches the 136 code entries and nothing else, and it cannot take a machine segment onto a human entry because there are none of those.

15 files have a content change. 106 of the 136 were already byte-identical and only gain the passthrough= comment saying so, in place of a claim that somebody translated them.

The other 539 files are the generator catching up. The corpus was still stamped X-Generator: pydocvi 0.1.4 while 0.1.5 had shipped, so apply --check has been reporting every file since then. It is clean again.

Measured

before after
P07 code entries copied exactly 31 0
P05 format specifiers match 1 0
hard checks failing 6 4
findings 1,492 1,459
checks passed 28 30

P05's single finding was inside one of the same doctests: % operator read as a % o specifier, and the translation turned it into % t.

Still failing: P01 (26), P03 (27), L01 (9), L02 (144).

Refs tamnd/python-docs-vi-translator#11.

A doctest and a literal block are copied, not translated, which is what
P07 checks and what 31 entries in the corpus were not. From
tutorial/introduction.po, a reader following the tutorial:

    File "<stdin>", line 1, in <module>     the English
    File "1", line 1, in 2                  the translation

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. Every one is an example
somebody types out and then has to debug.

26 of them arrived as human, from the Transifex mirror, where a person
had translated the comments inside the code and the surrounding lines
came along with it. 5 arrived as machine, from a run made before the
classifier could recognise them. Both are now refused at the source, in
pydocvi 0.1.6.

The comment translation they were made for is not lost work so much as
early work: comments are M8, with a prompt of their own and a check that
every code line came back byte-identical.

Rebuilt with apply --refuzzy, which was measured first and touches the
136 code entries and nothing else. 106 of those were already
byte-identical and only gain the passthrough= comment saying so, in
place of a claim that somebody translated them.

The 548 header changes are the generator catching up. The corpus was
still stamped 0.1.4 while 0.1.5 had shipped, so apply --check has been
reporting every file since then.

P07 31 to 0, P05 1 to 0, six hard checks failing to four, 1 492 findings
to 1 459, 28 checks passing to 30.
@tamnd
tamnd merged commit 32570ec into main Aug 18, 2026
1 check failed
@tamnd
tamnd deleted the restore-code-entries branch August 18, 2026 07: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