WordPress.org

Make WordPress Core

Ticket #10066: timezone-translate-sort.diff

File timezone-translate-sort.diff, 1.1 KB (added by nbachiyski, 5 years ago)

Replace _ before translating names in the sort routine

  • wp-includes/functions.php

     
    32173217 
    32183218        usort($zonen, create_function( 
    32193219                '$a, $b', ' 
    3220                 $a_continent = translate($a["continent"], "continents-cities"); 
    3221                 $b_continent = translate($b["continent"], "continents-cities"); 
    3222                 $a_city = translate($a["city"], "continents-cities"); 
    3223                 $b_city = translate($b["city"], "continents-cities"); 
    3224                 $a_subcity = translate($a["subcity"], "continents-cities"); 
    3225                 $b_subcity = translate($b["subcity"], "continents-cities"); 
     3220                $t = create_function(\'$s\', \'return translate(str_replace("_", " ", $s), "continents-cities");\'); 
     3221                $a_continent = $t($a["continent"]); 
     3222                $b_continent = $t($b["continent"]); 
     3223                $a_city = $t($a["city"]); 
     3224                $b_city = $t($b["city"]); 
     3225                $a_subcity = $t($a["subcity"]); 
     3226                $b_subcity = $t($b["subcity"]); 
    32263227                if ( $a_continent == $b_continent && $a_city == $b_city ) 
    32273228                        return strnatcasecmp($a_subcity, $b_subcity); 
    32283229                elseif ( $a_continent == $b_continent )