-
Notifications
You must be signed in to change notification settings - Fork 5
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
Plugin headers #11
Comments
Possible yes, but what would the purpose be? The headers aren't displayed to the end user or through any translation api. |
At |
That's part of the wordpress codebase/translation system, not part of the code of the plugin itself. They are managed as sperate projects in the main wordpress glotpress implementation. |
I understood what you meant, but what I'm saying is that while the plugins page does use the readme for this info (not the plugin header as far as I know), it's not part of the plugin translation project, it's part of the main wordpress codebase. There's never a time when the plugin would use these translations, hence why they are in a separate project in the wordpress glotpress instance, and have a separate translation file that is downloaded by wordpress for them. |
True the plugin it self doesn’t use them. But WordPress does. if the plugin is not hosted on WordPress they will not get the translations. But it works to get it translated if they are included in the plugins language .po file for a GitHub only hosted. 🙏 for example:
|
In that case you'd have to grab the readme parser that wp.org uses to parse the text and break it up as required as part of the extraction process. Not something I'd spend time on but would accept a PR if someone wanted to add it. |
Ok. I’m not sure the information comes from the README file. When I’m testing, I find the information in the main.php file rather than in the README. |
Just to be sure I asked AI. In WordPress, the plugin descriptions shown in the Plugins page (wp-admin/plugins.php) come from the header comments at the top of each plugin's main file (often named main.php, but it can vary). These comments are in a specific format that WordPress reads to display information about the plugin. Key Fields WordPress Uses
These details are parsed from the file, and WordPress uses them to populate the plugin list in the Plugins admin page. |
Don't trust AI for, well, anything😉 While it may be true for where the plugin list gets the source strings, it probably isn't where the translations come from. Either way, if you want to track it down and submit a PR feel free, but otherwise I'm not pursing this at this time. |
I did a little more investigation on this, and wp.org doesn't ship those strings in the plugin translation file, so I don't think we should either. However, a work around would be to create a "extra-strings.php" file in your plugin, do a simple |
Thank you. but I found a work around using https://developer.wordpress.org/cli/commands/i18n/make-pot/ where it creates the strings in the plugin translation file. |
Question.
It doesn’t seem to extract plugin headers from The main.php file. Would it be possible?
I see from another plugin it does this and I think it would be of value that those are included for translation
ex:
Plugin URI:
description:
thanks!
The text was updated successfully, but these errors were encountered: