Make WordPress Core

Ticket #46694: 46694.diff

File 46694.diff, 1.7 KB (added by desrosj, 6 years ago)
  • src/wp-admin/includes/class-wp-debug-data.php

     
    3434                global $wpdb;
    3535                if ( ! empty( $locale ) ) {
    3636                        // Change the language used for translations
    37                         if ( function_exists( 'switch_to_locale' ) ) {
    38                                 $original_locale = get_locale();
    39                                 $switched_locale = switch_to_locale( $locale );
    40                         }
     37                        $original_locale = get_user_locale();
     38                        $switched_locale = switch_to_locale( $locale );
    4139                }
    4240
    4341                $upload_dir = wp_get_upload_dir();
     
    7371                                        ),
    7472                                        'language'               => array(
    7573                                                'label' => __( 'Language' ),
    76                                                 'value' => ( ! empty( $locale ) ? $original_locale : get_locale() ),
     74                                                'value' => ( ! empty( $locale ) ? $original_locale : get_user_locale() ),
    7775                                        ),
    7876                                        'home_url'               => array(
    7977                                                'label'   => __( 'Home URL' ),
     
    888886
    889887                if ( ! empty( $locale ) ) {
    890888                        // Change the language used for translations
    891                         if ( function_exists( 'restore_previous_locale' ) && $switched_locale ) {
     889                        if ( $switched_locale ) {
    892890                                restore_previous_locale();
    893891                        }
    894892                }
  • src/wp-admin/site-health-info.php

     
    6868
    6969        $info         = WP_Debug_Data::debug_data();
    7070        $english_info = '';
    71         if ( 0 !== strpos( get_locale(), 'en' ) ) {
     71        if ( 0 !== strpos( get_user_locale(), 'en' ) ) {
    7272                $english_info = WP_Debug_Data::debug_data( 'en_US' );
    7373        }
    7474        ?>