Make WordPress Core

Ticket #19601: 19601.diff

File 19601.diff, 1.3 KB (added by nacin, 12 years ago)

Localizes gmt_offset and timezone_string

  • wp-admin/includes/schema.php

     
    352352                }
    353353        }
    354354
     355        $timezone_string = '';
     356        $gmt_offset = 0;
     357        /* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
     358           or a valid timezone string (America/New_York). See http://us3.php.net/manual/en/timezones.php
     359           for all timezone strings supported by PHP.
     360        */
     361        $offset_or_tz = __( '0', 'default GMT offset or timezone string' );
     362        if ( is_numeric( $offset_or_tz ) ) {
     363                $gmt_offset = $offset_or_tz;
     364        } else {
     365                $allowed_zones = timezone_identifiers_list();
     366                if ( in_array( $offset_or_tz, $allowed_zones ) )
     367                        $timezone_string = $offset_or_tz;
     368        }
     369
    355370        $options = array(
    356371        'siteurl' => $guessurl,
    357372        'blogname' => __('My Site'),
     
    399414        'ping_sites' => 'http://rpc.pingomatic.com/',
    400415        'advanced_edit' => 0,
    401416        'comment_max_links' => 2,
    402         'gmt_offset' => date('Z') / 3600,
     417        'gmt_offset' => $gmt_offset,
    403418
    404419        // 1.5
    405420        'default_email_category' => 1,
     
    466481        'widget_rss' => array(),
    467482
    468483        // 2.8
    469         'timezone_string' => '',
     484        'timezone_string' => $timezone_string,
    470485
    471486        // 2.9
    472487        'embed_autourls' => 1,