Allow uca-sv@collation=standard to be a collation name.
authorBrian Wolff <bawolff+wn@gmail.com>
Sat, 23 Mar 2013 23:17:29 +0000 (20:17 -0300)
committerMatmaRex <matma.rex@gmail.com>
Thu, 27 Jun 2013 18:37:14 +0000 (20:37 +0200)
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

index ed8a031..a69acd6 100644 (file)
@@ -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