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]);