Making WordPress.org

Ticket #1850: meta-1850.patch

File meta-1850.patch, 1.2 KB (added by SergeyBiryukov, 8 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-locale-banner.php

     
    6868                $current_locale = get_locale();
    6969
    7070                // Build a list of WordPress locales which we'll suggest to the user.
    71                 $suggest_locales = array_values( array_intersect( $translated_locales, $locales_from_header ) );
     71                $suggest_locales = array_values( array_intersect( $locales_from_header, $translated_locales ) );
    7272                $current_locale_is_suggested = in_array( $current_locale, $suggest_locales );
    7373                $current_locale_is_translated = in_array( $current_locale, $translated_locales );
    7474
     
    262262                }
    263263
    264264                foreach ( $available_locales as $locale ) {
    265                         list( $lang, ) = preg_split( '/[_-]/', $locale );
    266                         if ( $lang ) {
     265                        list( $locale_lang, ) = preg_split( '/[_-]/', $locale );
     266                        if ( $lang === $locale_lang ) {
    267267                                return $locale;
    268268                        }
    269269                }