Merge "Use dash as separator for non-prefix matches in language name search"
This commit is contained in:
@@ -62,7 +62,7 @@ class LanguageNameIndexer extends Maintenance {
|
||||
$display = $translation;
|
||||
if ( $index > 0 && count( $words ) > 1 ) {
|
||||
$type = 'infix';
|
||||
$display = "$word <$translation>";
|
||||
$display = "$word — $translation";
|
||||
}
|
||||
$buckets[$bucket][$type][$display] = $targetLanguage;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class LanguageNameSearch {
|
||||
if ( strpos( $name, $searchKey ) === 0 ) {
|
||||
$results[$searchKey] = $name;
|
||||
} else {
|
||||
$results[$searchKey] = "$searchKey <$name>";
|
||||
$results[$searchKey] = "$searchKey – $name";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -107,14 +107,14 @@ class LanguageSearchTest extends PHPUnit_Framework_TestCase {
|
||||
'zh-tw' => 'chinese (taiwan)',
|
||||
'zh-hans' => 'chinese simplified',
|
||||
'zh-hant' => 'chinese traditional',
|
||||
'zh-classical' => 'chinese <classical chinese>',
|
||||
'gan' => 'chinese <gan chinese>',
|
||||
'hak' => 'chinese <hakka chinese>',
|
||||
'nan' => 'chinese <isi-min nan chinese>',
|
||||
'wuu' => 'chinese <isi-wu chinese>',
|
||||
'hsn' => 'chinese <isi-xiang chinese>',
|
||||
'lzh' => 'chinese <literary chinese>',
|
||||
'cdo' => 'chinese <min dong chinese>',
|
||||
'zh-classical' => 'chinese — classical chinese',
|
||||
'gan' => 'chinese — gan chinese',
|
||||
'hak' => 'chinese — hakka chinese',
|
||||
'nan' => 'chinese — isi-min nan chinese',
|
||||
'wuu' => 'chinese — isi-wu chinese',
|
||||
'hsn' => 'chinese — isi-xiang chinese',
|
||||
'lzh' => 'chinese — literary chinese',
|
||||
'cdo' => 'chinese — min dong chinese',
|
||||
]
|
||||
],
|
||||
[ 'finish', [
|
||||
|
||||
Reference in New Issue
Block a user