Make WordPress Core


Ignore:
Timestamp:
11/10/2022 07:19:11 PM (2 years ago)
Author:
ocean90
Message:

I18N : Always pass $locale to load_textdomain().

In [53874] the optional $locale parameter was added to load_textdomain(). While most load_textdomain() calls in core were were updated, some were missed. Passing the original locale avoids the need to call determine_locale() by load_textdomain() which is used as a fallback.

Props ocean90, swissspidy, desrosj.
Fixes #57060.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.1/src/wp-includes/load.php

    r54637 r54795  
    13931393            foreach ( $locations as $location ) {
    13941394                if ( file_exists( $location . '/' . $locale . '.mo' ) ) {
    1395                     load_textdomain( 'default', $location . '/' . $locale . '.mo' );
     1395                    load_textdomain( 'default', $location . '/' . $locale . '.mo', $locale );
    13961396                    if ( defined( 'WP_SETUP_CONFIG' ) && file_exists( $location . '/admin-' . $locale . '.mo' ) ) {
    1397                         load_textdomain( 'default', $location . '/admin-' . $locale . '.mo' );
     1397                        load_textdomain( 'default', $location . '/admin-' . $locale . '.mo', $locale );
    13981398                    }
    13991399                    break 2;
Note: See TracChangeset for help on using the changeset viewer.