Make WordPress Core

Opened 20 months ago

Last modified 20 months ago

#24899 new defect (bug)

Date_i18n: translate shorthand months and weekdays

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


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 (1)

comment:1 @pavelevap20 months ago

  • Cc pavelevap@… added

Related: #21139

Note: See TracTickets for help on using tickets.