mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
I18N: Initialize textdomain registry in wp_load_translations_early().
Initialize `WP_Textdomain_Registry` in `wp_load_translations_early()`. This ensures the global `$wp_textdomain_registry` is set up prior to loading the translations. Props azurseisme, TimothyBlynJacobs, costdev, ocean90, flixos90, swissspidy. Fixes #57051. git-svn-id: https://develop.svn.wordpress.org/trunk@54803 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
51032426b5
commit
e4832fb198
@ -1321,10 +1321,11 @@ function get_current_network_id() {
|
||||
* @since 3.4.0
|
||||
* @access private
|
||||
*
|
||||
* @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry.
|
||||
* @global WP_Locale $wp_locale WordPress date and time locale object.
|
||||
*/
|
||||
function wp_load_translations_early() {
|
||||
global $wp_locale;
|
||||
global $wp_locale, $wp_textdomain_registry;
|
||||
|
||||
static $loaded = false;
|
||||
if ( $loaded ) {
|
||||
@ -1342,6 +1343,7 @@ function wp_load_translations_early() {
|
||||
// Translation and localization.
|
||||
require_once ABSPATH . WPINC . '/pomo/mo.php';
|
||||
require_once ABSPATH . WPINC . '/l10n.php';
|
||||
require_once ABSPATH . WPINC . '/class-wp-textdomain-registry.php';
|
||||
require_once ABSPATH . WPINC . '/class-wp-locale.php';
|
||||
require_once ABSPATH . WPINC . '/class-wp-locale-switcher.php';
|
||||
|
||||
@ -1351,6 +1353,10 @@ function wp_load_translations_early() {
|
||||
$locales = array();
|
||||
$locations = array();
|
||||
|
||||
if ( ! $wp_textdomain_registry instanceof WP_Textdomain_Registry ) {
|
||||
$wp_textdomain_registry = new WP_Textdomain_Registry();
|
||||
}
|
||||
|
||||
while ( true ) {
|
||||
if ( defined( 'WPLANG' ) ) {
|
||||
if ( '' === WPLANG ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user