diff --git a/src/js/_enqueues/wp/customize/controls.js b/src/js/_enqueues/wp/customize/controls.js
index 484ac5a49b..164d308c83 100644
a
|
b
|
|
2119 | 2119 | } |
2120 | 2120 | }); |
2121 | 2121 | if ( 'local' !== section.params.filter_type ) { |
2122 | | wp.a11y.speak( api.settings.l10n.themeSearchResults.replace( '%d', data.info.results ) ); |
| 2122 | wp.a11y.speak( |
| 2123 | wp.i18n.sprintf( wp.i18n._n( '%d theme found', '%d themes found', data.info.results ), data.info.results ) |
| 2124 | ); |
2123 | 2125 | } |
2124 | 2126 | } |
2125 | 2127 | |
… |
… |
|
2426 | 2428 | * @return {void} |
2427 | 2429 | */ |
2428 | 2430 | updateCount: function( count ) { |
2429 | | var section = this, countEl, displayed; |
| 2431 | var section = this, i18n = wp.i18n, countEl, countText, displayed; |
2430 | 2432 | |
2431 | 2433 | if ( ! count && 0 !== count ) { |
2432 | 2434 | count = section.getVisibleCount(); |
… |
… |
|
2434 | 2436 | |
2435 | 2437 | displayed = section.contentContainer.find( '.themes-displayed' ); |
2436 | 2438 | countEl = section.contentContainer.find( '.theme-count' ); |
| 2439 | countText = i18n.sprintf( i18n._n( '%s theme', '%s themes', count ), count ); |
2437 | 2440 | |
2438 | 2441 | if ( 0 === count ) { |
2439 | | countEl.text( '0' ); |
| 2442 | countEl.text( countText ); |
2440 | 2443 | } else { |
2441 | 2444 | |
2442 | 2445 | // Animate the count change for emphasis. |
2443 | 2446 | displayed.fadeOut( 180, function() { |
2444 | | countEl.text( count ); |
| 2447 | countEl.text( countText ); |
2445 | 2448 | displayed.fadeIn( 180 ); |
2446 | 2449 | } ); |
2447 | | wp.a11y.speak( api.settings.l10n.announceThemeCount.replace( '%d', count ) ); |
| 2450 | wp.a11y.speak( |
| 2451 | i18n.sprintf( i18n._n( 'Displaying %d theme', 'Displaying %d themes', count ), count ) |
| 2452 | ); |
2448 | 2453 | } |
2449 | 2454 | }, |
2450 | 2455 | |
… |
… |
|
5488 | 5493 | control.setting.notifications.remove( 'csslint_error' ); |
5489 | 5494 | |
5490 | 5495 | if ( 0 !== errorAnnotations.length ) { |
5491 | | if ( 1 === errorAnnotations.length ) { |
5492 | | message = api.l10n.customCssError.singular.replace( '%d', '1' ); |
5493 | | } else { |
5494 | | message = api.l10n.customCssError.plural.replace( '%d', String( errorAnnotations.length ) ); |
5495 | | } |
| 5496 | message = wp.i18n.sprintf( |
| 5497 | wp.i18n._n( |
| 5498 | 'There is %d error which must be fixed before you can save.', |
| 5499 | 'There are %d errors which must be fixed before you can save.', |
| 5500 | errorAnnotations.length |
| 5501 | ), |
| 5502 | errorAnnotations.length |
| 5503 | ) |
| 5504 | |
5496 | 5505 | control.setting.notifications.add( new api.Notification( 'csslint_error', { |
5497 | 5506 | message: message, |
5498 | 5507 | type: 'error' |
… |
… |
|
7515 | 7524 | |
7516 | 7525 | if ( invalidSettings.length ) { |
7517 | 7526 | api.notifications.add( new api.Notification( errorCode, { |
7518 | | message: ( 1 === invalidSettings.length ? api.l10n.saveBlockedError.singular : api.l10n.saveBlockedError.plural ).replace( /%s/g, String( invalidSettings.length ) ), |
| 7527 | message: wp.i18n.sprintf( |
| 7528 | wp.i18n._n( |
| 7529 | 'Unable to save due to %s invalid setting.', |
| 7530 | 'Unable to save due to %s invalid settings.', |
| 7531 | invalidSettings.length |
| 7532 | ), |
| 7533 | invalidSettings.length |
| 7534 | ), |
7519 | 7535 | type: 'error', |
7520 | 7536 | dismissible: true, |
7521 | 7537 | saveFailure: true |
diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php
index a46b97fa5a..638cfcfc64 100644
a
|
b
|
final class WP_Customize_Manager { |
4901 | 4901 | 'previewableDevices' => $this->get_previewable_devices(), |
4902 | 4902 | 'l10n' => array( |
4903 | 4903 | 'confirmDeleteTheme' => __( 'Are you sure you want to delete this theme?' ), |
4904 | | /* translators: %d: Number of theme search results, which cannot currently consider singular vs. plural forms. */ |
4905 | | 'themeSearchResults' => __( '%d themes found' ), |
4906 | | /* translators: %d: Number of themes being displayed, which cannot currently consider singular vs. plural forms. */ |
4907 | | 'announceThemeCount' => __( 'Displaying %d themes' ), |
4908 | 4904 | /* translators: %s: Theme name. */ |
4909 | 4905 | 'announceThemeDetails' => __( 'Showing details for theme: %s' ), |
4910 | 4906 | ), |
4911 | 4907 | ); |
4912 | 4908 | |
| 4909 | // These strings are here for backwards compatibility; the translations now occur in JavaScript. |
| 4910 | /* translators: %d: Number of theme search results. Note there is a newer translation of this string with singular and plural forms. */ |
| 4911 | $settings['l10n']['themeSearchResults'] = __( '%d themes found' ); |
| 4912 | /* translators: %d: Number of themes being displayed. Note there is a newer translation of this string with singular and plural forms. */ |
| 4913 | $settings['l10n']['announceThemeCount'] = __( 'Displaying %d themes' ); |
| 4914 | |
4913 | 4915 | // Temporarily disable installation in Customizer. See #42184. |
4914 | 4916 | $filesystem_method = get_filesystem_method(); |
4915 | 4917 | ob_start(); |
diff --git a/src/wp-includes/customize/class-wp-customize-themes-section.php b/src/wp-includes/customize/class-wp-customize-themes-section.php
index 75e57398ab..854d82af6f 100644
a
|
b
|
class WP_Customize_Themes_Section extends WP_Customize_Section { |
149 | 149 | <span class="themes-displayed"> |
150 | 150 | <?php |
151 | 151 | /* translators: %s: Number of themes displayed. */ |
152 | | printf( __( '%s themes' ), '<span class="theme-count">0</span>' ); |
| 152 | printf( _n( '%s theme', '%s themes', '<span class="theme-count">0</span>' ), '<span class="theme-count">0</span>' ); |
153 | 153 | ?> |
154 | 154 | </span> |
155 | 155 | </div> |
diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
index be95eee4cb..034caaf1ec 100644
a
|
b
|
function wp_default_scripts( $scripts ) { |
1115 | 1115 | $scripts->add( 'customize-preview', "/wp-includes/js/customize-preview$suffix.js", array( 'wp-a11y', 'customize-base' ), false, 1 ); |
1116 | 1116 | $scripts->add( 'customize-models', '/wp-includes/js/customize-models.js', array( 'underscore', 'backbone' ), false, 1 ); |
1117 | 1117 | $scripts->add( 'customize-views', '/wp-includes/js/customize-views.js', array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 ); |
1118 | | $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 ); |
| 1118 | $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 ); |
1119 | 1119 | did_action( 'init' ) && $scripts->localize( |
1120 | 1120 | 'customize-controls', |
1121 | 1121 | '_wpCustomizeControlsL10n', |
… |
… |
function wp_default_scripts( $scripts ) { |
1158 | 1158 | 'videoHeaderNotice' => __( 'This theme doesn’t support video headers on this page. Navigate to the front page or another page that supports video headers.' ), |
1159 | 1159 | // Used for overriding the file types allowed in Plupload. |
1160 | 1160 | 'allowedFiles' => __( 'Allowed Files' ), |
| 1161 | 'pageOnFrontError' => __( 'Homepage and posts page must be different.' ), |
| 1162 | 'scheduleDescription' => __( 'Schedule your customization changes to publish ("go live") at a future date.' ), |
| 1163 | '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.' ), |
| 1164 | 'themeInstallUnavailable' => sprintf( |
| 1165 | /* translators: %s: URL to Add Themes admin screen. */ |
| 1166 | __( 'You won’t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ), |
| 1167 | esc_url( admin_url( 'theme-install.php' ) ) |
| 1168 | ), |
| 1169 | 'publishSettings' => __( 'Publish Settings' ), |
| 1170 | 'invalidDate' => __( 'Invalid date.' ), |
| 1171 | 'invalidValue' => __( 'Invalid value.' ), |
| 1172 | // These strings are here for backward compatibility; the translations now occurs in JavaScript. |
1161 | 1173 | 'customCssError' => array( |
1162 | 1174 | /* translators: %d: Error count. */ |
1163 | 1175 | '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 ), |
1164 | 1176 | /* translators: %d: Error count. */ |
1165 | 1177 | '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 ), |
1166 | | // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. |
1167 | 1178 | ), |
1168 | | 'pageOnFrontError' => __( 'Homepage and posts page must be different.' ), |
1169 | 1179 | 'saveBlockedError' => array( |
1170 | 1180 | /* translators: %s: Number of invalid settings. */ |
1171 | 1181 | 'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ), |
1172 | 1182 | /* translators: %s: Number of invalid settings. */ |
1173 | 1183 | 'plural' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ), |
1174 | | // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. |
1175 | 1184 | ), |
1176 | | 'scheduleDescription' => __( 'Schedule your customization changes to publish ("go live") at a future date.' ), |
1177 | | '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.' ), |
1178 | | 'themeInstallUnavailable' => sprintf( |
1179 | | /* translators: %s: URL to Add Themes admin screen. */ |
1180 | | __( 'You won’t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ), |
1181 | | esc_url( admin_url( 'theme-install.php' ) ) |
1182 | | ), |
1183 | | 'publishSettings' => __( 'Publish Settings' ), |
1184 | | 'invalidDate' => __( 'Invalid date.' ), |
1185 | | 'invalidValue' => __( 'Invalid value.' ), |
1186 | 1185 | ) |
1187 | 1186 | ); |
1188 | 1187 | $scripts->add( 'customize-selective-refresh', "/wp-includes/js/customize-selective-refresh$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 ); |