[wp-trac] [WordPress Trac] #22225: WordPress does not localize ordinal suffixes in dates

WordPress Trac noreply at wordpress.org
Mon Dec 28 19:09:09 UTC 2015


#22225: WordPress does not localize ordinal suffixes in dates
-------------------------------------------------+-------------------------
 Reporter:  mihaimihai                           |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  I18N                                 |  Review
 Severity:  normal                               |     Version:  3.4.2
 Keywords:  dev-feedback has-patch has-unit-     |  Resolution:
  tests needs-testing                            |     Focuses:
-------------------------------------------------+-------------------------

Comment (by gibrown):

 @realloc nice approach of using wp-locale, but I think there is some
 confusion about 'S'. It is the day of the month rather than the month
 number. So for instance, the output of

 {{{#!php
 <?php
 date_i18n( 'S', 1424001600 ) //Feb 15th, 2015
 }}}

 Should not be expecting 'nd' in the unit test, it should be 'th'.

 I think it needs a function that is hardcoded into wp-locale to handle
 each locale. Maybe something based off of
 [https://en.wikipedia.org/wiki/Ordinal_indicator this wikipedia article]?
 For some languages we should entirely remove the 'S'. I ended up here due
 to Russian and Hebrew localization of 'F jS' where I think I understand
 the best solution to be removing the 'S' entirely. cc @kovshenin

 Also looks like in PHP 5.3.0+ there is support for
 [http://stackoverflow.com/a/4392684 formatting an ordinal]. So maybe
 should use that with a reasonable fall back for old versions of PHP?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/22225#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list