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

WordPress Trac noreply at wordpress.org
Thu Sep 6 18:43:05 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 mnelson4):

 > The issue is that a custom post type will still have incorrect labels

 Ahhh ok that makes sense then.

 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

 {{{

 function determine_locale() {
   return apply_filters('determine_locale', is_admin() ? get_user_locale()
 : get_locale());
 }
 }}}
 Then we'd have at least one filter we could use to change this behaviour,
 rather than dozens. Plus, repeating `is_admin() ? get_user_locale() :
 get_locale()` all over is essentially hard-coding that admin requests will
 always be in the user's locale, and all other requests will be in the
 site's locale (which we'd like to modify on this ticket)

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


More information about the wp-trac mailing list