Add search aliases for recently-added languages

Adding a test to ensure that both Tongan (to) and
Chitonga can be found by searching for "tonga".
Other cases are trivial and don't require a test.

Bug: T368046
Bug: T368856
Bug: T369464
Change-Id: Ia58f593729de1302749eeba349979a1a23e4eb4c
This commit is contained in:
Amir E. Aharoni
2024-07-23 15:32:12 -04:00
parent 63413a1dca
commit 58908cdb1b
3 changed files with 29 additions and 0 deletions

View File

@@ -99,6 +99,8 @@ class LanguageNameIndexer extends Maintenance {
// by people who search in English.
// To resolve this, some languages are added here locally.
$specialLanguages = [
// Abron / Brong / Bono (T369464)
'abr' => [ 'bono', 'brong' ],
// Catalan, sometimes searched as "Valencià"
'ca' => [ 'valencia' ],
// Compatibility with the old name and other Chinese varieties
@@ -111,6 +113,8 @@ class LanguageNameIndexer extends Maintenance {
'ka' => [ 'kartuli', 'qartuli' ],
// Japanese, the transliteration of the autonym is often used for searching
'ja' => [ 'nihongo', 'にほんご' ],
// Chiluvale (T368856)
'lue' => [ 'luvale, chi-' ],
// Mon, renamed in core MediaWiki's Names.php (T352776)
'mnw' => [ 'ဘာသာ မန်' ],
// Palembang, also known as "Musi".
@@ -122,6 +126,10 @@ class LanguageNameIndexer extends Maintenance {
'pnb' => [ 'punjabi western' ],
// Tai Nuea (T367377)
'tdd' => [ 'ᥖᥭᥰᥖᥬᥳᥑᥨᥒᥰ' ],
// Chitonga (T368856)
'toi' => [ 'tonga, chi-' ],
// Waale (T368046) - support alternate spellings of the name
'wlx' => [ 'waali', 'waalii' ],
// Simplified and Traditional Chinese, because zh-hans and zh-hant
// are not mapped to any English name
'zh-hans' => [ 'chinese simplified' ],

View File

@@ -3426,6 +3426,7 @@ class LanguageNameSearchData {
'bolgarščina' => 'bg',
'bolgár' => 'bg',
'bolqar' => 'bg',
'bono' => 'abr',
'boolish' => 'pl',
'boortaqiis' => 'pt',
'boortaqiis (boortuqaal)' => 'pt-pt',
@@ -3624,6 +3625,7 @@ class LanguageNameSearchData {
'britske gebeartetaal' => 'bfi',
'brittisk engelska' => 'en-gb',
'brohice' => 'brh',
'brong' => 'abr',
'brytyjski angelski' => 'en-gb',
'bráhuí' => 'brh',
'brèton' => 'br',
@@ -18385,6 +18387,7 @@ class LanguageNameSearchData {
'luulajansaame' => 'smj',
'luuqad looma hayo' => 'zxx',
'luuqado kala duwan' => 'mul',
'luvale, chi-' => 'lue',
'luvyetinaamu' => 'vi',
'luwada' => 'luo',
'luwarabu' => 'ar',
@@ -31947,6 +31950,7 @@ class LanguageNameSearchData {
'tonga del nyasa' => 'tog',
'tonga dili' => 'to',
'tonga nyasa' => 'tog',
'tonga, chi-' => 'toi',
'tongaans' => 'to',
'tongaansk' => 'to',
'tongaasch' => 'to',
@@ -34163,6 +34167,8 @@ class LanguageNameSearchData {
119 => [
'prefix' => [
'waale' => 'wlx',
'waali' => 'wlx',
'waalii' => 'wlx',
'waals' => 'wa',
'waast kanaadsk inuktitut' => 'ikt',
'waast ojibwa' => 'ojw',

View File

@@ -102,6 +102,21 @@ class LanguageSearchTest extends PHPUnit\Framework\TestCase {
'ka' => 'qartuli',
]
],
[ 'tonga', [
'to' => 'tonga',
'tog' => 'tonga (niasa)',
'toi' => 'tonga, chi-',
'ts' => 'tsonga',
'nr' => 'tonga — enetepēra ki te tonga',
'hax' => 'tonga — haira ki te tonga',
'st' => 'tonga — hōto ki te tonga',
'es-419' => 'tonga — pāniora amerikana ki te tonga',
'slh' => 'tonga — ratūti ki te tonga',
'tce' => 'tonga — tatōne ki te tonga',
'alt' => 'tonga — ātai ki te tonga',
'crj' => 'tonga-mā-rāwhiti — kirī tonga-mā-rāwhiti',
]
],
[ 'valencia', [
'ca' => 'valencia',
]