mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 11:14:36 +00:00
I18N, Script Loader: Don't register empty locale data objects.
For `wp.i18n` the library [https://github.com/messageformat/Jed Jed] was initially used which was throwing an error if a domain was not registered but used in a translate function. Later, the library was replaced by [https://github.com/aduth/tannin Tannin] which no longer requires the domain to be registered and thus we can avoid printing an empty-ish translations script that doesn't add any translations. Props jsnajdr. Fixes #55250. git-svn-id: https://develop.svn.wordpress.org/trunk@52937 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -599,8 +599,7 @@ class WP_Scripts extends WP_Dependencies {
|
||||
$json_translations = load_script_textdomain( $handle, $domain, $path );
|
||||
|
||||
if ( ! $json_translations ) {
|
||||
// Register empty locale data object to ensure the domain still exists.
|
||||
$json_translations = '{ "locale_data": { "messages": { "": {} } } }';
|
||||
return false;
|
||||
}
|
||||
|
||||
$output = <<<JS
|
||||
|
||||
Reference in New Issue
Block a user