Skip to content

Commit

Permalink
Merge pull request #1491 from devansh016/incorrect-use-of-translates-…
Browse files Browse the repository at this point in the history
…function

Co-authored-by: devansh016 <[email protected]>
Co-authored-by: tobifjellner <[email protected]>
  • Loading branch information
3 people authored Aug 21, 2024
2 parents 346d6e1 + bc5bdff commit ec4559e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions plugins/performance-lab/includes/admin/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,18 @@ static function ( string $file ) {

$error_messages = array_unique( $error_messages );

if ( count( $error_messages ) === 1 ) {
$error_text = __( 'Failed to query WordPress.org Plugin Directory for the following plugin:', 'performance-lab' );
$error_occurred_text = __( 'The following error occurred:', 'performance-lab' );
} else {
$error_text = __( 'Failed to query WordPress.org Plugin Directory for the following plugins:', 'performance-lab' );
$error_occurred_text = __( 'The following errors occurred:', 'performance-lab' );
}

wp_admin_notice(
'<p>' . esc_html(
_n( 'Failed to query WordPress.org Plugin Directory for the following plugin:', 'Failed to query WordPress.org Plugin Directory for the following plugins:', count( $errors ), 'performance-lab' )
) . '</p>' .
'<p>' . esc_html( $error_text ) . '</p>' .
$plugin_list .
'<p>' . esc_html( _n( 'The following error occurred:', 'The following errors occurred:', count( $error_messages ), 'performance-lab' ) ) . '</p>' .
'<p>' . esc_html( $error_occurred_text ) . '</p>' .
'<ul><li>' .
join(
'</li><li>',
Expand Down

0 comments on commit ec4559e

Please sign in to comment.