Merge "Add 'avoidhours' option to Language#formatTimePeriod"
[lhc/web/wiklou.git] / languages / Language.php
index 17018c7..2262fa7 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 use CLDRPluralRuleParser\Evaluator;
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Assert\Assert;
 
 /**
@@ -506,7 +507,8 @@ class Language {
                if ( is_null( $this->namespaceNames ) ) {
                        global $wgMetaNamespace, $wgMetaNamespaceTalk, $wgExtraNamespaces;
 
-                       $validNamespaces = MWNamespace::getCanonicalNamespaces();
+                       $validNamespaces = MediaWikiServices::getInstance()->getNamespaceInfo()->
+                               getCanonicalNamespaces();
 
                        $this->namespaceNames = $wgExtraNamespaces +
                                self::$dataCache->getItem( $this->mCode, 'namespaceNames' );
@@ -744,7 +746,8 @@ class Language {
         */
        public function getNsIndex( $text ) {
                $lctext = $this->lc( $text );
-               $ns = MWNamespace::getCanonicalIndex( $lctext );
+               $ns = MediaWikiServices::getInstance()->getNamespaceInfo()->
+                       getCanonicalIndex( $lctext );
                if ( $ns !== null ) {
                        return $ns;
                }
@@ -3030,34 +3033,6 @@ class Language {
                }
        }
 
-       /**
-        * @deprecated No-op since 1.28
-        */
-       function initEncoding() {
-               wfDeprecated( __METHOD__, '1.28' );
-               // No-op.
-       }
-
-       /**
-        * @param string $s
-        * @return string
-        * @deprecated No-op since 1.28
-        */
-       function recodeForEdit( $s ) {
-               wfDeprecated( __METHOD__, '1.28' );
-               return $s;
-       }
-
-       /**
-        * @param string $s
-        * @return string
-        * @deprecated No-op since 1.28
-        */
-       function recodeInput( $s ) {
-               wfDeprecated( __METHOD__, '1.28' );
-               return $s;
-       }
-
        /**
         * Convert a UTF-8 string to normal form C. In Malayalam and Arabic, this
         * also cleans up certain backwards-compatible sequences, converting them