From 660caf9b88ef58997f446434438237bc0d73a9cd Mon Sep 17 00:00:00 2001 From: jhsoby Date: Thu, 7 Dec 2017 14:47:24 +0100 Subject: [PATCH] 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 --- autoload.php | 1 + includes/collation/Collation.php | 2 + .../NorthernSamiUppercaseCollation.php | 83 +++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 includes/collation/NorthernSamiUppercaseCollation.php 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 @@ +