wp-cli / language-command

Installs, activates, and manages language packs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't upgrade languages when not explicitly asked to

swissspidy opened this issue · comments

According to wp-cli/wp-cli#3782 (comment):

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.

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.

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.

Alrighty then.