Skip to content

Add "Do not translate" and "XML Broken" sections to revcheck - #334

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:revcheck/dnt-broken-sections
Open

Add "Do not translate" and "XML Broken" sections to revcheck#334
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:revcheck/dnt-broken-sections

Conversation

@lacatoire

@lacatoire lacatoire commented Aug 4, 2026

Copy link
Copy Markdown
Member

Both were already being computed and then dropped: files marked <?do-not-translate?> were detected and skipped without a trace, and libxml errors were collected by XmlUtil then cleared without ever being read. This lists them, in the file summary and in a section of their own.

Telling a real error apart from an unresolved entity was already solved in scripts/broken.php; that logic moves to a shared XmlErrorFilter so both callers follow the same rule. Entity files are skipped, as DTD fragments never parse as standalone XML.

Files marked do not translate are listed but kept out of the totals, so no translation sees its completion rate drop for files it is not expected to have. The files table gains an xmlError column, so the web report can say what is wrong and not only which file.

An empty file raised a ValueError in XmlUtil::loadText() and aborted the run. It is now reported as any other broken file.

Item "Do not translate and XML Broken sections in revcheck" of #199.

Web side, needed for the statuses to show up on doc.php.net: php/web-doc#68

Checked with php 8.4: scripts/broken.php output unchanged on doc-fr, doc-es, doc-en, doc-ru, doc-de, doc-it and doc-tr; the doc-fr report identical outside the new sections, totals included; XML detection agreeing with broken.php on the same six languages, with the same single finding.

Both were already being computed and then dropped. Files marked
<?do-not-translate?> were detected and skipped without a trace, and
libxml errors were collected by XmlUtil then cleared without ever
being read. They are now listed, in the file summary and in a section
of their own.

Telling a real error apart from an unresolved entity was already
solved in scripts/broken.php. That logic moves to a shared
XmlErrorFilter, so both callers follow the same rule. Entity files
are skipped, as DTD fragments never parse as standalone XML.

Files marked do not translate are listed but kept out of the totals,
otherwise every translation would see its completion rate drop for
files it is not expected to have. The files table gains an xmlError
column, so the web report can say what is wrong, not only which file.

An empty file raised a ValueError in XmlUtil::loadText() and aborted
the run. It is now reported as any other broken file.

@alfsb alfsb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is impressive work. I will do some tests, and then merge in about a week. Further reviews and comments welcome.

The only comment is about the comment on revtag failing when XML is detected broken. This is true on empty files, but the (almost now extinct) real broken XML files can have valid revtags (as they are text searched) even if XML is misaligned or otherwise invalid.

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.

2 participants