Make WordPress Core


Ignore:
Timestamp:
11/10/2022 07:19:11 PM (20 months 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-admin/includes/admin.php

    r47198 r54795  
    1414     * load_default_textdomain() will not have done so in this context.
    1515     */
    16     load_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' );
     16    $admin_locale = get_locale();
     17    load_textdomain( 'default', WP_LANG_DIR . '/admin-' . $admin_locale . '.mo', $admin_locale );
     18    unset( $admin_locale );
    1719}
    1820
Note: See TracChangeset for help on using the changeset viewer.