[wp-trac] [WordPress Trac] #44758: The REST API is not respecting the user's locale properly.

WordPress Trac noreply at wordpress.org
Thu Sep 13 05:09:33 UTC 2018


#44758: The REST API is not respecting the user's locale properly.
-------------------------------------------------+-------------------------
 Reporter:  youknowriad                          |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  REST API                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion has-patch has-unit-      |     Focuses:
  tests dev-feedback                             |
-------------------------------------------------+-------------------------

Comment (by swissspidy):

 How big of an issue are the untranslated post type labels for this? Happy
 to work on #38218 in the next few weeks. I had a PoC patch lying around
 somewhere a while ago...

 Also, how much trouble would it cause to set the locale way earlier than
 now to circumvent this?

 > This is probably tangent, but it might be helpful here if all the
 occurences of `is_admin() ? get_user_locale() : get_locale()` were
 replaced with a method something like

 Sounds interesting. This is already used quite a bit in WordPress, so I'm
 sure we could DRY things up a bit. Not sure if we really need yet another
 filter for this... Essentially you only need the locale filter and the
 user meta filter for the locale. I wouldn't want to change this.

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


More information about the wp-trac mailing list