mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@44239 602fd350-edb4-49c9-b593-d223f7449a82
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