From 2e8464405d04e018597586948fbbc2ec6ff50574 Mon Sep 17 00:00:00 2001 From: Manish Date: Tue, 10 Feb 2026 18:07:42 +0530 Subject: [PATCH 1/4] Fix: Replace deprecated wp.updates.l10n.updating with wp.i18n.__ Replaces deprecated wp.updates.l10n.updating with wp.i18n.__( 'Updating...' ) in theme.js to resolve deprecation notice. Props: [Your WordPress.org username] Fixes #64619 --- src/js/_enqueues/wp/theme.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 56107ee475057..82799f9b2cb5f 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -1277,7 +1277,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(); } From 82ec88f774f7d70308d7e06c2951acc5a4a28250 Mon Sep 17 00:00:00 2001 From: Manish Date: Wed, 11 Feb 2026 14:10:31 +0530 Subject: [PATCH 2/4] pr comments resolved --- src/js/_enqueues/wp/theme.js | 19 +++++++++---------- src/wp-admin/theme-install.php | 28 +++++++++++++--------------- src/wp-admin/themes.php | 9 +++++---- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 82799f9b2cb5f..6eecd1cd87fea 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 = _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.__( themes.data.l10n.expandSidebar ) }); } else { - $button.attr({ 'aria-expanded': 'true', 'aria-label': l10n.collapseSidebar }); + $button.attr({ 'aria-expanded': 'true', 'aria-label': wp.i18n.__( themes.data.l10n.collapseSidebar ) }); } 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++; @@ -1356,9 +1355,9 @@ 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.__( themes.data.l10n.noThemesFound ) ); } else { - wp.a11y.speak( l10n.themesFound.replace( '%d', count ) ); + wp.a11y.speak( wp.i18n.sprintf( wp.i18n.__( themes.data.l10n.themesFound ), count ) ); } } }); @@ -1676,7 +1675,7 @@ 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 + '

' ); + $( '.theme-browser' ).find( 'div.themes' ).before( '

' + wp.i18n.sprintf( wp.i18n.__( themes.data.l10n.error ), 'https://wordpress.org/support/forums/' ) + '

' ); $( '.theme-browser .error .try-again' ).on( 'click', function( e ) { e.preventDefault(); $( 'input.wp-filter-search' ).trigger( 'input' ); @@ -1808,7 +1807,7 @@ themes.view.Installer = themes.view.Appearance.extend({ } if ( ! tags ) { - wp.a11y.speak( l10n.selectFeatureFilter ); + wp.a11y.speak( wp.i18n.__( themes.data.l10n.selectFeatureFilter ) ); return; } diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index e9d217c0f7525..64f2741a2bbff 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -54,23 +54,20 @@ 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ), ), 'l10n' => array( - 'addNew' => __( 'Add Theme' ), - 'search' => __( 'Search Themes' ), - 'upload' => __( 'Upload Theme' ), - 'back' => __( 'Back' ), - 'error' => sprintf( - /* translators: %s: Support forums URL. */ - __( '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/' ) - ), - 'tryAgain' => __( 'Try Again' ), + 'addNew' => 'Add Theme', + 'search' => 'Search Themes', + 'upload' => 'Upload Theme', + 'back' => 'Back', + /* translators: %s: Support forums URL. */ + 'error' => '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.', + 'tryAgain' => 'Try Again', /* translators: %d: Number of themes. */ - 'themesFound' => __( 'Number of Themes found: %d' ), - 'noThemesFound' => __( 'No themes found. Try a different search.' ), - 'collapseSidebar' => __( 'Collapse Sidebar' ), - 'expandSidebar' => __( 'Expand Sidebar' ), + 'themesFound' => 'Number of Themes found: %d', + 'noThemesFound' => 'No themes found. Try a different search.', + 'collapseSidebar' => 'Collapse Sidebar', + 'expandSidebar' => 'Expand Sidebar', /* translators: Hidden accessibility text. */ - 'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ), + 'selectFeatureFilter' => 'Select one or more Theme features to filter by', ), 'installedThemes' => array_keys( $installed_themes ), 'activeTheme' => get_stylesheet(), @@ -78,6 +75,7 @@ ); wp_enqueue_script( 'theme' ); +wp_set_script_translations( 'theme' ); wp_enqueue_script( 'updates' ); if ( $tab ) { diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index ca9f52b2a164f..37cf399bc6c76 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -231,17 +231,18 @@ 'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ), ), 'l10n' => array( - 'addNew' => __( 'Add Theme' ), - 'search' => __( 'Search installed themes' ), + 'addNew' => 'Add Theme', + 'search' => 'Search installed themes', /* translators: %d: Number of themes. */ - 'themesFound' => __( 'Number of Themes found: %d' ), - 'noThemesFound' => __( 'No themes found. Try a different search.' ), + 'themesFound' => 'Number of Themes found: %d', + 'noThemesFound' => 'No themes found. Try a different search.', ), ) ); add_thickbox(); wp_enqueue_script( 'theme' ); +wp_set_script_translations( 'theme' ); wp_enqueue_script( 'updates' ); require_once ABSPATH . 'wp-admin/admin-header.php'; From 05909b358125085e5116c93f171a5698e230f21e Mon Sep 17 00:00:00 2001 From: Manish Dhorepatil Date: Fri, 13 Feb 2026 08:43:34 +0530 Subject: [PATCH 3/4] Apply suggestion from @westonruter Co-authored-by: Weston Ruter --- src/js/_enqueues/wp/theme.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 6eecd1cd87fea..abadbaa5c0514 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -1807,7 +1807,7 @@ themes.view.Installer = themes.view.Appearance.extend({ } if ( ! tags ) { - wp.a11y.speak( wp.i18n.__( themes.data.l10n.selectFeatureFilter ) ); + wp.a11y.speak( wp.i18n.__( 'Select one or more Theme features to filter by' ) ); return; } From 2c024ca86d9d8644e53222521591908a80d489d9 Mon Sep 17 00:00:00 2001 From: Manish Date: Fri, 13 Feb 2026 09:28:45 +0530 Subject: [PATCH 4/4] resolved comments --- src/js/_enqueues/wp/theme.js | 21 ++++++++++++--------- src/wp-admin/theme-install.php | 16 ---------------- src/wp-admin/themes.php | 7 ------- 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 6eecd1cd87fea..f613e23c71318 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -12,7 +12,7 @@ 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; // Shortcut for isInstall check. @@ -118,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 ) { @@ -972,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': wp.i18n.__( themes.data.l10n.expandSidebar ) }); + $button.attr({ 'aria-expanded': 'false', 'aria-label': wp.i18n.__( 'Expand Sidebar' ) }); } else { - $button.attr({ 'aria-expanded': 'true', 'aria-label': wp.i18n.__( themes.data.l10n.collapseSidebar ) }); + $button.attr({ 'aria-expanded': 'true', 'aria-label': wp.i18n.__( 'Collapse Sidebar' ) }); } this.$el.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); @@ -1220,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++; @@ -1355,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( wp.i18n.__( themes.data.l10n.noThemesFound ) ); + wp.a11y.speak( wp.i18n.__( 'No themes found. Try a different search.' ) ); } else { - wp.a11y.speak( wp.i18n.sprintf( wp.i18n.__( themes.data.l10n.themesFound ), count ) ); + /* translators: %d: Number of themes. */ + wp.a11y.speak( wp.i18n.sprintf( wp.i18n.__( 'Number of Themes found: %d' ), count ) ); } } }); @@ -1675,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( '

' + wp.i18n.sprintf( wp.i18n.__( themes.data.l10n.error ), 'https://wordpress.org/support/forums/' ) + '

' ); + /* translators: %s: Support forums URL. */ + $( '.theme-browser' ).find( 'div.themes' ).before( '

' + 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/' ) + '

' ); $( '.theme-browser .error .try-again' ).on( 'click', function( e ) { e.preventDefault(); $( 'input.wp-filter-search' ).trigger( 'input' ); @@ -1807,7 +1809,8 @@ themes.view.Installer = themes.view.Appearance.extend({ } if ( ! tags ) { - wp.a11y.speak( wp.i18n.__( themes.data.l10n.selectFeatureFilter ) ); + /* translators: Hidden accessibility text. */ + wp.a11y.speak( wp.i18n.__( 'Select one or more Theme features to filter by' ) ); return; } diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 64f2741a2bbff..aac20ea24cb63 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -53,22 +53,6 @@ 'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null, 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ), ), - 'l10n' => array( - 'addNew' => 'Add Theme', - 'search' => 'Search Themes', - 'upload' => 'Upload Theme', - 'back' => 'Back', - /* translators: %s: Support forums URL. */ - 'error' => '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.', - 'tryAgain' => 'Try Again', - /* translators: %d: Number of themes. */ - 'themesFound' => 'Number of Themes found: %d', - 'noThemesFound' => 'No themes found. Try a different search.', - 'collapseSidebar' => 'Collapse Sidebar', - 'expandSidebar' => 'Expand Sidebar', - /* translators: Hidden accessibility text. */ - 'selectFeatureFilter' => 'Select one or more Theme features to filter by', - ), 'installedThemes' => array_keys( $installed_themes ), 'activeTheme' => get_stylesheet(), ) diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index 37cf399bc6c76..096e869f7c316 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -230,13 +230,6 @@ 'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ), 'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ), ), - 'l10n' => array( - 'addNew' => 'Add Theme', - 'search' => 'Search installed themes', - /* translators: %d: Number of themes. */ - 'themesFound' => 'Number of Themes found: %d', - 'noThemesFound' => 'No themes found. Try a different search.', - ), ) );