Return an empty array if there are no languages in territory
Only JavaScript is modified here. The corresponding PHP function is unchanged to preserve consistency with other PHP functions. Corresponding pull request in jquery.uls: https://github.com/wikimedia/jquery.uls/pull/370 Downstream bug: https://phabricator.wikimedia.org/T265158
This commit is contained in:
1 parent
7093fe88cf
commit
4a61360950
2 files changed
+6
-1
No files matched your search
+1
-1
@@ -281,7 +281,7 @@ function getDir( language ) {
|
||||
* @return {string[]} list of language codes
|
||||
*/
|
||||
function getLanguagesInTerritory( territory ) {
|
||||
return languageData.territories[ territory ];
|
||||
return languageData.territories[ territory ] || [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user