mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54469 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4f62b4eb66
commit
c8a7216896
@ -885,45 +885,15 @@ function wp_print_admin_notice_templates() {
|
||||
<div id="{{ data.id }}" class="{{ data.className }} notice <# if ( data.errors ) { #>notice-error<# } else { #>notice-success<# } #>">
|
||||
<p>
|
||||
<# if ( data.successes ) { #>
|
||||
<# if ( 1 === data.successes ) { #>
|
||||
<# if ( 'plugin' === data.type ) { #>
|
||||
<?php
|
||||
/* translators: %s: Number of plugins. */
|
||||
printf( __( '%s plugin successfully updated.' ), '{{ data.successes }}' );
|
||||
?>
|
||||
<# } else { #>
|
||||
<?php
|
||||
/* translators: %s: Number of themes. */
|
||||
printf( __( '%s theme successfully updated.' ), '{{ data.successes }}' );
|
||||
?>
|
||||
<# } #>
|
||||
<# 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 ) { #>
|
||||
<?php
|
||||
/* translators: %s: Number of plugins. */
|
||||
printf( __( '%s plugins successfully updated.' ), '{{ data.successes }}' );
|
||||
?>
|
||||
<# } else { #>
|
||||
<?php
|
||||
/* translators: %s: Number of themes. */
|
||||
printf( __( '%s themes successfully updated.' ), '{{ data.successes }}' );
|
||||
?>
|
||||
<# } #>
|
||||
{{ wp.i18n.sprintf( wp.i18n._n( '%s theme successfully updated.', '%s themes successfully updated.', data.successes ), data.successes ) }}
|
||||
<# } #>
|
||||
<# } #>
|
||||
<# if ( data.errors ) { #>
|
||||
<button class="button-link bulk-action-errors-collapsed" aria-expanded="false">
|
||||
<# if ( 1 === data.errors ) { #>
|
||||
<?php
|
||||
/* translators: %s: Number of failed updates. */
|
||||
printf( __( '%s update failed.' ), '{{ data.errors }}' );
|
||||
?>
|
||||
<# } else { #>
|
||||
<?php
|
||||
/* translators: %s: Number of failed updates. */
|
||||
printf( __( '%s updates failed.' ), '{{ data.errors }}' );
|
||||
?>
|
||||
<# } #>
|
||||
{{ wp.i18n.sprintf( wp.i18n._n( '%s update failed.', '%s updates failed.' , data.errors ), data.errors ) }}
|
||||
<span class="screen-reader-text"><?php _e( 'Show more details' ); ?></span>
|
||||
<span class="toggle-indicator" aria-hidden="true"></span>
|
||||
</button>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user