[wp-trac] [WordPress Trac] #22225: WordPress does not localize ordinal suffixes in dates
WordPress Trac
noreply at wordpress.org
Tue Dec 29 19:10:21 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 realloc):
Replying to [comment:6 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
Thanks a lot! After reading http://php.net/manual/en/function.date.php
again I have to admit that your are completely right. 'S' is indeed not
meant for months but for days.
> 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?
It seems that the class NumberFormatter needs PHP 5 >= 5.3.0 and PECL intl
>= 1.0.0 ... I'm sure that discussions about these things will be very
interesting in the near future.
Anyway, I worked on a new solution today. ;) I think that WordPress should
at least provide the functionality for the English ordinal numbers but
should also come with a filter so that a developer could extend it easily.
In German the rules are very different for example: they append the suffix
'te' to numbers from 0 to 19 and 'ste' from 20 and above.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22225#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list