wp-cli / language-command

Installs, activates, and manages language packs.
MIT License
13 stars 21 forks source link

Don't upgrade languages when not explicitly asked to #20

Closed swissspidy closed 5 years ago

swissspidy commented 6 years ago

According to https://github.com/wp-cli/wp-cli/issues/3782#issuecomment-328913851:

Apparently, when you run wp language core, WP takes care of updating plugins and themes language files automatically now.

We'd probably need to set this filter: https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-language-pack-upgrader.php#L74-L82

I just think that WP-CLI should be very explicit about what it does, and what it doesn't. It is okay for WP to hook into an admin backend button click and do some magic. But I don't think that WP-CLI should do that sort of magic as well.

I couldn't reproduce this yet, but adding add_filter( 'async_update_translation', '__return_false' ); is a good idea if that's true.

sasagar commented 6 years ago

It is so long from this issue created, so that I would try this issue.
So I just talk about this issue with @swissspidy . (at WordCamp Tokyo 2018) We are not sure what we should do for this issue, I'd like to make sure the problem again to resolve.

ocean90 commented 5 years ago

I think we can close this one.

Language_Pack_Upgrader::async_upgrade() is only hooked into upgrader_process_complete which is for example unhooked in the upgrade command for plugins/themes. The method checks if the upgrade is not an instance of itself to avoid recursion.

swissspidy commented 5 years ago

Alrighty then.