[wp-trac] [WordPress Trac] #50040: Localize the jQuery datepicker when enqueued in the footer
WordPress Trac
noreply at wordpress.org
Tue Feb 3 11:26:22 UTC 2026
#50040: Localize the jQuery datepicker when enqueued in the footer
-------------------------------------------------+-------------------------
Reporter: jadpm | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: I18N | Version:
Severity: normal | Resolution:
Keywords: good-first-bug reporter-feedback | Focuses:
has-patch close |
-------------------------------------------------+-------------------------
Changes (by ozgursar):
* keywords: good-first-bug reporter-feedback has-patch needs-testing =>
good-first-bug reporter-feedback has-patch close
Comment:
== Reproduction Report
=== Environment
- WordPress: 7.0-alpha-61215-src
- PHP: 8.2.29
- Server: nginx/1.29.4
- Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
- Browser: Chrome 144.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
* Code Snippets 3.9.4
* Test Reports 1.2.1
=== Steps taken
1. Add the following snippet via `functions.php` or Code Snippets plugin
{{{
/**
* Plugin Name: Datepicker Footer Test
*/
add_action('wp_enqueue_scripts', 'enqueue_footer_datepicker');
function enqueue_footer_datepicker() {
// Enqueue jQuery UI Datepicker in the footer
wp_enqueue_script('jquery-ui-datepicker', '', [], false, true);
// Enqueue jQuery UI CSS (optional, for styling)
wp_enqueue_style('jquery-ui-style',
'//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css');
}
add_action( 'wp_footer', function () {
?>
<input type="text" id="test-datepicker" />
<script>
jQuery(function($){
$('#test-datepicker').datepicker();
});
</script>
<?php
} );
}}}
2. Change site language to Hindi
3. Visit homepage
4. Click data field at the footer
5. View the calendar
6. Repet the same steps for Gujarati
7. ❌ Bug is not occurring. The datepicker loaded in the footer was
localized correctly in both `Hindi` and `Gujarati` without applying the
patch.
=== Screenshots/Screencast with results
Hindi:
[[Image(https://i.imgur.com/iRC0YmO.png)]]
Gujarati:
[[Image(https://i.imgur.com/bc3QeT5.png)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50040#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list