Make WordPress Core


Ignore:
Timestamp:
12/16/2018 10:23:34 PM (6 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-includes/class.wp-scripts.php

    r44169 r44239  
    547547
    548548        $output = '(function( translations ){' .
    549                       'wp.i18n.setLocaleData( translations.locale_data, "' . $domain . '" );' .
     549                      'translations.locale_data.messages[""].domain = "' . $domain . '";' .
     550                      'wp.i18n.setLocaleData( translations.locale_data.messages, "' . $domain . '" );' .
    550551                  '})(' . $json_translations . ');';
    551552
Note: See TracChangeset for help on using the changeset viewer.