[wp-trac] [WordPress Trac] #44758: The REST API is not respecting the user's locale properly.
WordPress Trac
noreply at wordpress.org
Sun Oct 21 15:02:52 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 | Focuses: rest-api
-------------------------+-----------------------
Changes (by danielbachhuber):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"43776" 43776]:
{{{
#!CommitTicketReference repository="" revision="43776"
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.
Props flixos90, mnelson4, swissspidy, TimothyBlynJacobs.
Fixes #44758.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44758#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list