Automattic / WP-Job-Manager

Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.

Home Page:https://wpjobmanager.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with expiry date field on French sites

danjjohnson opened this issue · comments

When site language is set to Français, the date field doesn't work properly, it displays letters instead of the day and year:

image

May affect other locales, but I tried a few and only found French to be an issue.

2701237-t

2723110-t

Was working fine recently. Maybe due to an update of WP Job Manager or Wordpress?

I fixed it on my site by removing the translation with Loco Translate. But this fix will be canceled by each update...

This happens with Italian localization as well:

screenshot-2016-08-05 12-04-24

But the field placeholder appears to be correctly localized:

screenshot-2016-08-05 12-17-31

Also, I believe the error causes the datetime picker to be misplaced when editing the page (it then moves back to the proper position after clicking the field):

screenshot-2016-08-05 12-05-30

Of the many datepickers in my installation, this is the only one behaving that way.
I have no errors in my js console.

Confirmed this happens when a translation changes the yy-mm-dd format to something else (e.g. Italian aa-mm-gg) This breaks the datepicker

Temporary workaround is to install Loco Translate and change that string back to yy-mm-dd

screen shot 2016-08-09 at 16 00 43

You can then move the language file to the wp-content/languages/plugins directory to prevent it being updated.

I changed the language of my test site to French but the date picker in the post editor behaved correctly on a new job and while editing an existing job.

I tried Italian too, but that showed "aa-11-gg" in the datepicker of the post editor.

The French .po now has this translation:

msgctxt "Date format for jQuery datepicker"
msgid "yy-mm-dd"
msgstr "yy-mm-dd"

While the Italian one is:

msgctxt "Date format for jQuery datepicker"
msgid "yy-mm-dd"
msgstr "aa-mm-gg"

jQuery doesn't understand aa and gg. Here's the date format in jQuery which does not include aa or gg. I'll update the description of that strings and link to that page.

@akirk has suggested changes to the French and Italian translations on WordPress.org to fix these errors, and I have checked in translator comments linking to the documentation for the date formats in PHP and Javascript where they're needed.