From ac88b636b82b6d213e3bc0ff13fcc146e62c7e18 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sat, 23 Mar 2013 20:17:29 -0300 Subject: [PATCH] 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 --- includes/Collation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.20.1