Ticket #19924: 19924.2.diff

File 19924.2.diff, 1.9 KB (added by nacin, 16 months ago)
Line 
1Index: wp-includes/locale.php
2===================================================================
3--- wp-includes/locale.php      (revision 19832)
4+++ wp-includes/locale.php      (working copy)
5@@ -85,16 +85,6 @@
6        var $text_direction = 'ltr';
7 
8        /**
9-        * Locales which are known to be right-to-left.
10-        *
11-        * @since 3.4.0
12-        * @var array
13-        * @access private
14-        * @static
15-        */
16-       private static $rtl_locales = array( 'ar', 'ckb', 'fa_IR', 'he_IL', 'ug_CN', 'dv', 'fa_AF', 'ha', 'ps', 'uz_UZ', 'yi' );
17-
18-       /**
19         * Sets up the translated strings and object properties.
20         *
21         * The method creates the translatable strings for various
22@@ -190,7 +180,7 @@
23                // Set text direction.
24                if ( isset( $GLOBALS['text_direction'] ) )
25                        $this->text_direction = $GLOBALS['text_direction'];
26-               elseif ( is_textdomain_loaded( 'default' ) && self::is_locale_rtl( get_locale() ) )
27+               elseif ( 'rtl' == _x( 'ltr', 'text direction' ) )
28                        $this->text_direction = 'rtl';
29        }
30 
31@@ -336,19 +326,6 @@
32        function is_rtl() {
33                return 'rtl' == $this->text_direction;
34        }
35-
36-       /**
37-        * Determines whether a locale is known to be right-to-left.
38-        *
39-        * @since 3.4.0
40-        * @static
41-        *
42-        * @param string Locale in WP format.
43-        * @return bool Whether locale is RTL.
44-        */
45-       public static function is_locale_rtl( $locale ) {
46-               return in_array( $locale, self::$rtl_locales );
47-       }
48 }
49 
50 /**
51Index: wp-includes/load.php
52===================================================================
53--- wp-includes/load.php        (revision 19832)
54+++ wp-includes/load.php        (working copy)
55@@ -726,8 +726,6 @@
56                                        load_textdomain( 'default', $location . '/' . $locale . '.mo' );
57                                        if ( defined( 'WP_SETUP_CONFIG' ) && file_exists( $location . '/admin-' . $locale . '.mo' ) )
58                                                load_textdomain( 'default', $location . '/admin-' . $locale . '.mo' );
59-                                       if ( WP_Locale::is_locale_rtl( $locale ) )
60-                                               $text_direction = 'rtl';
61                                        break 2;
62                                }
63                        }