From ecedc9152fa637625ca69b1495bf0f9f99d7619c Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 31 Jan 2012 14:30:36 +0000 Subject: [PATCH] Only set text_direction based on a locale being RTL if we successfully loaded a locale.mo file. Otherwise we may be in RTL land based on a WPLANG constant but nothing else. fixes #19924. git-svn-id: http://svn.automattic.com/wordpress/trunk@19797 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/locale.php | 8 +++----- wp-settings.php | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/wp-includes/locale.php b/wp-includes/locale.php index aea9b4c3b..925e241f9 100644 --- a/wp-includes/locale.php +++ b/wp-includes/locale.php @@ -187,13 +187,11 @@ class WP_Locale { $trans = __('number_format_decimal_point'); $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; - // Locale-specific tweaks - if ( self::is_locale_rtl( get_locale() ) ) - $this->text_direction = 'rtl'; - - // Import the $text_direction global. + // Set text direction. if ( isset( $GLOBALS['text_direction'] ) ) $this->text_direction = $GLOBALS['text_direction']; + elseif ( is_textdomain_loaded( 'default' ) && self::is_locale_rtl( get_locale() ) ) + $this->text_direction = 'rtl'; } /** diff --git a/wp-settings.php b/wp-settings.php index 39f98b260..304003042 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -260,12 +260,11 @@ wp_templating_constants( ); // Load the default text localization domain. load_default_textdomain(); -// Find the blog locale. $locale = get_locale(); $locale_file = WP_LANG_DIR . "/$locale.php"; -if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) +if ( ( 0 === validate_file( $locale_file ) ) && is_readable( $locale_file ) ) require( $locale_file ); -unset($locale_file); +unset( $locale_file ); // Pull in locale data after loading text domain. require_once( ABSPATH . WPINC . '/locale.php' );