From 05f41c77b480c3a660af72ceb2b2728e63f0fc45 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Fri, 19 May 2023 15:58:24 -0600 Subject: [PATCH] fix localization --- php/pantheon/checks/plugins.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/php/pantheon/checks/plugins.php b/php/pantheon/checks/plugins.php index 38c3f26..33fbd7a 100644 --- a/php/pantheon/checks/plugins.php +++ b/php/pantheon/checks/plugins.php @@ -232,11 +232,13 @@ public function message(Messenger $messenger) { $rows[] = array('class'=>$class, 'data' => $alert); } + $updates_message = $count_update === 1 ? __( 'Found one plugin needing updates' ) : sprintf( _n( 'Found %d plugin needing updates', 'Found %d plugins needing updates', $count_update ), $count_update ); $result_message = ! $should_check_vulnerabilities ? // Not checking vulnerabilities message. - sprintf( __( 'Found %s needing updates ...' ), _n( 'one plugin', '%d plugins', $count_update ) ) : + $updates_message . ' ...': // Checking vulnerabilities message. - sprintf( __( 'Found %s needing updates and %s known vulnerabilities ...' ), _n( 'one plugin', '%d plugins', $count_update ), _n( 'one plugin', '%d plugins', $count_vuln ) ); + $updates_message . ' ' . + ( $count_vuln === 1 ? __( 'Also found one plugin with known vulnerabilities ...' ) : sprintf( _n( 'Also found %d plugin with known vulnerabilities ...', 'Also found %d plugins with known vulnerabilities ...', $count_vuln ), $count_vuln ) ); $rendered = PHP_EOL; $rendered .= "$result_message \n" . PHP_EOL; $rendered .= View::make('table', array('headers'=>$headers,'rows'=>$rows));