WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/15/2018 02:36:39 PM (3 years ago)
Author:
herregroen
Message:

I18N: Fix warnings in JavaScript translations.

Fixes an undefined index PHP warning in the load_script_textdomain function and a non-interrupting JS error when registering a domain which has no translations.

Props omarreiss, ocean90, georgestephanis.
Fixes #45256.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/class.wp-scripts.php

    r43878 r43898  
    529529
    530530        if ( ! $json_translations ) {
    531             return false;
     531            // Register empty locale data object to ensure the domain still exists.
     532            $json_translations = '{ "locale_data": { "messages": { "": {} } } }';
    532533        }
    533534
Note: See TracChangeset for help on using the changeset viewer.