X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fcollation%2FIcuCollation.php;h=ad94d4746d6a164b270c259b6b21edfac22175c9;hp=5f401a588b2488e879be5ebb2fb0133c38d4b768;hb=01cdb1762c7207bd261ad03726a88cb9afc97bfb;hpb=c4568ad41b7a1d6ba6669812529cddfe2b1e455a diff --git a/includes/collation/IcuCollation.php b/includes/collation/IcuCollation.php index 5f401a588b..ad94d4746d 100644 --- a/includes/collation/IcuCollation.php +++ b/includes/collation/IcuCollation.php @@ -75,7 +75,7 @@ class IcuCollation extends Collation { * letters (denoted by keys starting with '-'). * * These are additions to (or subtractions from) the data stored in the - * first-letters-root.ser file (which among others includes full basic latin, + * first-letters-root.php data file (which among others includes full basic latin, * cyrillic and greek alphabets). * * "Separate letter" is a letter that would have a separate heading/section @@ -124,7 +124,7 @@ class IcuCollation extends Collation { 'en' => [], 'eo' => [ "Ĉ", "Ĝ", "Ĥ", "Ĵ", "Ŝ", "Ŭ" ], 'es' => [ "Ñ" ], - 'et' => [ "Š", "Ž", "Õ", "Ä", "Ö", "Ü", "W" ], // added W for CollationEt (xx-uca-et) + 'et' => [ "Š", "Ž", "Õ", "Ä", "Ö", "Ü" ], 'eu' => [ "Ñ" ], // not in libicu 'fa' => [ // RTL, let's put each letter on a new line @@ -348,9 +348,10 @@ class IcuCollation extends Collation { * @throws MWException */ private function fetchFirstLetterData() { + global $IP; // Generate data from serialized data file if ( isset( self::$tailoringFirstLetters[$this->locale] ) ) { - $letters = wfGetPrecompiledData( 'first-letters-root.ser' ); + $letters = require "$IP/includes/collation/data/first-letters-root.php"; // Append additional characters $letters = array_merge( $letters, self::$tailoringFirstLetters[$this->locale] ); // Remove unnecessary ones, if any @@ -364,10 +365,15 @@ class IcuCollation extends Collation { $letters[] = $this->digitTransformLanguage->formatNum( $digit, true ); } } else { - $letters = wfGetPrecompiledData( "first-letters-{$this->locale}.ser" ); - if ( $letters === false ) { - throw new MWException( "MediaWiki does not support ICU locale " . - "\"{$this->locale}\"" ); + 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}\"" ); + } } }