From 287a3c3120aea78602d1e17d06be6d91c3ce57d6 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Tue, 11 Oct 2022 08:47:12 +0000 Subject: [PATCH] I18N: Use `wp.i18n._n()` for plural forms in `wp_print_admin_notice_templates()`. This changeset adds better support for plural forms in update admin notices generated on the Themes and Plugins screens. This fixes issues when translating into languages that have more than one plural form, or more complicated rules for singular form usage. Props ideag, SergeyBiryukov, daledupreez, audrasjb. Fixes #37287. Built from https://develop.svn.wordpress.org/trunk@54469 git-svn-id: http://core.svn.wordpress.org/trunk@54028 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update.php | 38 ++++-------------------------------- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 8661af75b5..c8d2a497c8 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -885,45 +885,15 @@ function wp_print_admin_notice_templates() {

<# if ( data.successes ) { #> - <# if ( 1 === data.successes ) { #> - <# if ( 'plugin' === data.type ) { #> - - <# } else { #> - - <# } #> + <# if ( 'plugin' === data.type ) { #> + {{ wp.i18n.sprintf( wp.i18n._n( '%s plugin successfully updated.', '%s plugins successfully updated.', data.successes ), data.successes ) }} <# } else { #> - <# if ( 'plugin' === data.type ) { #> - - <# } else { #> - - <# } #> + {{ wp.i18n.sprintf( wp.i18n._n( '%s theme successfully updated.', '%s themes successfully updated.', data.successes ), data.successes ) }} <# } #> <# } #> <# if ( data.errors ) { #> diff --git a/wp-includes/version.php b/wp-includes/version.php index c4699cdf4a..c38cfe8fef 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-beta3-54468'; +$wp_version = '6.1-beta3-54469'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.