Add basic support for dir and lang attributes for autonyms

Added a util function for getting the language's direction.

Added lang and dir attributes for every language item in the list.
This commit is contained in:
amire80
2012-09-24 16:34:06 -07:00
parent e63aaf90bb
commit f9e3e148e3
3 changed files with 44 additions and 2 deletions

View File

@@ -339,6 +339,15 @@
return $.inArray( $.uls.data.script( language ), $.uls.data.rtlscripts ) !== -1;
};
/**
* Return the direction of the language
* @param string language code
* @return string
*/
$.uls.data.getDir = function( language ) {
return $.uls.data.isRtl( language ) ? 'rtl' : 'ltr';
};
/**
* Returns the languages spoken in a territory.
* @param string Territory code