Add "Do not translate" and "XML Broken" sections to revcheck - #334
Open
lacatoire wants to merge 1 commit into
Open
Add "Do not translate" and "XML Broken" sections to revcheck#334lacatoire wants to merge 1 commit into
lacatoire wants to merge 1 commit into
Conversation
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
approved these changes
Aug 4, 2026
alfsb
left a comment
Member
There was a problem hiding this comment.
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.
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.
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 byXmlUtilthen 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 sharedXmlErrorFilterso 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
filestable gains anxmlErrorcolumn, so the web report can say what is wrong and not only which file.An empty file raised a
ValueErrorinXmlUtil::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.phpoutput 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 withbroken.phpon the same six languages, with the same single finding.