diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 56107ee475057..f613e23c71318 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -8,13 +8,12 @@ window.wp = window.wp || {}; ( function($) { // Set up our namespace... -var themes, l10n; +var themes; themes = wp.themes = wp.themes || {}; // Store the theme data and settings for organized and quick access. -// themes.data.settings, themes.data.themes, themes.data.l10n. +// themes.data.settings, themes.data.themes. themes.data = _wpThemeSettings; -l10n = themes.data.l10n; // Shortcut for isInstall check. themes.isInstall = !! themes.data.settings.isInstall; @@ -119,7 +118,7 @@ themes.view.Appearance = wp.Backbone.View.extend({ view.render(); this.searchContainer .find( '.search-box' ) - .append( $.parseHTML( '' ) ) + .append( $.parseHTML( '' ) ) .append( view.el ); this.searchContainer.on( 'submit', function( event ) { @@ -973,9 +972,9 @@ themes.view.Preview = themes.view.Details.extend({ collapse: function( event ) { var $button = $( event.currentTarget ); if ( 'true' === $button.attr( 'aria-expanded' ) ) { - $button.attr({ 'aria-expanded': 'false', 'aria-label': l10n.expandSidebar }); + $button.attr({ 'aria-expanded': 'false', 'aria-label': wp.i18n.__( 'Expand Sidebar' ) }); } else { - $button.attr({ 'aria-expanded': 'true', 'aria-label': l10n.collapseSidebar }); + $button.attr({ 'aria-expanded': 'true', 'aria-label': wp.i18n.__( 'Collapse Sidebar' ) }); } this.$el.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); @@ -1221,7 +1220,7 @@ themes.view.Themes = wp.Backbone.View.extend({ // 'Add new theme' element shown at the end of the grid. if ( ! themes.isInstall && themes.data.settings.canInstall ) { - this.$el.append( '
' ); + this.$el.append( '' ); } this.parent.page++; @@ -1277,7 +1276,7 @@ themes.view.Themes = wp.Backbone.View.extend({ $modal.find( '.notice-warning' ) .removeClass( 'notice-large' ) .addClass( 'updating-message' ) - .find( 'p' ).text( wp.updates.l10n.updating ); + .find( 'p' ).text( wp.i18n.__( 'Updating...' ) ); } else if ( $card.find( '.notice-error' ).length ) { $modal.find( '.notice-warning' ).remove(); } @@ -1356,9 +1355,10 @@ themes.view.Themes = wp.Backbone.View.extend({ // Dispatch audible search results feedback message. announceSearchResults: function( count ) { if ( 0 === count ) { - wp.a11y.speak( l10n.noThemesFound ); + wp.a11y.speak( wp.i18n.__( 'No themes found. Try a different search.' ) ); } else { - wp.a11y.speak( l10n.themesFound.replace( '%d', count ) ); + /* translators: %d: Number of themes. */ + wp.a11y.speak( wp.i18n.sprintf( wp.i18n.__( 'Number of Themes found: %d' ), count ) ); } } }); @@ -1676,7 +1676,8 @@ themes.view.Installer = themes.view.Appearance.extend({ this.listenTo( this.collection, 'query:fail', function() { $( 'body' ).removeClass( 'loading-content' ); $( '.theme-browser' ).find( 'div.error' ).remove(); - $( '.theme-browser' ).find( 'div.themes' ).before( '' + l10n.error + '
' + wp.i18n.sprintf( wp.i18n.__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.' ), 'https://wordpress.org/support/forums/' ) + '