Incompatibility with Polylang Pro plugin
markhowellsmead opened this issue · 4 comments
When I use date_i18n
or get_the_date
when Polylang (Pro) and the Preferred Languages plugin are in use, and the user-preferred languages are set to Deutsch (Schweiz) and fallback Deutsch (Sie), the date is always returned in the default site language. e.g. 17. Februar 2021
instead of 17. février 2021
for a Post translated to French.
Steps to reproduce the issue
- Install the plugins detailed above and configure the site with German and French as Polylang languages.
- Set the WordPress languages as Deutsch (Schweiz) and fallback Deutsch (Sie) using the Preferred Languages plugin.
- Load a French Post and review the
date_i18n
output.
Expected behavior and actual behavior
When I follow those steps, I see the date in German.
I was expecting the date in French.
See also polylang/polylang#776.
Odd that this happens, since the plugin should be bailing early if a plugin like Polylang is already filtering the current locale:
preferred-languages/inc/functions.php
Lines 352 to 355 in a119402
preferred-languages/inc/functions.php
Lines 787 to 790 in a119402
I'll try to see whether I can reproduce this with the free version.
I am not able to reproduce this, with the free version at least.
Preferred Languages
Polylang Languages:
Posts (one in each language);
Output
Output of date_i18n( 'j F Y')
and get_the_date( 'j F Y')
for each post:
- French:
9 mars 2021
- English:
9 March 2021
- German:
9 März 2021
So everything in order there.
@markhowellsmead could you try to see if it works for your with the free version?
Closing for now as this is an unconfirmed issue.
I cannot replicate this problem in a clean install with the free version of Polylang.