Make WordPress Core

Ticket #3677: 3677.diff

File 3677.diff, 2.3 KB (added by Sewar, 18 years ago)

Moving the variables to $locale.php

  • wp-includes/functions.php

     
    8686function number_format_i18n($number, $decimals = null) {
    8787        global $wp_locale;
    8888        // let the user override the precision only
    89         $decimals = is_null($decimals)? $wp_locale->number_format['decimals'] : intval($decimals);
     89        $decimals = is_null($decimals)? $wp_locale->number_format_decimals : intval($decimals);
    9090
    91         return number_format($number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep']);
     91        return number_format($number, $decimals, $wp_locale->number_format_decimal_point, $wp_locale->number_format_thousands_sep);
    9292}
    9393
    9494function get_weekstartend($mysqlstring, $start_of_week) {
  • wp-includes/locale.php

     
    1212
    1313        var $meridiem;
    1414
     15        // Locale vars, can be changed in $locale.php.
    1516        var $text_direction = 'ltr';
    16         var $locale_vars = array('text_direction');
     17        // Numbers formatting. See http://www.php.net/number_format
     18        var $number_format_decimals = 0;
     19        var $number_format_decimal_point = '.';
     20        var $number_format_thousands_sep = ',';
     21        var $locale_vars = array('text_direction', 'number_format_decimals', 'number_format_decimal_point',
     22                'number_format_thousands_sep');
    1723
    1824        function init() {
    1925                // The Weekdays
     
    8793                $this->meridiem['AM'] = __('AM');
    8894                $this->meridiem['PM'] = __('PM');
    8995
    90                 // Numbers formatting
    91                 // See http://php.net/number_format
    92 
    93                 $trans = __('number_format_decimals');
    94                 $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans;
    95                
    96                 $trans = __('number_format_decimal_point');
    97                 $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans;
    98 
    99                 $trans = __('number_format_thousands_sep');     
    100                 $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans;
    101                
    10296                // Import global locale vars set during inclusion of $locale.php.
    10397                foreach ( $this->locale_vars as $var ) {
    10498                        if ( isset($GLOBALS[$var]) )
    10599                                $this->$var = $GLOBALS[$var];
    106100                }
    107 
    108101        }
    109102
    110103        function get_weekday($weekday_number) {