Make WordPress Core

Ticket #38918: 38918.3.diff

File 38918.3.diff, 904 bytes (added by SergeyBiryukov, 7 years ago)
  • src/wp-admin/includes/plugin.php

     
    891891                set_site_transient( 'update_plugins', $current );
    892892        }
    893893
    894         if ( ! empty($errors) )
    895                 return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s.'), implode(', ', $errors)) );
     894        if ( ! empty( $errors ) ) {
     895                if ( 1 === count( $errors ) ) {
     896                        /* translators: %s: plugin filename */
     897                        $message = __( 'Could not fully remove the plugin %s.' );
     898                } else {
     899                        /* translators: %s: comma-separated list of plugin filenames */
     900                        $message = __( 'Could not fully remove the plugins %s.' );
     901                }
    896902
     903                return new WP_Error( 'could_not_remove_plugin', sprintf( $message, implode( ', ', $errors ) ) );
     904        }
     905
    897906        return true;
    898907}
    899908