[wp-trac] [WordPress Trac] #41539: Dates not localized in admin-ajax when logged in

WordPress Trac noreply at wordpress.org
Thu Aug 3 15:31:49 UTC 2017


#41539: Dates not localized in admin-ajax when logged in
--------------------------+------------------------------
 Reporter:  philjms       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  I18N          |     Version:  4.7.4
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+------------------------------
Changes (by swissspidy):

 * keywords:   => close


Comment:

 Hey there,

 As the name and file location implies, `admin-ajax.php` runs within admin
 context, where everything is displayed in the user's locale.

 If you want to use strings in a different locale, use
 `switch_to_locale()`. See https://make.wordpress.org/core/2016/11/07/user-
 admin-languages-and-locale-switching-in-4-7/ for some explanation and
 examples.

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


More information about the wp-trac mailing list