Skip to content

Don't use WP_CLI::error() when installing translations for multiple locales #61

@ocean90

Description

@ocean90

This is about

foreach ( $language_codes as $language_code ) {
if ( in_array( $language_code, $available, true ) ) {
\WP_CLI::warning( "Language '{$language_code}' already installed." );
} else {
$response = $this->download_language_pack( $language_code, $plugin );
if ( is_wp_error( $response ) ) {
\WP_CLI::error( $response );
} else {
\WP_CLI::success( 'Language installed.' );
}
}
}

Example command: wp language plugin install <plugin-name> de_DE de_CH
When the installation of de_DE fails the command should continue to install de_CH. The failed installation should be documented as warning.
This would be similar to the media regenerate command which uses Utils\report_batch_operation_results().

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