Extend wfParseUrl() to handle protocol-relative URLs. parse_url() doesn't handle...
[lhc/web/wiklou.git] / languages / Language.php
index 06b39bd..55a2ee7 100644 (file)
@@ -504,7 +504,8 @@ class Language {
                        $this->getMessage( 'qbsettings-fixedleft' ),
                        $this->getMessage( 'qbsettings-fixedright' ),
                        $this->getMessage( 'qbsettings-floatingleft' ),
-                       $this->getMessage( 'qbsettings-floatingright' )
+                       $this->getMessage( 'qbsettings-floatingright' ),
+                       $this->getMessage( 'qbsettings-directionality' )
                );
        }
 
@@ -550,13 +551,6 @@ class Language {
                return self::$dataCache->getSubitem( $this->mCode, 'imageFiles', $image );
        }
 
-       /**
-        * @return array
-        */
-       function getDefaultUserOptionOverrides() {
-               return self::$dataCache->getItem( $this->mCode, 'defaultUserOptionOverrides' );
-       }
-
        /**
         * @return array
         */
@@ -2357,10 +2351,14 @@ class Language {
        /**
         * A hidden direction mark (LRM or RLM), depending on the language direction
         *
+        * @param $opposite Boolean Get the direction mark opposite to your language
         * @return string
         */
-       function getDirMark() {
-               return $this->isRTL() ? "\xE2\x80\x8F" : "\xE2\x80\x8E";
+       function getDirMark( $opposite = false ) {
+               $rtl = "\xE2\x80\x8F";
+               $ltr = "\xE2\x80\x8E";
+               if( $opposite ) { return $this->isRTL() ? $ltr : $rtl; }
+               return $this->isRTL() ? $rtl : $ltr;
        }
 
        /**
@@ -2994,9 +2992,8 @@ class Language {
        }
 
        /**
-        * Maybe translate block durations.  Note that this function is somewhat misnamed: it
-        * deals with translating the *duration* ("1 week", "4 days", etc), not the expiry time
-        * (which is an absolute timestamp).
+        * This translates the duration ("1 week", "4 days", etc)
+        * as well as the expiry time (which is an absolute timestamp).
         * @param $str String: the validated block duration in English
         * @return Somehow translated block duration
         * @see LanguageFi.php for example implementation
@@ -3020,8 +3017,8 @@ class Language {
                                }
                        }
                }
-               // If all else fails, return the original string.
-               return $str;
+               // If no duration is given, but a timestamp, display that
+               return ( strtotime( $str ) ? $this->timeanddate( strtotime( $str ) ) : $str );
        }
 
        /**