Uh oh!
There was an error while loading. Please reload this page.
Add "Do not translate" and "XML Broken" sections to revcheck - #334
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
left a comment
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.
Uh oh!
There was an error while loading. Please reload this page.
alfsb
commented
Aug 6, 2026
Tested. Detected one change in doc-ru ("Up to date files" + 1), but otherwise ok. Plan to merge this in one week. Further reviews and comments welcome. |
alfsb
left a comment
There was a problem hiding this comment.
Difference in doc-ru is a change from TranslatedOk into XmlBroken transition, so it is expected.
Not every .ent is a DTD fragment: entities.acronyms.ent, entities.remove.ent and entities.extcat.ent parse as standalone XML, and skipping every non .xml file left them unchecked. Only the files holding entity declarations are excluded now, so the exception narrows on its own as those are migrated away.
libxml recovers, so a misaligned file still yields its revtag, and it is carried over to the report. Only an empty file has none.
Uh oh!
There was an error while loading. Please reload this page.
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. Only the entity files still holding entity declarations are skipped, as those DTD fragments never parse as standalone XML; the .ent files that already are XML are checked like any other.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.