Skip to content

Not possible to install translations for en_US  #84

Open
@ocean90

Description

@ocean90

CommandWithTranslation::get_installed_languages() currently assumes that translations for en_US are always installed.

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions