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

Switch to using wp i18n make-pot #80

Open
danielbachhuber opened this issue Dec 13, 2018 · 6 comments
Open

Switch to using wp i18n make-pot #80

danielbachhuber opened this issue Dec 13, 2018 · 6 comments

Comments

@danielbachhuber
Copy link

The WordPress project has switched to using wp i18n make-pot (docs). It'd be great if this package switched over too, for two specific advantages:

  1. Full PHP 7 support.
  2. Also parses JavaScript files.

cc @schlessera @swissspidy

@bradyvercher
Copy link
Member

As much as I'd like to switch over, I don't really want to make WP-CLI (and a WP installation?) a required dependency.

Ideally there would be a generic PHP package that could be used by WP-CLI, as a Composer package/script, grunt-wp-i18n, and node-wp-i18n. I'm not sure if it's possible to extract the work done for the WP-CLI command at this point, but that would be killer.

@danielbachhuber
Copy link
Author

As much as I'd like to switch over, I don't really want to make WP-CLI (and a WP installation?) a required dependency.

Can you explain further? wp i18n make-pot doesn't require a WordPress installation, and you can slim the installation solely to the framework code and the core command package.

@bradyvercher
Copy link
Member

I wasn't sure if WordPress installation was required or not to run that command, but if this becomes a wrapper for wp i18n make-pot, doesn't that require developers to have WP-CLI installed and available in their system path? Or are you saying it's possible to bundle the necessary code in this package without having to install WP-CLI?

I may not be understanding what's possible since it's been awhile since I've dug through WP-CLI. Can you explain how you envision this working?

@schlessera
Copy link

schlessera commented Dec 13, 2018

For v2.0 of WP-CLI I refactored the package structure so that it works properly with Composer.

All you need is to require the wp-cli/i18n-command package and it will just work. You can then use it in your Composer scripts through wp i18n ... or directly via vendor/bin/wp i18n ....

Developers don't need to have WP-CLI installed for it to work, and it will also only pull in the minimum required.

@bradyvercher
Copy link
Member

@schlessera Very cool! That's pretty much exactly what I've wanted for cases where I use Composer but don't need Node. I'll look into what it will take to switch this over to using that package instead of the old PHP tools.

@danielbachhuber
Copy link
Author

All you need is to require the wp-cli/i18n-command package and it will just work. You can then use it in your Composer scripts through wp i18n ... or directly via vendor/bin/wp i18n ....

I was also thinking that, if you don't want this Node package to have a dependency on composer, you could instead create a Phar file that gets bundled directly with this package.

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

No branches or pull requests

3 participants