Opened 11 years ago
Closed 11 years ago
#25665 closed enhancement (fixed)
Better plugin main-file support for makepot.php tool
Reported by: | Otto42 | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
Description
The makepot.php tool, when used for plugins, contains the assumption that the "main file" of a plugin will be named plugin-slug.php, when searching for plugin headers to include in the POT file for translation. This is not necessarily the case all the time, and WordPress itself does a directory search in get_plugins to find the "main file" of the plugin.
The makepot.php file should do a similar search instead of making this assumption. This allows it to find plugin headers in files that are named differently than their slugs.
Patch attached. Most of the directory searching code is ripped from the core's own code, but I removed the subdirectory searching since I think that might be a step too far. That could be added back though, if that is desirable.
Attachments (1)
Change History (5)
#1
@
11 years ago
Looks good. When I had this issue I solved it by allowing to send a 4th parameter: https://github.com/markoheijnen/wp-i18n-tools/commit/c90bb2676c11308f0006ff2fe3e7661c666357e7.
modify makepot.php to look for plugin main-file instead of guessing