WordPress.org

Make WordPress Core

Changeset 19797


Ignore:
Timestamp:
01/31/12 14:30:36 (2 years ago)
Author:
nacin
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/locale.php

    r19761 r19797  
    188188        $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; 
    189189 
    190         // Locale-specific tweaks 
    191         if ( self::is_locale_rtl( get_locale() ) ) 
    192             $this->text_direction = 'rtl'; 
    193  
    194         // Import the $text_direction global. 
     190        // Set text direction. 
    195191        if ( isset( $GLOBALS['text_direction'] ) ) 
    196192            $this->text_direction = $GLOBALS['text_direction']; 
     193        elseif ( is_textdomain_loaded( 'default' ) && self::is_locale_rtl( get_locale() ) ) 
     194            $this->text_direction = 'rtl'; 
    197195    } 
    198196 
  • trunk/wp-settings.php

    r19760 r19797  
    261261load_default_textdomain(); 
    262262 
    263 // Find the blog locale. 
    264263$locale = get_locale(); 
    265264$locale_file = WP_LANG_DIR . "/$locale.php"; 
    266 if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) 
     265if ( ( 0 === validate_file( $locale_file ) ) && is_readable( $locale_file ) ) 
    267266    require( $locale_file ); 
    268 unset($locale_file); 
     267unset( $locale_file ); 
    269268 
    270269// Pull in locale data after loading text domain. 
Note: See TracChangeset for help on using the changeset viewer.