wp language theme
Installs, activates, and manages theme language packs.
Subcommands
| Command | Description |
|---|---|
| wp language theme install | Installs a given language for a theme. |
| wp language theme is-installed | Checks if a given language is installed. |
| wp language theme list | Lists all available languages for one or more themes. |
| wp language theme uninstall | Uninstalls a given language for a theme. |
| wp language theme update | Updates installed languages for one or more themes. |
wp language theme install
Installs a given language for a theme.
Downloads the language pack from WordPress.org.
Synopsis
wp language theme install [<theme>] [--all] <language>... [--format=<format>]
Options
[<theme>]
: Theme to install language for.
[–all]
: If set, languages for all themes will be installed.
<language>…
: Language code to install.
[–format=<format>]
: Render output in a particular format. Used when installing languages for all themes.
- default: table
- options: table, csv, json, summary
Examples
# Install the Japanese language for Twenty Seventeen.
$ wp language theme install twentyseventeen ja
Downloading translation from https://downloads.wordpress.org/translation/theme/twentyseventeen/1.3/ja.zip...
Unpacking the update...
Installing the latest version...
Translation updated successfully.
Language 'ja' installed.
Success: Installed 1 of 1 languages.
wp language theme is-installed
Checks if a given language is installed.
Returns exit code 0 when installed, 1 when uninstalled.
Synopsis
wp language theme is-installed <theme> <language>...
Options
<theme>
: Theme to check for.
<language>…
: The language code to check.
Examples
# Check whether the German language is installed for Twenty Seventeen; exit status 0 if installed, otherwise 1.
$ wp language theme is-installed twentyseventeen de_DE
$ echo $?
1
wp language theme list
Lists all available languages for one or more themes.
Synopsis
wp language theme list [<theme>...] [--all] [--field=<field>] [--<field>=<value>] [--fields=<fields>] [--format=<format>]
Options
[<theme>…]
: One or more themes to list languages for.
[–all]
: If set, available languages for all themes 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
- theme
- language
- english_name
- native_name
- status
- update
- updated
Examples
# List available language packs for the theme.
$ wp language theme list twentyten --fields=language,english_name,status
+----------------+-------------------------+-------------+
| language | english_name | status |
+----------------+-------------------------+-------------+
| ar | Arabic | uninstalled |
| ary | Moroccan Arabic | uninstalled |
| az | Azerbaijani | uninstalled |
wp language theme uninstall
Uninstalls a given language for a theme.
Synopsis
wp language theme uninstall [<theme>] [--all] <language>... [--format=<format>]
Options
[<theme>]
: Theme to uninstall language for.
[–all]
: If set, languages for all themes will be uninstalled.
<language>…
: Language code to uninstall.
[–format=<format>]
: Render output in a particular format. Used when installing languages for all themes.
- default: table
- options: table, csv, json, summary
Examples
# Uninstall the Japanese theme language pack for Twenty Ten.
$ wp language theme uninstall twentyten ja
Language 'ja' for 'twentyten' uninstalled.
+-----------+--------+-------------+
| name | locale | status |
+-----------+--------+-------------+
| twentyten | ja | uninstalled |
+-----------+--------+-------------+
Success: Uninstalled 1 of 1 languages.
wp language theme update
Updates installed languages for one or more themes.
Synopsis
wp language theme update [<theme>...] [--all] [--dry-run]
Options
[<theme>…]
: One or more themes to update languages for.
[–all]
: If set, languages for all themes will be updated.
[–dry-run]
: Preview which translations would be updated.
Examples
# Update all installed language packs for all themes.
$ wp language theme update --all
Updating 'Japanese' translation for Twenty Seventeen 1.3...
Downloading translation from https://downloads.wordpress.org/translation/theme/twentyseventeen/1.3/ja.zip...
Translation updated successfully.
Success: Updated 1/1 translation.