From: Brian Wolff Date: Sat, 23 Mar 2013 23:17:29 +0000 (-0300) Subject: Allow uca-sv@collation=standard to be a collation name. X-Git-Tag: 1.31.0-rc.0~19330^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=ac88b636b82b6d213e3bc0ff13fcc146e62c7e18;p=lhc%2Fweb%2Fwiklou.git Allow uca-sv@collation=standard to be a collation name. The "standard" collation for Swedish sorts V and W only as secondary differences. Compare this to the "reformed" collation which sorts them as separate letters. Which collation is default for sv seems to vary on icu version, but for icu 4.8 (which wmf uses) reformed is default. svwikisource wants to use the "standard" collation. Change-Id: I051590cf687ddea2e2cd84203d6e8eed3a6efd99 --- diff --git a/includes/Collation.php b/includes/Collation.php index ed8a031dd1..a69acd6224 100644 --- a/includes/Collation.php +++ b/includes/Collation.php @@ -49,7 +49,7 @@ abstract class Collation { return new IcuCollation( 'root' ); default: $match = array(); - if ( preg_match( '/^uca-([a-z-]+)$/', $collationName, $match ) ) { + if ( preg_match( '/^uca-([a-z@=-]+)$/', $collationName, $match ) ) { return new IcuCollation( $match[1] ); } @@ -214,6 +214,7 @@ class IcuCollation extends Collation { 'pt' => array(), 'ru' => array(), 'sv' => array( "Å", "Ä", "Ö" ), + 'sv@collation=standard' => array( "Å", "Ä", "Ö" ), 'uk' => array( "Ґ", "Ь" ), 'vi' => array( "Ă", "Â", "Đ", "Ê", "Ô", "Ơ", "Ư" ), // Not verified, but likely correct