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

@@ -10,9 +10,31 @@
module( "ext.uls", QUnit.newMwEnvironment() );
/*
* Runs over all script codes mentioned in langdb and checks whether
* they belong to the 'Other' group.
*/
var orphanScript = function () {
for ( var language in $.uls.data.languages ) {
var script = $.uls.data.languages[language][0];
if ( $.uls.data.groupOfScript( script ) === 'Other' ) {
return script;
}
}
return '';
}
test( "-- Initial check", function() {
expect( 1 );
ok( $.fn.uls, "$.fn.uls is defined" );
} );
test( "-- $.uls.data testing", function() {
expect( 1 );
// Unless we actually want some scripts to be in the 'Other' group.
strictEqual( orphanScript(), '', 'No orphan scripts found.' );
} );
}());