LanguageNameIndexer: Remove directionality chars that cannot be typed

Change-Id: I8e5b9f300a3307a90054e4e759279f91594a2fa3
This commit is contained in:
Niklas Laxström
2016-06-15 10:53:17 +02:00
committed by Santhosh
parent b3ba423354
commit 42f4f9650b
2 changed files with 26 additions and 24 deletions

View File

@@ -38,6 +38,9 @@ class LanguageNameIndexer extends Maintenance {
$translations = LanguageNames::getNames( $sourceLanguage, 0, 2 );
foreach ( $translations as $targetLanguage => $translation ) {
$translation = mb_strtolower( $translation );
// Remove directionality markers used in Names.php: users are not
// going to type these.
$translation = str_replace( "\xE2\x80\x8E", '', $translation );
$bucket = LanguageNameSearch::getIndex( $translation );
$buckets[$bucket][$translation] = $targetLanguage;
}