Skip to content

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

Merged
merged 59 commits into from
Jun 14, 2024

Conversation

alfsb
Copy link
Member

@alfsb alfsb commented Dec 14, 2023

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 and scripts/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

Copy link
Member

@Girgias Girgias left a 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
Copy link
Member

Choose a reason for hiding this comment

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

"restrict" ?

Copy link
Member Author

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.

Copy link
Member

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.

@kamil-tekiela
Copy link
Member

Did you execute Psalm or PHPStan to make sure there aren't any obvious issues?

@alfsb
Copy link
Member Author

alfsb commented Dec 15, 2023

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?

Sobak added a commit to php/doc-pl that referenced this pull request May 26, 2024
Copy link
Contributor

@Sobak Sobak left a 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.

@Girgias Girgias merged commit 6c3a00b into php:master Jun 14, 2024
@Girgias Girgias mentioned this pull request Dec 5, 2024
29 tasks
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.

4 participants