I18N: In `wp_maybe_decline_date()`, bail early if translation functions are not available, e.g. in `SHORTINIT` mode.

Fixes #34967 for trunk.
Built from https://develop.svn.wordpress.org/trunk@35878


git-svn-id: http://core.svn.wordpress.org/trunk@35842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-12-12 01:35:35 +00:00
parent 1ae97a2078
commit 746c697099
2 changed files with 16 additions and 5 deletions

View File

@ -187,12 +187,23 @@ class WP_Locale {
// 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.
$non_breaking_space = html_entity_decode( ' ', ENT_QUOTES, get_option( 'blog_charset' ) );
$thousands_sep = str_replace( ' ', $non_breaking_space, $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 . */
$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'] ) )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-35877';
$wp_version = '4.5-alpha-35878';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.