Ticket #9794: 9794.3.diff
File 9794.3.diff, 2.3 KB (added by , 15 years ago) |
---|
-
wp-includes/functions.php
3106 3106 * 3107 3107 */ 3108 3108 function wp_timezone_choice($selectedzone) { 3109 static $mo_loaded = false; 3110 3109 3111 $continents = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific', 'Etc'); 3110 3112 3113 // Load translations for continents and cities 3114 if ( ! $mo_loaded ) { 3115 $locale = get_locale(); 3116 $mofile = WP_LANG_DIR . "/continents-cities-$locale.mo"; 3117 load_textdomain('default', $mofile); 3118 $mo_loaded = true; 3119 } 3120 3111 3121 $all = timezone_identifiers_list(); 3112 3122 3113 3123 $i = 0; … … 3123 3133 3124 3134 usort($zonen, create_function( 3125 3135 '$a, $b', ' 3126 if ( $a["continent"] == $b["continent"] && $a["city"] == $b["city"] ) 3127 return strnatcasecmp($a["subcity"], $b["subcity"]); 3128 elseif ( $a["continent"] == $b["continent"] ) 3129 return strnatcasecmp($a["city"], $b["city"]); 3136 $a_continent = translate($a["continent"]); 3137 $b_continent = translate($b["continent"]); 3138 $a_city = translate($a["city"]); 3139 $b_city = translate($b["city"]); 3140 $a_subcity = translate($a["subcity"]); 3141 $b_subcity = translate($b["subcity"]); 3142 if ( $a_continent == $b_continent && $a_city == $b_city ) 3143 return strnatcasecmp($a_subcity, $b_subcity); 3144 elseif ( $a_continent == $b_continent ) 3145 return strnatcasecmp($a_city, $b_city); 3130 3146 else 3131 return strnatcasecmp($a ["continent"], $b["continent"]);3147 return strnatcasecmp($a_continent, $b_continent); 3132 3148 ')); 3133 3149 3134 3150 $structure = ''; … … 3151 3167 } 3152 3168 3153 3169 if ( !empty($city) ) { 3170 $display = str_replace('_',' ',$city); 3171 $display = translate($display); 3154 3172 if ( !empty($subcity) ) { 3173 $display_sub_city = str_replace('_', ' ', $subcity); 3174 $display_sub_city = translate($display_sub_city); 3155 3175 $city = $city . '/'. $subcity; 3176 $display = $display . '/' . $display_subcity; 3156 3177 } 3157 $display = str_replace('_',' ',$city);3158 $display = translate($display);3159 3178 if ( $continent == 'Etc' ) 3160 3179 $display = strtr($display, '+-', '-+'); 3161 3180 $structure .= "\t<option ".((($continent.'/'.$city)==$selectedzone)?'selected="selected"':'')." value=\"".($continent.'/'.$city)."\">$pad".$display."</option>\n"; //Timezone