#65005 closed defect (bug) (fixed)
Next/Previous for datepicker needs context
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | I18N | Keywords: | has-patch commit dev-reviewed i18n-change |
| Focuses: | Cc: |
Description
Many locales can't use one word for different contexts. E.g. we Germans like to see "Nächster"/"Vorheriger" instead of "Weiter" which means more or less move forward or continue and is only used when it must be.
Attachments (1)
Change History (14)
This ticket was mentioned in PR #11412 on WordPress/wordpress-develop by @anupkankale.
6 weeks ago
#3
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/65005
## Description
Adds context for translators to disambiguate 'Next' and 'Previous' in the datepicker navigation.
This helps translators in languages like German where different words are used depending on context (e.g., "Nächster"/"Vorheriger" instead of "Weiter").
## Changes
- Changed
__( 'Next' )to_x( 'Next', 'datepicker: navigate to next month' )insrc/wp-includes/script-loader.php - Changed
__( 'Previous' )to_x( 'Previous', 'datepicker: navigate to previous month' )insrc/wp-includes/script-loader.php
## Testing
- The strings will now appear with context in translate.wordpress.org
- No functional changes to the datepicker behavior
#4
@
6 weeks ago
I've created a pull request for this:
https://github.com/WordPress/wordpress-develop/pull/11412
Changed:
__( 'Next' )to_x( 'Next', 'datepicker: navigate to next month' )__( 'Previous' )to_x( 'Previous', 'datepicker: navigate to previous month' )
in src/wp-includes/script-loader.php (lines 2023-2024).
#6
@
6 weeks ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 62188:
#7
@
6 weeks ago
- Keywords commit dev-feedback added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for 7.0 consideration.
#8
@
6 weeks ago
- Keywords dev-reviewed i18n-change added; dev-feedback removed
The change looks good to me. Adding dev-reviewed and i18n-change workflow keywords.
This ticket was mentioned in Slack in #core-test by r1k0. View the logs.
6 weeks ago
#10
@
6 weeks ago
Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11412
Environment
- WordPress: 7.0-beta6-62085-src
- PHP: 8.3.30
- Server: nginx/1.29.7
- Database: MySQL 8.4.8
- Browser: Brave
- OS: Ubuntu 24.04
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None
- Plugins: None
Steps Taken
- Applied PR #11412.
- Opened Posts > Add New and clicked the publish date field to open the datepicker.
- Clicked Next and Previous buttons to navigate between months. Both buttons worked correctly.
✅ Patch is solving the problem
Expected Result
The datepicker Next and Previous buttons should function correctly
after the i18n context strings are added.
Additional Notes
- This is a pure i18n change. No visual difference is expected.
The strings
NextandPreviousnow use_x()with translator context instead of__(), helping translators in languages where context determines the correct word. - Datepicker navigation confirmed working on WordPress 7.0-beta6.
Screenshots
@
5 weeks 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.
#11
@
5 weeks ago
Hello and thank you @mdhori15 but this is already fixed in trunk by this changeset: [62188].
Now we only need to backport this changeset to branch 7.0 and this doesn't require a new patch :)


I'm working on a patch for this. Will submit a PR shortly.
#65005