- Status
- Open
Overview of the issue
Some themes or plugins use the wp_date() or date_i18n() WordPress functions to display dates. These dates may use a suffix as 1st or 26th, depending on the parameters selected.
Currently, it’s not possible to translate date suffixes because of a longstanding known limitation in WordPress core.
Workaround
As a workaround, you can use the wp_date filter to get the date, then modify the suffix before it’s rendered on the page. Please make a full backup of your site before proceeding and follow the steps below:
- Add the following code to the functions.php file of your theme:
- Open the page where the dates are displayed. This will execute the filter added.
- Go to WPML → String Translation and translate the dates.
- You will need to translate each suffix separately (e.g. 1st, 2nd…) because it may change depending on the language.