-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
CommandWithTranslation::get_installed_languages()
currently assumes that translations for en_US are always installed.
language-command/src/WP_CLI/CommandWithTranslation.php
Lines 251 to 257 in beedcd2
protected function get_installed_languages( $slug = 'default' ) { | |
$available = wp_get_installed_translations( $this->obj_type ); | |
$available = ! empty( $available[ $slug ] ) ? array_keys( $available[ $slug ] ) : array(); | |
$available[] = 'en_US'; | |
return $available; | |
} |
$ wp language plugin install my-plugin en_US
Language 'en_US' already installed.
Success: Installed 0 of 1 languages (1 skipped).
But that's not always true. For example if you have a plugin which is by default provided in a different language than English. While translate.w.org doesn't support en_US as a locale, a custom implementation can support and hook into core filters to tell WordPress that there are translations for en_US.
Worth nothing that I can update en_US translation via WP-CLI once installed via wp-admin/network/update-core.php
.
swissspidy, schlessera, vielhuber and t-fritsch