Changeset 39068
- Timestamp:
- 11/01/2016 09:15:42 AM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/options-general.php
r38720 r39068 148 148 149 149 <select id="timezone_string" name="timezone_string" aria-describedby="timezone-description"> 150 <?php echo wp_timezone_choice($tzstring); ?>150 <?php echo wp_timezone_choice( $tzstring, get_user_locale() ); ?> 151 151 </select> 152 152 -
trunk/src/wp-includes/functions.php
r38991 r39068 4502 4502 * 4503 4503 * @since 2.9.0 4504 * @since 4.7.0 Added the `$locale` parameter. 4504 4505 * 4505 4506 * @staticvar bool $mo_loaded 4507 * @staticvar string $locale_loaded 4506 4508 * 4507 4509 * @param string $selected_zone Selected timezone. 4510 * @param string $locale Optional. Locale to load the timezones in. Default current site locale. 4508 4511 * @return string 4509 4512 */ 4510 function wp_timezone_choice( $selected_zone ) {4511 static $mo_loaded = false ;4513 function wp_timezone_choice( $selected_zone, $locale = null ) { 4514 static $mo_loaded = false, $locale_loaded = null; 4512 4515 4513 4516 $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific'); 4514 4517 4515 // Load translations for continents and cities 4516 if ( !$mo_loaded ) { 4517 $locale = get_locale(); 4518 $mofile = WP_LANG_DIR . '/continents-cities-' . $locale . '.mo'; 4518 // Load translations for continents and cities. 4519 if ( ! $mo_loaded || $locale !== $locale_loaded ) { 4520 $locale_loaded = $locale ? $locale : get_locale(); 4521 $mofile = WP_LANG_DIR . '/continents-cities-' . $locale_loaded . '.mo'; 4522 unload_textdomain( 'continents-cities' ); 4519 4523 load_textdomain( 'continents-cities', $mofile ); 4520 4524 $mo_loaded = true;
Note: See TracChangeset
for help on using the changeset viewer.