I18N: Set translations for all WordPress packages scripts.
Calls `wp_set_script_translations` for all packages scripts that have translations. Also correctly sets the domain on the translations. Props omarreiss, pento, ocean90. Merges [43878] to trunk. Fixes #45161. Built from https://develop.svn.wordpress.org/trunk@44239 git-svn-id: http://core.svn.wordpress.org/trunk@44069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -546,7 +546,8 @@ class WP_Scripts extends WP_Dependencies {
|
||||
}
|
||||
|
||||
$output = '(function( translations ){' .
|
||||
'wp.i18n.setLocaleData( translations.locale_data, "' . $domain . '" );' .
|
||||
'translations.locale_data.messages[""].domain = "' . $domain . '";' .
|
||||
'wp.i18n.setLocaleData( translations.locale_data.messages, "' . $domain . '" );' .
|
||||
'})(' . $json_translations . ');';
|
||||
|
||||
if ( $echo ) {
|
||||
|
||||
Reference in New Issue
Block a user