Make WordPress Core

Ticket #34565: 34565.2.patch

File 34565.2.patch, 975 bytes (added by bobbingwide, 9 years ago)

Pre-translate before sorting names when locale not english

  • src/wp-includes/class-wp-theme.php

     
    12751275                if ( 0 === strpos( get_locale(), 'en_' ) ) {
    12761276                        uasort( $themes, array( 'WP_Theme', '_name_sort' ) );
    12771277                } else {
     1278                        foreach ( $themes as $key => $theme ) {
     1279                                $theme->display( "Name", false, true );
     1280                        }
    12781281                        uasort( $themes, array( 'WP_Theme', '_name_sort_i18n' ) );
    12791282                }
    12801283        }
     
    12971300        }
    12981301
    12991302        /**
    1300          * Name sort (with translation).
     1303         * Sort of pre-translated names.
    13011304         *
    13021305         * @since 3.4.0
    13031306         *
     
    13071310         * @return int
    13081311         */
    13091312        private static function _name_sort_i18n( $a, $b ) {
    1310                 // Don't mark up; Do translate.
    1311                 return strnatcasecmp( $a->display( 'Name', false, true ), $b->display( 'Name', false, true ) );
     1313                return strnatcasecmp( $a->name_translated, $b->name_translated );
    13121314        }
    13131315}