Merge "feedback: Fix misplaced mw.Title.getNameText() call"
[lhc/web/wiklou.git] / includes / collation / IcuCollation.php
index 8fea3ec..7774a60 100644 (file)
@@ -22,7 +22,7 @@
  * @since 1.16.3
  */
 class IcuCollation extends Collation {
-       const FIRST_LETTER_VERSION = 3;
+       const FIRST_LETTER_VERSION = 4;
 
        /** @var Collator */
        private $primaryCollator;
@@ -225,6 +225,7 @@ class IcuCollation extends Collation {
                'tl' => [ "Ñ", "Ng" ], // not in libicu
                'to' => [ "Ng", "ʻ" ],
                'tr' => [ "Ç", "Ğ", "İ", "Ö", "Ş", "Ü" ],
+               '-tr' => [ "ı" ],
                'tt' => [ "Ә", "Ө", "Ү", "Җ", "Ң", "Һ" ], // not in libicu
                'uk' => [ "Ґ", "Ь" ],
                'uz' => [ "Ch", "G'", "Ng", "O'", "Sh" ], // not in libicu
@@ -364,16 +365,14 @@ class IcuCollation extends Collation {
                        foreach ( $digits as $digit ) {
                                $letters[] = $this->digitTransformLanguage->formatNum( $digit, true );
                        }
+               } elseif ( $this->locale === 'root' ) {
+                       $letters = require "$IP/includes/collation/data/first-letters-root.php";
                } else {
-                       if ( $this->locale === 'root' ) {
-                               $letters = require "$IP/includes/collation/data/first-letters-root.php";
-                       } else {
-                               // FIXME: Is this still used?
-                               $letters = wfGetPrecompiledData( "first-letters-{$this->locale}.ser" );
-                               if ( $letters === false ) {
-                                       throw new MWException( "MediaWiki does not support ICU locale " .
-                                               "\"{$this->locale}\"" );
-                               }
+                       // FIXME: Is this still used?
+                       $letters = wfGetPrecompiledData( "first-letters-{$this->locale}.ser" );
+                       if ( $letters === false ) {
+                               throw new MWException( "MediaWiki does not support ICU locale " .
+                                       "\"{$this->locale}\"" );
                        }
                }
 
@@ -527,23 +526,6 @@ class IcuCollation extends Collation {
                return false;
        }
 
-       /**
-        * Return the version of ICU library used by PHP's intl extension,
-        * or false when the extension is not installed of the version
-        * can't be determined.
-        *
-        * The constant INTL_ICU_VERSION this function refers to isn't really
-        * documented, but see https://bugs.php.net/bug.php?id=54561.
-        *
-        * @since 1.21
-        * @deprecated since 1.32, use INTL_ICU_VERSION directly
-        * @return string
-        */
-       static function getICUVersion() {
-               wfDeprecated( __METHOD__, '1.32' );
-               return INTL_ICU_VERSION;
-       }
-
        /**
         * Return the version of Unicode appropriate for the version of ICU library
         * currently in use, or false when it can't be determined.