From 8e6bc72ac029721fe7fd62816672fee5cec73d18 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Thu, 18 Apr 2024 13:21:11 +0200 Subject: [PATCH 1/5] Show the number of new contributors --- templates/event.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/templates/event.php b/templates/event.php index 20ad3e8c..2c231ae4 100644 --- a/templates/event.php +++ b/templates/event.php @@ -174,12 +174,25 @@ View stats summary in text

is_new_translation_contributor( $event_start, $contributor->ID ); + } + ); + + $new_contributors_text = ''; + if ( ! empty( $new_contributors ) ) { + $new_contributors_text = sprintf( _n( '(%d new contributor!)', '(%d new contributors!)', count( $new_contributors ), 'gp-translation-events' ), count($new_contributors) ); + } + echo wp_kses( sprintf( - // translators: %1$s: Event title, %2$d: Number of contributors, %3$d: Number of languages, %4$s: List of languages, %5$d: Number of strings translated, %6$d: Number of strings reviewed. - __( 'At the %1$s event, %2$d people contributed in %3$d languages (%4$s), translated %5$d strings and reviewed %6$d strings.', 'gp-translation-events' ), + // translators: %1$s: Event title, %2$d: Number of contributors, %3$s: is a parenthesis with potential text "x new contributors", %4$d: Number of languages, %5$s: List of languages, %6$d: Number of strings translated, %7$d: Number of strings reviewed. + __( 'At the %1$s event, we had %2$d people %3$s who contributed in %4$d languages (%5$s), translated %6$d strings and reviewed %7$d strings.', 'gp-translation-events' ), esc_html( $event_title ), esc_html( $event_stats->totals()->users ), + $new_contributors_text, count( $event_stats->rows() ), esc_html( implode( From adc3f9a4c521eb11275b39031f0c18397a542dcb Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Thu, 18 Apr 2024 13:26:41 +0200 Subject: [PATCH 2/5] lint fix --- templates/event.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/event.php b/templates/event.php index 2c231ae4..3ff9d090 100644 --- a/templates/event.php +++ b/templates/event.php @@ -183,7 +183,11 @@ function ( $contributor ) use ( $stats_calculator, $event_start ) { $new_contributors_text = ''; if ( ! empty( $new_contributors ) ) { - $new_contributors_text = sprintf( _n( '(%d new contributor!)', '(%d new contributors!)', count( $new_contributors ), 'gp-translation-events' ), count($new_contributors) ); + $new_contributors_text = sprintf( + // translators: %d is the number of new contributors. + _n( '(%d new contributor!)', '(%d new contributors!)', count( $new_contributors ), 'gp-translation-events' ), + count( $new_contributors ) + ); } echo wp_kses( From d60d0cfceb3d89368745f8cf5c0c687b4d9216ba Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Thu, 18 Apr 2024 13:32:18 +0200 Subject: [PATCH 3/5] Write the emojis in the text --- templates/event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/event.php b/templates/event.php index 3ff9d090..791b5aa3 100644 --- a/templates/event.php +++ b/templates/event.php @@ -228,7 +228,7 @@ function ( $row ) { function ( $contributor ) use ( $stats_calculator, $event_start ) { $append_tada = ''; if ( $stats_calculator->is_new_translation_contributor( $event_start, $contributor->ID ) ) { - $append_tada = ''; + $append_tada = '🎉'; } return '@' . $contributor->user_login . $append_tada; }, From 055714496b89fa27cbb222bc128dd19acaffd563 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Thu, 18 Apr 2024 13:37:52 +0200 Subject: [PATCH 4/5] Include emojis in the text --- templates/event.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/event.php b/templates/event.php index 791b5aa3..ad5f5031 100644 --- a/templates/event.php +++ b/templates/event.php @@ -170,8 +170,8 @@ -

- View stats summary in text +
+

Date: Thu, 18 Apr 2024 13:38:41 +0200 Subject: [PATCH 5/5] Add space --- templates/event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/event.php b/templates/event.php index ad5f5031..b51f9762 100644 --- a/templates/event.php +++ b/templates/event.php @@ -228,7 +228,7 @@ function ( $row ) { function ( $contributor ) use ( $stats_calculator, $event_start ) { $append_tada = ''; if ( $stats_calculator->is_new_translation_contributor( $event_start, $contributor->ID ) ) { - $append_tada = '🎉'; + $append_tada = ' 🎉'; } return '@' . $contributor->user_login . $append_tada; },