WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 8 months ago

#24899 closed defect (bug) (invalid)

Date_i18n: translate shorthand months and weekdays

Reported by: Daedalon Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.2
Component: I18N Keywords:
Focuses: Cc:

Description

Date_i18n allows months and weekdays to be shown in shorthand formats, but those are always forced to be three letters long. That's correct for English and several other languages, but wrong for many.

An example of proper shorthands in Finnish:
"January" -> "Jan" - "Tammikuu" -> "Tammi" (5 letters, varies between 3-6)
"Monday" -> "Mon" - "Maanantai" -> "Ma" (2 letters, always the same)

At the moment date_i18n( 'D M', $timestamp ) always returns a result that isn't appropriate in these languages: Arabic, Azerbaijani, Greek, Estonian, Farsi, Finnish, Hebrew, Croatian, Hungarian, Armenian, Indonesian, Korean, Lithuanian, Polish, Tamil, Thai, Vietnamese and Chinese. Half the population of the planet.

Instead of 'D' returning a three letter weekday and 'M' returning a three letter month, they should return the localized shorthand weekday and shorthand month regardless of length.

Change History (3)

#1 @pavelevap
3 years ago

  • Cc pavelevap@… added

Related: #21139

#2 @chriscct7
8 months ago

  • Keywords needs-patch added

#3 in reply to: ↑ description @johnbillion
8 months ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Replying to Daedalon:

Date_i18n allows months and weekdays to be shown in shorthand formats, but those are always forced to be three letters long.

I don't believe this was ever the case. If it was, then this has been fixed at some point.

Instead of 'D' returning a three letter weekday and 'M' returning a three letter month, they should return the localized shorthand weekday and shorthand month regardless of length.

This is what happens currently.

I'm going to close this as invalid. If anyone knows otherwise, please re-open with more details!

Note: See TracTickets for help on using tickets.