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

WordPress Trac noreply at wordpress.org
Fri Dec 14 01:31:31 UTC 2018


#44758: The REST API is not respecting the user's locale properly.
---------------------------------+-----------------------
 Reporter:  youknowriad          |       Owner:  pento
     Type:  enhancement          |      Status:  closed
 Priority:  normal               |   Milestone:  5.0
Component:  REST API             |     Version:
 Severity:  normal               |  Resolution:  fixed
 Keywords:  has-patch fixed-5.0  |     Focuses:  rest-api
---------------------------------+-----------------------
Changes (by jeremyfelt):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"44134" 44134]:
 {{{
 #!CommitTicketReference repository="" revision="44134"
 REST API: Render response in user locale with `?_locale=user`.

 Introduces new `determine_locale()` function for deciding the proper
 locale to use for a response. Default value is `get_user_locale()` in the
 admin, and `get_locale()` on the frontend. Because REST API requests are
 considered frontend requests, `?_locale=user` can be used to render the
 response in the user's locale.

 Also updates `wp-login.php?wp_lang` implementation to benefit from this
 abstraction.

 Merges [43776] from the 5.0 branch to trunk.

 Props flixos90, mnelson4, swissspidy, TimothyBlynJacobs.
 Fixes #44758.
 }}}

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


More information about the wp-trac mailing list