From 79882a8393b581e4112e8da1cc32f68f164828dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=8F=E5=AD=90=E5=A4=8D=E5=90=88=E6=80=81?= Date: Thu, 30 Jul 2020 00:26:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dupdate=E6=97=B6=E4=BC=9A?= =?UTF-8?q?=E5=87=BA=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ README.md | 3 ++- includes/LatinizeCollation.php | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..323211b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +LatinizeUrl.zip diff --git a/README.md b/README.md index 7f9d564..8cc1732 100644 --- a/README.md +++ b/README.md @@ -51,4 +51,5 @@ http://static-www.isekai.cn:8081/api/toolkit/asciiurl/hanzi2pinyin ### 使用首字母排列分类中的标题 ```php $wgCategoryCollation = 'latinize'; -``` \ No newline at end of file +``` +いい夢見てね \ No newline at end of file diff --git a/includes/LatinizeCollation.php b/includes/LatinizeCollation.php index fe22160..7ed39e4 100644 --- a/includes/LatinizeCollation.php +++ b/includes/LatinizeCollation.php @@ -25,6 +25,10 @@ class LatinizeCollation extends Collation { } public function getSortKey($string){ + if(defined('MW_UPDATER')){ + return $string; + } + $slug = Utils::getSlugByTitle($string); if($slug){ return ucfirst($slug); @@ -34,6 +38,10 @@ class LatinizeCollation extends Collation { } public function getFirstLetter($string){ + if(defined('MW_UPDATER')){ + return mb_substr(0, 1, $string, 'UTF-8'); + } + $slug = Utils::getSlugByTitle($string); if($slug){ return strtoupper($slug[0]);