]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/locale.php
WordPress 4.5
[autoinstalls/wordpress.git] / wp-includes / locale.php
index 040fa5563a7c20d48d605cbd5ff27dc904e7f9fd..cfca86e8a16fc9260e33f573dacb2fac03cf6e9a 100644 (file)
@@ -187,12 +187,22 @@ class WP_Locale {
                // See http://php.net/number_format
 
                /* translators: $thousands_sep argument for http://php.net/number_format, default is , */
                // See http://php.net/number_format
 
                /* translators: $thousands_sep argument for http://php.net/number_format, default is , */
-               $trans = __('number_format_thousands_sep');
-               $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans;
+               $thousands_sep = __( 'number_format_thousands_sep' );
+
+               if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) {
+                       // Replace space with a non-breaking space to avoid wrapping.
+                       $thousands_sep = str_replace( ' ', ' ', $thousands_sep );
+               } else {
+                       // PHP < 5.4.0 does not support multiple bytes in thousands separator.
+                       $thousands_sep = str_replace( array( '&nbsp;', '&#160;' ), ' ', $thousands_sep );
+               }
+
+               $this->number_format['thousands_sep'] = ( 'number_format_thousands_sep' === $thousands_sep ) ? ',' : $thousands_sep;
 
                /* translators: $dec_point argument for http://php.net/number_format, default is . */
 
                /* translators: $dec_point argument for http://php.net/number_format, default is . */
-               $trans = __('number_format_decimal_point');
-               $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans;
+               $decimal_point = __( 'number_format_decimal_point' );
+
+               $this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point;
 
                // Set text direction.
                if ( isset( $GLOBALS['text_direction'] ) )
 
                // Set text direction.
                if ( isset( $GLOBALS['text_direction'] ) )
@@ -208,7 +218,10 @@ class WP_Locale {
        }
 
        /**
        }
 
        /**
+        * Outputs an admin notice if the /build directory must be used for RTL.
+        *
         * @since 3.8.0
         * @since 3.8.0
+        * @access public
         */
        public function rtl_src_admin_notice() {
                /* translators: %s: Name of the directory (build) */
         */
        public function rtl_src_admin_notice() {
                /* translators: %s: Name of the directory (build) */