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

WordPress Trac noreply at wordpress.org
Wed Aug 2 20:19:53 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        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I have a localized theme set to Spanish language.  Everything works fine.

 I change my user profile language to English.

 Now, when logged in, the method called by admin-ajax returns the dates in
 English, not Spanish.  Everything else remains in Spanish.

 When not logged in, or when my user profile language is set to Spanish,
 the method called by admin-ajax returns the dates in Spanish, as expected.

 I'm assuming that admin-ajax is defaulting to the user language instead of
 the theme language.  This is a problem if you are trying to develop themes
 in languages other than your own.

 It is also a problem because there is no obvious way to fix this.  I've
 tried many ways to localize the dates manually in the method called by
 admin-ajax, but nothing works.  I've even added a load_textdomain() call
 before the dates, but that doesn't localize them either.

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


More information about the wp-trac mailing list