Changeset 11332
- Timestamp:
- 05/14/2009 06:58:37 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r11329 r11332 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'); 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 } 3110 3120 3111 3121 $all = timezone_identifiers_list(); … … 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 … … 3152 3168 3153 3169 if ( !empty($city) ) { 3154 if ( !empty($subcity) ) {3155 $city = $city . '/'. $subcity;3156 }3157 3170 $display = str_replace('_',' ',$city); 3158 3171 $display = translate($display); 3172 if ( !empty($subcity) ) { 3173 $display_subcity = str_replace('_', ' ', $subcity); 3174 $display_subcity = translate($display_subcity); 3175 $city = $city . '/'. $subcity; 3176 $display = $display . '/' . $display_subcity; 3177 } 3159 3178 if ( $continent == 'Etc' ) 3160 3179 $display = strtr($display, '+-', '-+');
Note: See TracChangeset
for help on using the changeset viewer.