Translate continent and city names for timezone picker. see #9794

git-svn-id: https://develop.svn.wordpress.org/trunk@11290 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-05-12 01:04:16 +00:00
parent 3a61686b36
commit 2e71b19772
2 changed files with 497 additions and 3 deletions
+4 -3
View File
@@ -3133,13 +3133,13 @@ function wp_timezone_choice($selectedzone) {
extract($zone);
if ( empty($selectcontinent) && !empty($city) ) {
$selectcontinent = $continent;
$structure .= '<optgroup label="'.$continent.'">' . "\n"; // continent
$structure .= '<optgroup label="'. esc_attr( translate( $continent ) ) .'">' . "\n"; // continent
} elseif ( !empty($selectcontinent) && $selectcontinent != $continent ) {
$structure .= "</optgroup>\n";
$selectcontinent = '';
if ( !empty($city) ) {
$selectcontinent = $continent;
$structure .= '<optgroup label="'.$continent.'">' . "\n"; // continent
$structure .= '<optgroup label="'. esc_attr( translate( $continent ) ) .'">' . "\n"; // continent
}
}
@@ -3148,11 +3148,12 @@ function wp_timezone_choice($selectedzone) {
$city = $city . '/'. $subcity;
}
$display = str_replace('_',' ',$city);
$display = translate($display);
if ( $continent == 'Etc' )
$display = strtr($display, '+-', '-+');
$structure .= "\t<option ".((($continent.'/'.$city)==$selectedzone)?'selected="selected"':'')." value=\"".($continent.'/'.$city)."\">$pad".$display."</option>\n"; //Timezone
} else {
$structure .= "<option ".(($continent==$selectedzone)?'selected="selected"':'')." value=\"".$continent."\">".$continent."</option>\n"; //Timezone
$structure .= "<option ".(($continent==$selectedzone)?'selected="selected"':'')." value=\"".$continent."\">" . translate($continent) . "</option>\n"; //Timezone
}
}