Plugins: Introduce a singular and plural form for the plugin deletion error message.

Props eddhurst, SergeyBiryukov

Fixes #38918


git-svn-id: https://develop.svn.wordpress.org/trunk@41713 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2017-10-03 17:12:41 +00:00
parent 35363c99b1
commit d72e4fd9aa
1 changed files with 11 additions and 2 deletions

View File

@ -891,8 +891,17 @@ function delete_plugins( $plugins, $deprecated = '' ) {
set_site_transient( 'update_plugins', $current );
}
if ( ! empty($errors) )
return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s.'), implode(', ', $errors)) );
if ( ! empty( $errors ) ) {
if ( 1 === count( $errors ) ) {
/* translators: %s: plugin filename */
$message = __( 'Could not fully remove the plugin %s.' );
} else {
/* translators: %s: comma-separated list of plugin filenames */
$message = __( 'Could not fully remove the plugins %s.' );
}
return new WP_Error( 'could_not_remove_plugin', sprintf( $message, implode( ', ', $errors ) ) );
}
return true;
}