Permalink
Browse files

Only set text_direction based on a locale being RTL if we successfull…

…y 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
  • Loading branch information...
1 parent 2aec12b commit ecedc9152fa637625ca69b1495bf0f9f99d7619c nacin committed Jan 31, 2012
Showing with 5 additions and 8 deletions.
  1. +3 −5 wp-includes/locale.php
  2. +2 −3 wp-settings.php
@@ -187,13 +187,11 @@ function init() {
$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';
}
/**
View
@@ -260,12 +260,11 @@
// 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' );

0 comments on commit ecedc91

Please sign in to comment.