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

Add plugin and theme command #21

Merged
merged 47 commits into from
Jan 22, 2018
Merged

Add plugin and theme command #21

merged 47 commits into from
Jan 22, 2018

Conversation

swissspidy
Copy link
Member

@swissspidy swissspidy commented Dec 29, 2017

This fixes #24 (originally wp-cli/wp-cli#3782).

Things that still needs to be done/decided, among others:

  • Decide whether wp language plugin install hello-dolly en_GB would accept an --activate flag.
    Activating a language is a global action per site. One cannot activate language X for plugin A and language Y for plugin B. Hence, I think only the core command should allow activating languages.
    The answer is no. Activating a language should be separate.
  • Implement uninstall commands.
    \WP_CLI\CommandWithTranslation::uninstall() currently respects the object type, but doesn't know about the plugin/theme slug.
  • Implement update commands.
    \WP_CLI\CommandWithTranslation::update() currently updates all translations.
    Should wp language core update only update translations for core and wp language plugin update for plugins (or a specific plugin?).
    The answer is yes. If someone wants to update all files, they can use something like for type in core plugin theme; do wp language $type update; done

@schlessera
Copy link
Member

Decide whether wp language plugin install hello-dolly en_GB would accept an --activate flag.

Shouldn't we rather have a wp site switch-language or wp language switch instead? I also think that switch is a better term, as activating one automatically deactivates the previous one.

Implement uninstall commands.

Yes, that would be useful. Maybe we should also add a sort of --prune switch, that uninstall all non-active languages.

Implement update commands.
Should wp language core update only update translations for core and wp language plugin update for plugins (or a specific plugin?).

Yes, I still maintain that WP-CLI should be completely explicit about what it does and what it doesn't do.

@swissspidy
Copy link
Member Author

swissspidy commented Dec 30, 2017

Shouldn't we rather have a wp site switch-language or wp language switch instead? I also think that switch is a better term, as activating one automatically deactivates the previous one.

This sounds reasonable and I think can be worked on in a separate PR. I'll create a new issue for this.

Maybe we should also add a sort of --prune switch, that uninstall all non-active languages.

I think I'll create a separate issue for this as well.

Yes, I still maintain that WP-CLI should be completely explicit about what it does and what it doesn't do.

This would result in the following commands:

  • wp language core update
  • wp language plugin update
  • wp language theme update

What about one command that does all of the above, e.g. wp language update-all? Like wp language core update currently does.

@swissspidy
Copy link
Member Author

Looks like the cache for plugin and theme languages isn't working. Ugh.

@swissspidy swissspidy requested a review from a team January 20, 2018 13:47
@gitlost
Copy link
Contributor

gitlost commented Jan 22, 2018

Great progress on this @swissspidy !

I'm going to take the liberty of pushing:

Update test framework to latest.

Use ja instead of en_NZ for compat with old WP versions in language-core.feature and remove refs to az as not needed and confusing, ar suffices. (These pre-date this PR.)

Add test for core update by restricting to one Travis job and using Scenario Outline to iterate over WP versions. This can be used as a template for testing plugin update and theme update as well (hopefully, if it works!).

Fix CommandWithTranslation::update() to append updates so tests pass.

Just on the dry-run message 'Available %d translations updates:', which pre-dates this PR, we should be able to come up with something nicer than that!

@schlessera
Copy link
Member

Create a new issue for the dry run message discussion: #25

@schlessera schlessera merged commit 9426d51 into master Jan 22, 2018
@schlessera schlessera deleted the plugin-theme-command branch January 22, 2018 21:32
@gitlost gitlost restored the plugin-theme-command branch January 25, 2018 11:32
@gitlost gitlost deleted the plugin-theme-command branch January 25, 2018 12:02
schlessera added a commit that referenced this pull request Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add plugin and theme command
3 participants