Skip to content
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

Make available the i18 checks for Plugin Repo #632

Closed
davidperezgar opened this issue Sep 14, 2024 · 4 comments · Fixed by #633
Closed

Make available the i18 checks for Plugin Repo #632

davidperezgar opened this issue Sep 14, 2024 · 4 comments · Fixed by #633
Assignees
Labels
Checks Audit/test of the particular part of the plugin [Team] Plugin Review Issues owned by Plugin Review Team

Comments

@davidperezgar
Copy link
Member

davidperezgar commented Sep 14, 2024

As we says while reviewing a plugin and we see the issue:

Please do not use variable names for the text domain portion of a gettext function.  

For example, this is a bad shortcut: __( ‘Translate me.’ , $text_domain );

The text domain also needs to be added to the plugin header. WordPress uses it to internationalize your plugin meta-data even when the plugin is disabled. The text domain should be same as the one used when loading the text domain.

If your plugin permalink is wp-penfold-macrame, then your text domain should be the same.

You can read https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#text-domains for more information.

We do not allow to use variables, constants or empty values while using translation functions.

I believe that we could use i18n Sniff from WordPress Coding Standards.

@davidperezgar davidperezgar self-assigned this Sep 14, 2024
@davidperezgar davidperezgar added Checks Audit/test of the particular part of the plugin [Team] Plugin Review Issues owned by Plugin Review Team labels Sep 14, 2024
@ernilambar
Copy link
Member

Isn't this already implemented?

@davidperezgar
Copy link
Member Author

No, I've tested and it not showed results

@akirk
Copy link
Member

akirk commented Sep 17, 2024

I have tested this with the latest trunk version and the error is reported via https://github.com/WordPress/plugin-check/blob/trunk/includes/Checker/Checks/General/I18n_Usage_Check.php:

Screenshot 2024-09-17 at 12 49 32

@davidperezgar
Copy link
Member Author

Ok thanks. I see the problem. It's not in the Plugin repo category as well. So we have to update to review that item in Plugin repo. I'm going to change the PR.

@davidperezgar davidperezgar changed the title Check: Don’t use variables or defines as text domain shortcuts Make available the i18 checks for Plugin Repo Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Checks Audit/test of the particular part of the plugin [Team] Plugin Review Issues owned by Plugin Review Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants