[wp-trac] [WordPress Trac] #51871: Site Health actions that use the REST API receive an untranslated response

WordPress Trac noreply at wordpress.org
Tue Dec 1 03:42:45 UTC 2020


#51871: Site Health actions that use the REST API receive an untranslated response
--------------------------+--------------------------------
 Reporter:  oglekler      |       Owner:  TimothyBlynJacobs
     Type:  defect (bug)  |      Status:  closed
 Priority:  high          |   Milestone:  5.6
Component:  Site Health   |     Version:  5.6
 Severity:  normal        |  Resolution:  fixed
 Keywords:  2nd-opinion   |     Focuses:  rest-api
--------------------------+--------------------------------
Changes (by TimothyBlynJacobs):

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


Comment:

 In [changeset:"49716" 49716]:
 {{{
 #!CommitTicketReference repository="" revision="49716"
 Site Health, App Passwords: Ensure REST API responses are properly
 translated.

 The REST API requests in Site Health and App Passwords now include
 `_locale=user` in the request URL to ensure the user's locale is used
 instead of the site locale. Additionally, the `apiRequest` library now
 sends a JSON `Accept` header which is required by `determine_locale()` to
 respect the `_locale` query parameter.

 The Site Health REST API controllers now manually load the default admin
 textdomain if not `is_admin()`. This allows for the Site Health tests to
 be translated even though the translations are part of the administration
 project and the REST API is not.

 Props oglekler, kebbet, Clorith, TimothyBlynJacobs, ocean90,
 SergeyBiryukov, adamsilverstein.
 Fixes #51871.
 }}}

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


More information about the wp-trac mailing list