-
Notifications
You must be signed in to change notification settings - Fork 109
Revcheck library and QA tools for translation synchronization #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a quick glance commit by commit, just a couple of question where some might have been fixed along the way
@@ -57,13 +54,16 @@ public static function parseComment( DOMNode $node , RevtagInfo & $ret , $filena | |||
|
|||
if ( str_starts_with( $text , "EN-" ) ) | |||
{ | |||
// /EN-Revision:\s*(\S+)\s*Maintainer:\s*(\S+)\s*Status:\s*(\S+)/ // restric maintainer with no spaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"restrict" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fixed. As this is clearing for merging, there is translations with user names with spaces?
These comments are effectually a TODO, before implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if there are, I can run this on all of the translations to check.
Did you execute Psalm or PHPStan to make sure there aren't any obvious issues? |
No. I don't have any of those tools. These tools are not installed in automatic checking? If not, why not? |
Identified thanks to the QA scripts prepared in php/doc-base#111 by @alfsb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to look into the code more one day but I've been postponing this review long enough already, so let me start from the user perspective, i.e. how useful this is.
I ran all of the scripts in the order suggested in scripts/translation/README.md
on the neglected Polish translation and... it has been a godsent for ensuring the quality. I've caught so many mistakes, sections that were not translated (but copy-pasted in English), sections that were omitted from the original diff generated from revcheck, translated parameters and other kinds of issues that I was surprised. After all it's a pleasant surprise because it gives more confidence for the quality of translation.
The commits I'm talking about were referenced by GitHub above if anyone's curious.
Speaking from my personal standpoint I would be in favor of merging it and iterating in-tree where necessary. There's one actual code complaint, though. Where ran on PHP 8.3+ there are complaints about dynamic properties in classes - I think we can just define them and call it a day since adding an attribute is probably not really justified.
Oh, and I would convert it to PSR-2/12 but it's mostly due to the fact that it's been ages since I've seen bigger codebase formatted in different style, current parenthesis spacing reminds me of WordPress 🤕
That being said, there's no code standard that would necessarily be followed for php.net's tooling so it's just a mumbling, not a real concern that affects a functionality of this PR :)
tl;dr it works and yields very useful results - I would fix deprecations, merge it, and iterate in-tree in case we want more. I don't see any problems that would outweight the benefits.
This PR rewrites revcheck logic into more modern PHP usage, and publishes a series of tools to check if one translation is in sync with the base language.
The
scripts/translation
andscripts/translation/lib/
directories are written as self contained code ,that can be checked out or utilized as a git submodule to obtain revcheck data in typed form