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

WordPress Trac noreply at wordpress.org
Wed Aug 8 17:00:20 UTC 2018


#44758: The REST API is not respecting the user's locale properly.
--------------------------+-----------------------------
 Reporter:  youknowriad   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When calling REST API endpoints such as `/taxonomies?context=edit`, the
 `labels` returned are always using the default locale of the site even if
 the authenticated user has changed its locale in his profile.

 Interestingly, if you use `WP_REST_Request` to call these same API
 endpoints with the same user, it uses the user's locale in that case.

 1- We should be consistent and always use the authenticated user's locale
 2- If we want the default behavior to be using the site's locale then we
 should have a way to pass the desired locale as an argument to these
 endpoints because in Gutenberg (using the REST API), users expect the UI
 to respect their profile's locale.

 Related Gutenberg issue https://github.com/WordPress/gutenberg/issues/8449

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


More information about the wp-trac mailing list