Merge "Remove skin mode of Special:JavaScriptTest"
[lhc/web/wiklou.git] / languages / Language.php
index 0bd2276..f13f9d6 100644 (file)
@@ -443,7 +443,7 @@ class Language {
         * @return array
         * @since 1.19
         */
-       function getFallbackLanguages() {
+       public function getFallbackLanguages() {
                return self::getFallbacksFor( $this->mCode );
        }
 
@@ -451,7 +451,7 @@ class Language {
         * Exports $wgBookstoreListEn
         * @return array
         */
-       function getBookstoreList() {
+       public function getBookstoreList() {
                return self::$dataCache->getItem( $this->mCode, 'bookstoreList' );
        }
 
@@ -520,7 +520,7 @@ class Language {
         *
         * @return array
         */
-       function getFormattedNamespaces() {
+       public function getFormattedNamespaces() {
                $ns = $this->getNamespaces();
                foreach ( $ns as $k => $v ) {
                        $ns[$k] = strtr( $v, '_', ' ' );
@@ -539,7 +539,7 @@ class Language {
         * @param int $index The array key of the namespace to return
         * @return string|bool String if the namespace value exists, otherwise false
         */
-       function getNsText( $index ) {
+       public function getNsText( $index ) {
                $ns = $this->getNamespaces();
                return isset( $ns[$index] ) ? $ns[$index] : false;
        }
@@ -557,7 +557,7 @@ class Language {
         * @param int $index The array key of the namespace to return
         * @return string Namespace name without underscores (empty string if namespace does not exist)
         */
-       function getFormattedNsText( $index ) {
+       public function getFormattedNsText( $index ) {
                $ns = $this->getNsText( $index );
                return strtr( $ns, '_', ' ' );
        }
@@ -570,7 +570,7 @@ class Language {
         * @return string
         * @since 1.18
         */
-       function getGenderNsText( $index, $gender ) {
+       public function getGenderNsText( $index, $gender ) {
                global $wgExtraGenderNamespaces;
 
                $ns = $wgExtraGenderNamespaces +
@@ -585,7 +585,7 @@ class Language {
         * @return bool
         * @since 1.18
         */
-       function needsGenderDistinction() {
+       public function needsGenderDistinction() {
                global $wgExtraGenderNamespaces, $wgExtraNamespaces;
                if ( count( $wgExtraGenderNamespaces ) > 0 ) {
                        // $wgExtraGenderNamespaces overrides everything
@@ -618,7 +618,7 @@ class Language {
        /**
         * @return array
         */
-       function getNamespaceAliases() {
+       public function getNamespaceAliases() {
                if ( is_null( $this->namespaceAliases ) ) {
                        $aliases = self::$dataCache->getItem( $this->mCode, 'namespaceAliases' );
                        if ( !$aliases ) {
@@ -662,7 +662,7 @@ class Language {
        /**
         * @return array
         */
-       function getNamespaceIds() {
+       public function getNamespaceIds() {
                if ( is_null( $this->mNamespaceIds ) ) {
                        global $wgNamespaceAliases;
                        # Put namespace names and aliases into a hashtable.
@@ -692,7 +692,7 @@ class Language {
         * @param string $text
         * @return int|bool An integer if $text is a valid value otherwise false
         */
-       function getNsIndex( $text ) {
+       public function getNsIndex( $text ) {
                $lctext = $this->lc( $text );
                $ns = MWNamespace::getCanonicalIndex( $lctext );
                if ( $ns !== null ) {
@@ -709,7 +709,7 @@ class Language {
         * @param bool $usemsg Use the "variantname-xyz" message if it exists
         * @return string
         */
-       function getVariantname( $code, $usemsg = true ) {
+       public function getVariantname( $code, $usemsg = true ) {
                $msg = "variantname-$code";
                if ( $usemsg && wfMessage( $msg )->exists() ) {
                        return $this->getMessageFromDB( $msg );
@@ -723,24 +723,10 @@ class Language {
                }
        }
 
-       /**
-        * @deprecated since 1.24, doesn't handle conflicting aliases. Use
-        *   SpecialPageFactory::getLocalNameFor instead.
-        * @param string $name
-        * @return string
-        */
-       function specialPage( $name ) {
-               $aliases = $this->getSpecialPageAliases();
-               if ( isset( $aliases[$name][0] ) ) {
-                       $name = $aliases[$name][0];
-               }
-               return $this->getNsText( NS_SPECIAL ) . ':' . $name;
-       }
-
        /**
         * @return array
         */
-       function getDatePreferences() {
+       public function getDatePreferences() {
                return self::$dataCache->getItem( $this->mCode, 'datePreferences' );
        }
 
@@ -754,7 +740,7 @@ class Language {
        /**
         * @return array|string
         */
-       function getDefaultDateFormat() {
+       public function getDefaultDateFormat() {
                $df = self::$dataCache->getItem( $this->mCode, 'defaultDateFormat' );
                if ( $df === 'dmy or mdy' ) {
                        global $wgAmericanDates;
@@ -767,7 +753,7 @@ class Language {
        /**
         * @return array
         */
-       function getDatePreferenceMigrationMap() {
+       public function getDatePreferenceMigrationMap() {
                return self::$dataCache->getItem( $this->mCode, 'datePreferenceMigrationMap' );
        }
 
@@ -783,14 +769,14 @@ class Language {
         * @return array
         * @since 1.24
         */
-       function getImageFiles() {
+       public function getImageFiles() {
                return self::$dataCache->getItem( $this->mCode, 'imageFiles' );
        }
 
        /**
         * @return array
         */
-       function getExtraUserToggles() {
+       public function getExtraUserToggles() {
                return (array)self::$dataCache->getItem( $this->mCode, 'extraUserToggles' );
        }
 
@@ -802,33 +788,6 @@ class Language {
                return $this->getMessageFromDB( "tog-$tog" );
        }
 
-       /**
-        * Get native language names, indexed by code.
-        * Only those defined in MediaWiki, no other data like CLDR.
-        * If $customisedOnly is true, only returns codes with a messages file
-        *
-        * @param bool $customisedOnly
-        *
-        * @return array
-        * @deprecated since 1.20, use fetchLanguageNames()
-        */
-       public static function getLanguageNames( $customisedOnly = false ) {
-               return self::fetchLanguageNames( null, $customisedOnly ? 'mwfile' : 'mw' );
-       }
-
-       /**
-        * Get translated language names. This is done on best effort and
-        * by default this is exactly the same as Language::getLanguageNames.
-        * The CLDR extension provides translated names.
-        * @param string $code Language code.
-        * @return array Language code => language name
-        * @since 1.18.0
-        * @deprecated since 1.20, use fetchLanguageNames()
-        */
-       public static function getTranslatedLanguageNames( $code ) {
-               return self::fetchLanguageNames( $code, 'all' );
-       }
-
        /**
         * Get an array of language names, indexed by code.
         * @param null|string $inLanguage Code of language in which to return the names
@@ -940,7 +899,7 @@ class Language {
         * @param string $msg Message name
         * @return string
         */
-       function getMessageFromDB( $msg ) {
+       public function getMessageFromDB( $msg ) {
                return $this->msg( $msg )->text();
        }
 
@@ -954,29 +913,18 @@ class Language {
                return wfMessage( $msg )->inLanguage( $this );
        }
 
-       /**
-        * Get the native language name of $code.
-        * Only if defined in MediaWiki, no other data like CLDR.
-        * @param string $code
-        * @return string
-        * @deprecated since 1.20, use fetchLanguageName()
-        */
-       function getLanguageName( $code ) {
-               return self::fetchLanguageName( $code );
-       }
-
        /**
         * @param string $key
         * @return string
         */
-       function getMonthName( $key ) {
+       public function getMonthName( $key ) {
                return $this->getMessageFromDB( self::$mMonthMsgs[$key - 1] );
        }
 
        /**
         * @return array
         */
-       function getMonthNamesArray() {
+       public function getMonthNamesArray() {
                $monthNames = [ '' ];
                for ( $i = 1; $i < 13; $i++ ) {
                        $monthNames[] = $this->getMonthName( $i );
@@ -988,7 +936,7 @@ class Language {
         * @param string $key
         * @return string
         */
-       function getMonthNameGen( $key ) {
+       public function getMonthNameGen( $key ) {
                return $this->getMessageFromDB( self::$mMonthGenMsgs[$key - 1] );
        }
 
@@ -2896,6 +2844,7 @@ class Language {
        /**
         * @param string $s
         * @return string
+        * @throws MWException
         */
        function checkTitleEncoding( $s ) {
                if ( is_array( $s ) ) {
@@ -3350,7 +3299,7 @@ class Language {
         * Normally we output all numbers in plain en_US style, that is
         * 293,291.235 for twohundredninetythreethousand-twohundredninetyone
         * point twohundredthirtyfive. However this is not suitable for all
-        * languages, some such as Punjabi want à©¨à©¯à©©,੨੯੫.੨੩੫ and others such as
+        * languages, some such as Bengali (bn) want à§¨,৯৩,২৯১.২৩৫ and others such as
         * Icelandic just want to use commas instead of dots, and dots instead
         * of commas like "293.291,235".
         *
@@ -4235,7 +4184,7 @@ class Language {
         * Refresh the cache of conversion tables when
         * MediaWiki:Conversiontable* is updated.
         *
-        * @param Title $titleobj The Title of the page being updated
+        * @param Title $title The Title of the page being updated
         */
        public function updateConversionTable( Title $title ) {
                $this->mConverter->updateConversionTable( $title );
@@ -4282,15 +4231,6 @@ class Language {
                return self::$dataCache->getItem( $this->mCode, 'linkPrefixCharset' );
        }
 
-       /**
-        * @deprecated since 1.24, will be removed in 1.25
-        * @return Language
-        */
-       function getLangObj() {
-               wfDeprecated( __METHOD__, '1.24' );
-               return $this;
-       }
-
        /**
         * Get the "parent" language which has a converter to convert a "compatible" language
         * (in another variant) to this language (eg. zh for zh-cn, but not en for en-gb).
@@ -4416,6 +4356,7 @@ class Language {
        /**
         * @param string $code
         * @return string
+        * @throws MWException
         * @since 1.23
         */
        public static function getJsonMessagesFileName( $code ) {
@@ -4523,7 +4464,7 @@ class Language {
         * @return array Array of message keys (strings)
         */
        public static function getMessageKeysFor( $code ) {
-               return self::getLocalisationCache()->getSubItemList( $code, 'messages' );
+               return self::getLocalisationCache()->getSubitemList( $code, 'messages' );
        }
 
        /**
@@ -4581,7 +4522,7 @@ class Language {
         * @param string $expiry Database expiry String
         * @param bool|int $format True to process using language functions, or TS_ constant
         *     to return the expiry in a given timestamp
-        * @param string $inifinity If $format is not true, use this string for infinite expiry
+        * @param string $infinity If $format is not true, use this string for infinite expiry
         * @return string
         * @since 1.18
         */