Make WordPress Core

Ticket #65005: 65005.diff

File 65005.diff, 1.7 KB (added by mdhori15, 2 months ago)

The 7.0 branch still uses ( 'Next' ) and ( 'Previous' ) in wp_localize_jquery_ui_datepicker(). Attaching a patch to backport the _x() fix from trunk with proper context strings so translators can pick the correct grammatical form.

  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index b80853f664..1c954d04ec 100644
    a b function wp_localize_jquery_ui_datepicker() { 
    20202020                        'currentText'     => __( 'Today' ),
    20212021                        'monthNames'      => array_values( $wp_locale->month ),
    20222022                        'monthNamesShort' => array_values( $wp_locale->month_abbrev ),
    2023                         'nextText'        => __( 'Next' ),
    2024                         'prevText'        => __( 'Previous' ),
     2023                        'nextText'  => _x( 'Next', 'datepicker: navigate to next month' ),
     2024                        'prevText'  => _x( 'Previous', 'datepicker: navigate to previous month' ),
    20252025                        'dayNames'        => array_values( $wp_locale->weekday ),
    20262026                        'dayNamesShort'   => array_values( $wp_locale->weekday_abbrev ),
    20272027                        'dayNamesMin'     => array_values( $wp_locale->weekday_initial ),