Ticket #19924: 19924.2.diff
| File 19924.2.diff, 1.9 KB (added by , 14 years ago) |
|---|
-
wp-includes/locale.php
85 85 var $text_direction = 'ltr'; 86 86 87 87 /** 88 * Locales which are known to be right-to-left.89 *90 * @since 3.4.091 * @var array92 * @access private93 * @static94 */95 private static $rtl_locales = array( 'ar', 'ckb', 'fa_IR', 'he_IL', 'ug_CN', 'dv', 'fa_AF', 'ha', 'ps', 'uz_UZ', 'yi' );96 97 /**98 88 * Sets up the translated strings and object properties. 99 89 * 100 90 * The method creates the translatable strings for various … … 190 180 // Set text direction. 191 181 if ( isset( $GLOBALS['text_direction'] ) ) 192 182 $this->text_direction = $GLOBALS['text_direction']; 193 elseif ( is_textdomain_loaded( 'default' ) && self::is_locale_rtl( get_locale()) )183 elseif ( 'rtl' == _x( 'ltr', 'text direction' ) ) 194 184 $this->text_direction = 'rtl'; 195 185 } 196 186 … … 336 326 function is_rtl() { 337 327 return 'rtl' == $this->text_direction; 338 328 } 339 340 /**341 * Determines whether a locale is known to be right-to-left.342 *343 * @since 3.4.0344 * @static345 *346 * @param string Locale in WP format.347 * @return bool Whether locale is RTL.348 */349 public static function is_locale_rtl( $locale ) {350 return in_array( $locale, self::$rtl_locales );351 }352 329 } 353 330 354 331 /** -
wp-includes/load.php
726 726 load_textdomain( 'default', $location . '/' . $locale . '.mo' ); 727 727 if ( defined( 'WP_SETUP_CONFIG' ) && file_exists( $location . '/admin-' . $locale . '.mo' ) ) 728 728 load_textdomain( 'default', $location . '/admin-' . $locale . '.mo' ); 729 if ( WP_Locale::is_locale_rtl( $locale ) )730 $text_direction = 'rtl';731 729 break 2; 732 730 } 733 731 }