WordPress.org

Make WordPress Core

Ticket #10373: 10373.diff

File 10373.diff, 1.3 KB (added by SergeyBiryukov, 4 years ago)
  • src/wp-includes/locale.php

     
    165165                // See http://php.net/number_format
    166166
    167167                /* translators: $thousands_sep argument for http://php.net/number_format, default is , */
    168                 $trans = __('number_format_thousands_sep');
    169                 $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans;
     168                $thousands_sep = __( 'number_format_thousands_sep' );
     169                // Replace space with a non-breaking space to avoid wrapping
     170                $thousands_sep = str_replace( ' ', "\xA0", $thousands_sep );
    170171
     172                $this->number_format['thousands_sep'] = ( 'number_format_thousands_sep' === $thousands_sep ) ? ',' : $thousands_sep;
     173
    171174                /* translators: $dec_point argument for http://php.net/number_format, default is . */
    172                 $trans = __('number_format_decimal_point');
    173                 $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans;
     175                $decimal_point = __( 'number_format_decimal_point' );
    174176
     177                $this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point;
     178
    175179                // Set text direction.
    176180                if ( isset( $GLOBALS['text_direction'] ) )
    177181                        $this->text_direction = $GLOBALS['text_direction'];