Make WordPress Core


Ignore:
Timestamp:
11/10/2022 07:38:20 PM (4 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.
See #57060.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php

    r54043 r54797  
    337337                if ( ! is_admin() ) {
    338338                        $locale = determine_locale();
    339                         load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" );
     339                        load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo", $locale );
    340340                }
    341341        }
Note: See TracChangeset for help on using the changeset viewer.