[wp-trac] [WordPress Trac] #23056: date_i18n() does not localize dateformat 'r'

WordPress Trac noreply at wordpress.org
Mon Mar 12 10:26:36 UTC 2018


#23056: date_i18n() does not localize dateformat 'r'
--------------------------+----------------------
 Reporter:  jrf           |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  I18N          |     Version:  1.5
 Severity:  normal        |  Resolution:  invalid
 Keywords:  needs-patch   |     Focuses:
--------------------------+----------------------

Comment (by Rarst):

 More broad issue about broken shorthand formats: #20973

 On localization specifically I would argue it's not a purpose of
 `date_i18n()` to recognize specific format and intention behind it. What
 if someone supplies RFC822 in the "raw" form as `D, d M y H:i:s O` ? Their
 intent might be to get RFC822 output, with lack of localization implicit
 in it, but there is no way for implementing function to know.

 I would say `date_i18n()` is meant to localize any input. If result
 without localization is desired then `date()` should be used instead of
 it.

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


More information about the wp-trac mailing list