Skip to content

Conversation

davidperezgar
Copy link
Member

@davidperezgar davidperezgar commented Aug 3, 2025

Fixes #1009

My approach is to use the Language Detector library. It returns a list of languages that best match the content. I use the highest-scoring language; if it's not English, it gives an error.

Maybe we can set a lower severity level until we've tested it for a while.

Copy link

github-actions bot commented Aug 3, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: davidperezgar <[email protected]>
Co-authored-by: ernilambar <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@davidperezgar davidperezgar self-assigned this Aug 3, 2025
if ( ! $check_language ) {
$this->add_result_error_for_file(
$result,
__( 'The README description contains unofficial language. It must be written in standard English.', 'plugin-check' ),
Copy link
Member

Choose a reason for hiding this comment

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

"README" should be simply "readme" I believe.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

@@ -370,8 +370,8 @@ public function test_run_with_errors_multiple_parser_warnings() {
$this->assertNotEmpty( $warnings );
$this->assertArrayHasKey( 'readme.txt', $warnings );
$this->assertSame( 7, $check_result->get_warning_count() );
$this->assertEmpty( $errors );
$this->assertSame( 0, $check_result->get_error_count() );
$this->assertNotEmpty( $errors );
Copy link
Member

Choose a reason for hiding this comment

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

We should improve our test and make sure any addition of new check does not break the existing checks.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

@ernilambar
Copy link
Member

Suggestions:

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.

Require users to write readme.txt in English
2 participants