diff --git src/js/_enqueues/wp/customize/controls.js src/js/_enqueues/wp/customize/controls.js
index 6c92362410..b45d30555c 100644
|
|
|
2117 | 2117 | } |
2118 | 2118 | }); |
2119 | 2119 | if ( 'local' !== section.params.filter_type ) { |
2120 | | wp.a11y.speak( api.settings.l10n.themeSearchResults.replace( '%d', data.info.results ) ); |
| 2120 | wp.a11y.speak( |
| 2121 | wp.i18n.sprintf( |
| 2122 | wp.i18n._n( '%d theme found', '%d themes found', data.info.results ), data.info.results |
| 2123 | ) |
| 2124 | ); |
2121 | 2125 | } |
2122 | 2126 | } |
2123 | 2127 | |
… |
… |
|
2421 | 2425 | * @return {void} |
2422 | 2426 | */ |
2423 | 2427 | updateCount: function( count ) { |
2424 | | var section = this, countEl, displayed; |
| 2428 | var section = this, i18n = wp.i18n, countEl, countText, displayed; |
2425 | 2429 | |
2426 | 2430 | if ( ! count && 0 !== count ) { |
2427 | 2431 | count = section.getVisibleCount(); |
… |
… |
|
2429 | 2433 | |
2430 | 2434 | displayed = section.contentContainer.find( '.themes-displayed' ); |
2431 | 2435 | countEl = section.contentContainer.find( '.theme-count' ); |
| 2436 | countText = i18n.sprintf( i18n._n( '%s theme', '%s themes', count ), count ); |
2432 | 2437 | |
2433 | 2438 | if ( 0 === count ) { |
2434 | | countEl.text( '0' ); |
| 2439 | countEl.text( countText ); |
2435 | 2440 | } else { |
2436 | 2441 | |
2437 | 2442 | // Animate the count change for emphasis. |
2438 | 2443 | displayed.fadeOut( 180, function() { |
2439 | | countEl.text( count ); |
| 2444 | countEl.text( countText ); |
2440 | 2445 | displayed.fadeIn( 180 ); |
2441 | 2446 | } ); |
2442 | | wp.a11y.speak( api.settings.l10n.announceThemeCount.replace( '%d', count ) ); |
| 2447 | wp.a11y.speak(i18n.sprintf( i18n._n( 'Displaying %d theme', 'Displaying %d themes', count ), count ) ); |
2443 | 2448 | } |
2444 | 2449 | }, |
2445 | 2450 | |
… |
… |
|
5480 | 5485 | control.setting.notifications.remove( 'csslint_error' ); |
5481 | 5486 | |
5482 | 5487 | if ( 0 !== errorAnnotations.length ) { |
5483 | | if ( 1 === errorAnnotations.length ) { |
5484 | | message = api.l10n.customCssError.singular.replace( '%d', '1' ); |
5485 | | } else { |
5486 | | message = api.l10n.customCssError.plural.replace( '%d', String( errorAnnotations.length ) ); |
5487 | | } |
| 5488 | message = wp.i18n.sprintf( |
| 5489 | wp.i18n._n( |
| 5490 | 'There is %d error which must be fixed before you can save.', |
| 5491 | 'There are %d errors which must be fixed before you can save.', |
| 5492 | errorAnnotations.length |
| 5493 | ), |
| 5494 | errorAnnotations.length |
| 5495 | ) |
| 5496 | |
5488 | 5497 | control.setting.notifications.add( new api.Notification( 'csslint_error', { |
5489 | 5498 | message: message, |
5490 | 5499 | type: 'error' |
… |
… |
|
7502 | 7511 | |
7503 | 7512 | if ( invalidSettings.length ) { |
7504 | 7513 | api.notifications.add( new api.Notification( errorCode, { |
7505 | | message: ( 1 === invalidSettings.length ? api.l10n.saveBlockedError.singular : api.l10n.saveBlockedError.plural ).replace( /%s/g, String( invalidSettings.length ) ), |
| 7514 | message: wp.i18n.sprintf( |
| 7515 | wp.i18n._n( |
| 7516 | 'Unable to save due to %s invalid setting.', |
| 7517 | 'Unable to save due to %s invalid settings.', |
| 7518 | invalidSettings.length |
| 7519 | ), |
| 7520 | invalidSettings.length |
| 7521 | ), |
7506 | 7522 | type: 'error', |
7507 | 7523 | dismissible: true, |
7508 | 7524 | saveFailure: true |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index decf0b87cf..0e29d3b337 100644
|
|
final class WP_Customize_Manager { |
4865 | 4865 | 'previewableDevices' => $this->get_previewable_devices(), |
4866 | 4866 | 'l10n' => array( |
4867 | 4867 | 'confirmDeleteTheme' => __( 'Are you sure you want to delete this theme?' ), |
4868 | | /* translators: %d: Number of theme search results, which cannot currently consider singular vs. plural forms. */ |
4869 | | 'themeSearchResults' => __( '%d themes found' ), |
4870 | | /* translators: %d: Number of themes being displayed, which cannot currently consider singular vs. plural forms. */ |
4871 | | 'announceThemeCount' => __( 'Displaying %d themes' ), |
4872 | 4868 | /* translators: %s: Theme name. */ |
4873 | 4869 | 'announceThemeDetails' => __( 'Showing details for theme: %s' ), |
4874 | 4870 | ), |
4875 | 4871 | ); |
4876 | 4872 | |
| 4873 | // These strings are here for backwards compatibility; the translations now occur in JavaScript. |
| 4874 | /* translators: %d: Number of theme search results. Note there is a newer translation of this string with singular and plural forms. */ |
| 4875 | $settings['l10n']['themeSearchResults'] = __( '%d themes found' ); |
| 4876 | /* translators: %d: Number of themes being displayed. Note there is a newer translation of this string with singular and plural forms. */ |
| 4877 | $settings['l10n']['announceThemeCount'] = __( 'Displaying %d themes' ); |
| 4878 | |
4877 | 4879 | // Temporarily disable installation in Customizer. See #42184. |
4878 | 4880 | $filesystem_method = get_filesystem_method(); |
4879 | 4881 | ob_start(); |
diff --git src/wp-includes/customize/class-wp-customize-themes-section.php src/wp-includes/customize/class-wp-customize-themes-section.php
index 14db083e70..f0f365f5d1 100644
|
|
class WP_Customize_Themes_Section extends WP_Customize_Section { |
147 | 147 | <# } #> |
148 | 148 | <div class="filter-themes-count"> |
149 | 149 | <span class="themes-displayed"> |
150 | | <?php |
151 | | /* translators: %s: Number of themes displayed. */ |
152 | | echo sprintf( __( '%s themes' ), '<span class="theme-count">0</span>' ); |
153 | | ?> |
| 150 | <span class="theme-count"> |
| 151 | <?php |
| 152 | /* translators: %s: Number of themes displayed. */ |
| 153 | printf( _n( '%s theme', '%s themes', 0 ), 0 ); |
| 154 | ?> |
| 155 | </span> |
154 | 156 | </span> |
155 | 157 | </div> |
156 | 158 | <?php |
diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
index 5452ff0848..343395b04f 100644
|
|
function wp_default_scripts( &$scripts ) { |
1520 | 1520 | $scripts->add( 'customize-preview', "/wp-includes/js/customize-preview$suffix.js", array( 'wp-a11y', 'customize-base' ), false, 1 ); |
1521 | 1521 | $scripts->add( 'customize-models', '/wp-includes/js/customize-models.js', array( 'underscore', 'backbone' ), false, 1 ); |
1522 | 1522 | $scripts->add( 'customize-views', '/wp-includes/js/customize-views.js', array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 ); |
1523 | | $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 ); |
| 1523 | $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-i18n', 'wp-util', 'jquery-ui-core' ), false, 1 ); |
1524 | 1524 | did_action( 'init' ) && $scripts->localize( |
1525 | 1525 | 'customize-controls', |
1526 | 1526 | '_wpCustomizeControlsL10n', |
… |
… |
function wp_default_scripts( &$scripts ) { |
1563 | 1563 | 'videoHeaderNotice' => __( 'This theme doesn’t support video headers on this page. Navigate to the front page or another page that supports video headers.' ), |
1564 | 1564 | // Used for overriding the file types allowed in plupload. |
1565 | 1565 | 'allowedFiles' => __( 'Allowed Files' ), |
1566 | | 'customCssError' => array( |
1567 | | /* translators: %d: Error count. */ |
1568 | | 'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ), |
1569 | | /* translators: %d: Error count. */ |
1570 | | 'plural' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. |
1571 | | ), |
1572 | 1566 | 'pageOnFrontError' => __( 'Homepage and posts page must be different.' ), |
1573 | | 'saveBlockedError' => array( |
1574 | | /* translators: %s: Number of invalid settings. */ |
1575 | | 'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ), |
1576 | | /* translators: %s: Number of invalid settings. */ |
1577 | | 'plural' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. |
1578 | | ), |
1579 | 1567 | 'scheduleDescription' => __( 'Schedule your customization changes to publish ("go live") at a future date.' ), |
1580 | 1568 | 'themePreviewUnavailable' => __( 'Sorry, you can’t preview new themes when you have changes scheduled or saved as a draft. Please publish your changes, or wait until they publish to preview new themes.' ), |
1581 | 1569 | 'themeInstallUnavailable' => sprintf( |
… |
… |
function wp_default_scripts( &$scripts ) { |
1586 | 1574 | 'publishSettings' => __( 'Publish Settings' ), |
1587 | 1575 | 'invalidDate' => __( 'Invalid date.' ), |
1588 | 1576 | 'invalidValue' => __( 'Invalid value.' ), |
| 1577 | // These strings are here for backward compatibility; the translations now occurs in JavaScript. |
| 1578 | 'customCssError' => array( |
| 1579 | /* translators: %d: Error count. */ |
| 1580 | 'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ), |
| 1581 | /* translators: %d: Error count. */ |
| 1582 | 'plural' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ), |
| 1583 | ), |
| 1584 | 'saveBlockedError' => array( |
| 1585 | /* translators: %s: Number of invalid settings. */ |
| 1586 | 'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ), |
| 1587 | /* translators: %s: Number of invalid settings. */ |
| 1588 | 'plural' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ), |
| 1589 | ), |
1589 | 1590 | ) |
1590 | 1591 | ); |
1591 | 1592 | $scripts->add( 'customize-selective-refresh', "/wp-includes/js/customize-selective-refresh$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 ); |