Merge "Use dash as separator for non-prefix matches in language name search"

This commit is contained in:
jenkins-bot
2018-02-08 14:25:26 +00:00
committed by Gerrit Code Review
4 changed files with 9470 additions and 9470 deletions

View File

@@ -62,7 +62,7 @@ class LanguageNameIndexer extends Maintenance {
$display = $translation; $display = $translation;
if ( $index > 0 && count( $words ) > 1 ) { if ( $index > 0 && count( $words ) > 1 ) {
$type = 'infix'; $type = 'infix';
$display = "$word <$translation>"; $display = "$word $translation";
} }
$buckets[$bucket][$type][$display] = $targetLanguage; $buckets[$bucket][$type][$display] = $targetLanguage;
} }

View File

@@ -48,7 +48,7 @@ class LanguageNameSearch {
if ( strpos( $name, $searchKey ) === 0 ) { if ( strpos( $name, $searchKey ) === 0 ) {
$results[$searchKey] = $name; $results[$searchKey] = $name;
} else { } else {
$results[$searchKey] = "$searchKey <$name>"; $results[$searchKey] = "$searchKey $name";
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -107,14 +107,14 @@ class LanguageSearchTest extends PHPUnit_Framework_TestCase {
'zh-tw' => 'chinese (taiwan)', 'zh-tw' => 'chinese (taiwan)',
'zh-hans' => 'chinese simplified', 'zh-hans' => 'chinese simplified',
'zh-hant' => 'chinese traditional', 'zh-hant' => 'chinese traditional',
'zh-classical' => 'chinese <classical chinese>', 'zh-classical' => 'chinese classical chinese',
'gan' => 'chinese <gan chinese>', 'gan' => 'chinese gan chinese',
'hak' => 'chinese <hakka chinese>', 'hak' => 'chinese hakka chinese',
'nan' => 'chinese <isi-min nan chinese>', 'nan' => 'chinese isi-min nan chinese',
'wuu' => 'chinese <isi-wu chinese>', 'wuu' => 'chinese isi-wu chinese',
'hsn' => 'chinese <isi-xiang chinese>', 'hsn' => 'chinese isi-xiang chinese',
'lzh' => 'chinese <literary chinese>', 'lzh' => 'chinese literary chinese',
'cdo' => 'chinese <min dong chinese>', 'cdo' => 'chinese min dong chinese',
] ]
], ],
[ 'finish', [ [ 'finish', [