Prevent appearance of redirects in the rendered list

utils.getLanguagesByScriptGroup() runs on the object's languages
property and not on all the langdb languages. This caused
the redirects to be counted as languages. I fixed this,
and added a test to prevent it.

Also update JS langdb, because it went out of sync in of
the previous commits.
This commit is contained in:
Amir E. Aharoni
2013-01-08 23:11:05 +02:00
parent ca18edd0dd
commit 66a50931a5
4 changed files with 38 additions and 17 deletions

View File

@@ -80,10 +80,17 @@
// Get the languages grouped by script group
var languagesByScriptGroup = $.uls.data.getLanguagesByScriptGroup( this.options.languages );
for ( var scriptGroup in languagesByScriptGroup ) {
// Make sure that we go by the original order
// of script groups
for ( var scriptGroup in $.uls.data.scriptgroups ) {
// Get the languages for the script group
var languages = languagesByScriptGroup[scriptGroup];
// It's possible that some script groups are missing
if ( !languages ) {
continue;
}
// Sort it based on autonym
languages.sort( $.uls.data.sortByAutonym );