Created script groups, introduce $.uls.data

Gave script groups clear names and sorted them.
Documentation in comments.
Add tests to check that no script has been left behind.
Corrected Lath to Latn (thanks to testing).

Rename langdb.js to ext.uls.data.js

Add ResourceLoader module ext.uls.data

Change-Id: I91fafa94ffd1eaf2d12c954fe3a71064276533f9
This commit is contained in:
Amir E. Aharoni
2012-06-27 11:04:24 +03:00
committed by Santhosh Thottingal
parent b9ee6595d3
commit 03df48a609
9 changed files with 111 additions and 15 deletions

View File

@@ -0,0 +1,26 @@
/*
* @author Amir E. Aharoni
* Utilities for querying the language db.
*/
(function ( $ ) {
"use strict";
// Constants
var scriptIndex = 0,
regionsIndex = 1;
/*
* Returns the script group of a script or 'Other' if it doesn't
* belong to any group.
*/
$.uls.data.groupOfScript = function( script ) {
for ( var group in $.uls.data.scriptgroups ) {
if ( $.inArray( script, $.uls.data.scriptgroups[group] ) != -1 ) {
return group;
}
}
return 'Other';
}
} )( jQuery );