From: jhsoby Date: Thu, 7 Dec 2017 13:47:24 +0000 (+0100) Subject: Add custom collation for Northern Sami X-Git-Tag: 1.31.0-rc.0~1253^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=660caf9b88ef58997f446434438237bc0d73a9cd Add custom collation for Northern Sami This commit adds a custom collation order for Northern Sami ('se'). Northern Sami exists in ICU, but the version of ICU that Wikimedia uses is a few years old, and does *not* include Northern Sami. It could be years before Wikimedia's production servers use the one that includes Northern Sami (see bug), so this is a temporary workaround to amend this issue. Bug: T181503 Change-Id: Ib8a48b8db99bef8ec4b05144aace5dbdcacfeded --- diff --git a/autoload.php b/autoload.php index 2661fd7ed3..cd01828a6c 100644 --- a/autoload.php +++ b/autoload.php @@ -1040,6 +1040,7 @@ $wgAutoloadLocalClasses = [ 'NewPagesPager' => __DIR__ . '/includes/specials/pagers/NewPagesPager.php', 'NewUsersLogFormatter' => __DIR__ . '/includes/logging/NewUsersLogFormatter.php', 'NolinesImageGallery' => __DIR__ . '/includes/gallery/NolinesImageGallery.php', + 'NorthernSamiUppercaseCollation' => __DIR__ . '/includes/collation/NorthernSamiUppercaseCollation.php', 'NotRecursiveIterator' => __DIR__ . '/includes/libs/iterators/NotRecursiveIterator.php', 'NukeNS' => __DIR__ . '/maintenance/nukeNS.php', 'NukePage' => __DIR__ . '/maintenance/nukePage.php', diff --git a/includes/collation/Collation.php b/includes/collation/Collation.php index d009168d5e..7171a218ae 100644 --- a/includes/collation/Collation.php +++ b/includes/collation/Collation.php @@ -67,6 +67,8 @@ abstract class Collation { return new CollationFa; case 'uppercase-ba': return new BashkirUppercaseCollation; + case 'uppercase-se': + return new NorthernSamiUppercaseCollation; default: $match = []; if ( preg_match( '/^uca-([A-Za-z@=-]+)$/', $collationName, $match ) ) { diff --git a/includes/collation/NorthernSamiUppercaseCollation.php b/includes/collation/NorthernSamiUppercaseCollation.php new file mode 100644 index 0000000000..d373749e54 --- /dev/null +++ b/includes/collation/NorthernSamiUppercaseCollation.php @@ -0,0 +1,83 @@ +