wp language plugin

Installs, activates, and manages plugin language packs.

Subcommands

Command Description
wp language plugin install Installs a given language for a plugin.
wp language plugin is-installed Checks if a given language is installed.
wp language plugin list Lists all available languages for one or more plugins.
wp language plugin uninstall Uninstalls a given language for a plugin.
wp language plugin update Updates installed languages for one or more plugins.

wp language plugin install

Installs a given language for a plugin.

Downloads the language pack from WordPress.org.

Synopsis

wp language plugin install [<plugin>] [--all] <language>... [--format=<format>]

Options

[<plugin>]
: Plugin to install language for.

[–all]
: If set, languages for all plugins will be installed.

<language>…
: Language code to install.

[–format=<format>]
: Render output in a particular format. Used when installing languages for all plugins.

  • default: table
  • options: table, csv, json, summary

Examples

# Install the Japanese language for Akismet.
$ wp language plugin install akismet ja
Downloading translation from https://downloads.wordpress.org/translation/plugin/akismet/4.0.3/ja.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the translation...
Translation updated successfully.
Language 'ja' installed.
Success: Installed 1 of 1 languages.

wp language plugin is-installed

Checks if a given language is installed.

Returns exit code 0 when installed, 1 when uninstalled.

Synopsis

wp language plugin is-installed <plugin> <language>...

Options

<plugin>
: Plugin to check for.

<language>…
: The language code to check.

Examples

# Check whether the German language is installed for Akismet; exit status 0 if installed, otherwise 1.
$ wp language plugin is-installed akismet de_DE
$ echo $?
1

wp language plugin list

Lists all available languages for one or more plugins.

Synopsis

wp language plugin list [<plugin>...] [--all] [--field=<field>] [--<field>=<value>] [--fields=<fields>] [--format=<format>]

Options

[<plugin>…]
: One or more plugins to list languages for.

[–all]
: If set, available languages for all plugins will be listed.

[–field=<field>]
: Display the value of a single field.

[–<field>=<value>]
: Filter results by key=value pairs.

[–fields=<fields>]
: Limit the output to specific fields.

[–format=<format>]
: Render output in a particular format.

  • default: table
  • options: table, csv, json, count

Available Fields

  • plugin
  • language
  • english_name
  • native_name
  • status
  • update
  • updated

Examples

# List available language packs for the plugin.
$ wp language plugin list hello-dolly --fields=language,english_name,status
+----------------+-------------------------+-------------+
| language       | english_name            | status      |
+----------------+-------------------------+-------------+
| ar             | Arabic                  | uninstalled |
| ary            | Moroccan Arabic         | uninstalled |
| az             | Azerbaijani             | uninstalled |

wp language plugin uninstall

Uninstalls a given language for a plugin.

Synopsis

wp language plugin uninstall [<plugin>] [--all] <language>... [--format=<format>]

Options

[<plugin>]
: Plugin to uninstall language for.

[–all]
: If set, languages for all plugins will be uninstalled.

<language>…
: Language code to uninstall.

[–format=<format>]
: Render output in a particular format. Used when installing languages for all plugins.

  • default: table
  • options: table, csv, json, summary

Examples

# Uninstall the Japanese plugin language pack for Hello Dolly.
$ wp language plugin uninstall hello-dolly ja
Language 'ja' for 'hello-dolly' uninstalled.
+-------------+--------+-------------+
| name        | locale | status      |
+-------------+--------+-------------+
| hello-dolly | ja     | uninstalled |
+-------------+--------+-------------+
Success: Uninstalled 1 of 1 languages.

wp language plugin update

Updates installed languages for one or more plugins.

Synopsis

wp language plugin update [<plugin>...] [--all] [--dry-run]

Options

[<plugin>…]
: One or more plugins to update languages for.

[–all]
: If set, languages for all plugins will be updated.

[–dry-run]
: Preview which translations would be updated.

Examples

# Update all installed language packs for all plugins.
$ wp language plugin update --all
Updating 'Japanese' translation for Akismet 3.1.11...
Downloading translation from https://downloads.wordpress.org/translation/plugin/akismet/3.1.11/ja.zip...
Translation updated successfully.
Success: Updated 1/1 translation.