diff --git src/wp-includes/class.wp-scripts.php src/wp-includes/class.wp-scripts.php
index e843233cbc..cc6107eefa 100644
|
|
|
class WP_Scripts extends WP_Dependencies { |
| 545 | 545 | $json_translations = '{ "locale_data": { "messages": { "": {} } } }'; |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | | $output = '(function( translations ){' . |
| 549 | | 'translations.locale_data.messages[""].domain = "' . $domain . '";' . |
| 550 | | 'wp.i18n.setLocaleData( translations.locale_data.messages, "' . $domain . '" );' . |
| 551 | | '})(' . $json_translations . ');'; |
| | 548 | $output = <<<JS |
| | 549 | (function( domain, translations ){ |
| | 550 | var localeData = translations.locale_data[ domain ] || translations.locale_data.messages; |
| | 551 | localeData[""].domain = domain; |
| | 552 | wp.i18n.setLocaleData( localeData, domain ); |
| | 553 | })( "$domain", $json_translations ); |
| | 554 | JS; |
| 552 | 555 | |
| 553 | 556 | if ( $echo ) { |
| 554 | 557 | printf( "<script type='text/javascript'>\n%s\n</script>\n", $output ); |