Skip to content

Conversation

@georgeh
Copy link
Contributor

@georgeh georgeh commented Nov 15, 2018

Description

wp-date is deprecating its moment method, so we need to localize

Closes #4533 and #9109

How has this been tested?

Screenshots

Localized month and day (Esperanto
screen shot 2018-11-16 at 9 58 22 am
)

Week starts on Wednesday:
screen shot 2018-11-16 at 9 55 50 am

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@georgeh
Copy link
Contributor Author

georgeh commented Nov 16, 2018

@nosolosw and @jasmussen would you mind looking to see if the capitalization rules are correct in Español and Dansk? It's correct for English but I'm seeing lower-case where I'm not expecting it.

To test, check out the branch, set your language in wp-admin, then open the "Publish" date picker on a post. All the changes are in PHP so no rebuild is needed.

@georgeh georgeh requested a review from youknowriad November 16, 2018 15:56
@swissspidy
Copy link
Member

For core merge we might do something similar as with wp_localize_jquery_ui_datepicker()

@swissspidy swissspidy added the Internationalization (i18n) Issues or PRs related to internationalization efforts label Nov 20, 2018
@oandregal
Copy link
Member

In Spanish, Month and Day of Week are in lowercase, both in the settings page and the date picker.

Settings page:

If I choose "j M, Y" in the date format input, I see the textual three letters month in uppercase (eg: Nov), but the calendar still shows the full month.

date-format-es-f

Calendar

date-format-es-calendar

@oandregal
Copy link
Member

oandregal commented Nov 20, 2018

Portuguese is uppercase:

Settings

date-format-pt

Calendar

date-format-pt-calendar

@oandregal
Copy link
Member

oandregal commented Nov 20, 2018

I've checked and different apps have different ways to localize dates in Spanish: I get lowercase months in some and uppercase in others.

In case it's helpful, I've checked the Spanish translations in GlotPress (WordPress project) and they are consistent with what I saw in the settings page/calendar (lowercase for weekdays and whole months, uppercase for 3-letter months):

wordpress-translation-weekdays
wordpress-translation-months

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does work for me in French and Arabic. I'd have preferred a fix in the data picker component instead of relying on moment being available as a global. That said it can be refactored later.

Would you mind rebasing and merging?

@georgeh georgeh force-pushed the fix/4533/localize-datepicker branch from 21e6166 to a947dbc Compare November 20, 2018 15:42
@georgeh georgeh merged commit a61be20 into master Nov 20, 2018
@georgeh georgeh deleted the fix/4533/localize-datepicker branch November 20, 2018 16:05
@youknowriad
Copy link
Contributor

This will be backported in Core during the packages updates.

@nellofn
Copy link

nellofn commented Sep 10, 2020

Just to drag some attention to this issue that's affecting users with the dashboard language being set to other than English:

#9109 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Internationalization (i18n) Issues or PRs related to internationalization efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DateTimePicker: Localize Weekdays

6 participants