How to update wordpress translations via wp-cli
Asked Answered
K

3

9

I'm using docker with the wordpress:cli image to perform many actions like updating, activating themes and plugins, etc, on the system.

I come up with a brand new updated system that has everything in it I want, except for the translations. Wordpress-admin informs me that there are updates for translations and I can manually click and update but I obviously want to continue with the cli-style.

Is there any command to achieve such? Following the documentation in https://developer.wordpress.org/cli/commands/language

I cannot find anything.

Can this be done in any way?

Kerseymere answered 9/5, 2019 at 15:33 Comment(2)
Where are the updates from? Is it from the core or plugins?Calutron
I'm using wp core update, wp plugin update--all, wp theme update --all and wp language core updateKerseymere
H
15

A bit belated, but it seems that the answer depends on which translations are out of date (core, theme or plugin).

The following two commands did the trick for me :

wp language plugin --all update
wp language theme --all update

Hope that helps.

Hanleigh answered 12/7, 2019 at 8:4 Comment(1)
I also added wp language core update as per developer.wordpress.org/cli/commands/language; weirdly enough plugins always results in a Success: Translations are up to date. message while firing up the server, but then more translations for plugins are ready when I go to admin. I checked if swapping it around makes any difference, but it didn't wp language plugin update --all.Siqueiros
S
4

Despite the "active" status of wp language plugin list --all, translations may be not really installed. I finally managed it with this for the es_ES sites:

wp language plugin install --all es_ES

The Admin panel missage dissapears and some unworking translations runs fine.

Spit answered 12/4, 2022 at 5:7 Comment(1)
Thank you, I was going mad figuring this out!!Eolith
A
0

To determine what is even installed:

wp language plugin list --status=installed --all
wp language plugin list buddypress

It seems that all plugins need to support the current site language, because when switching the site language from en_GB to en_US, the update notice suddenly went away - despite everything else failed so far.

Angrist answered 4/12, 2021 at 13:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.