Closed davidwebca closed 5 months ago
The flow is exactly the same as when generating MO files as well:
As for the naming: the make-php command is the counterpart to the make-mo command.
Hope that makes it more clear.
Gotcha! I think I expected this move to remove the initial step since we can be working directly with PHP but I was wrong. Maybe in the future! Thanks 🤘
Feature Request
Describe your use case and the problem you are facing
When using the previously existing
wp i18n make-pot
and others, the assumption is that the first argument of the function is the source code, not another file. When I first sawwp i18n make-php
, I excepted the first argument to take in the source code to generate directly the PHP files for the new performant translations project.Describe the solution you'd like
For the sake of consistency
wp i18n make-php
should take in, as first argument, a path to the source code instead of a "po/mo" files or folder source of po/mo files.wp i18n make-php /path-to-my-php-source-code /path-to-the-languages-folder
This is also a case for people who aren't interested in developing for older versions of WordPress and that aren't required to support po/mo files : right now the steps I would need to take would be to generate the pot file, translate with Poedit or other tools and then generate the PHP files which seems cumbersome to me.
I'd then suggest either a new additional command to convert po files to PHP or adding an argument to pass.
ex.:
wp i18n convert-po --format=PHP /path-to-pomo-folder /path-to-destination-folder
--> converts po files to different formatswp i18n make-php /path-to-my-php-source-code /path-to-destination-folder
--> makes PHP languages files from scanning the source code like the other commands.