mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 12:14:25 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@44134 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -954,7 +954,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'var mejsL10n = %s;',
|
||||
wp_json_encode(
|
||||
array(
|
||||
'language' => strtolower( strtok( is_admin() ? get_user_locale() : get_locale(), '_-' ) ),
|
||||
'language' => strtolower( strtok( determine_locale(), '_-' ) ),
|
||||
'strings' => array(
|
||||
'mejs.install-flash' => __( 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/' ),
|
||||
'mejs.fullscreen-off' => __( 'Turn off Fullscreen' ),
|
||||
|
||||
Reference in New Issue
Block a user