Skip to content

Commit

Permalink
Consider language tags as case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshtr committed Oct 17, 2013
1 parent faa1d08 commit 4d9e870
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/jquery.webfonts.js
Expand Up @@ -61,6 +61,8 @@
* @return {String} Font family name
*/
getFont: function( language ) {
language = language.toLowerCase();

if ( this.options.fontSelector ) {
return this.options.fontSelector( this.repository, language || this.language );
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/jquery.webfonts.test.js
Expand Up @@ -31,7 +31,7 @@
// Assign lang to 'my' to make webfonts work
$myanmarElement = $( '<div>' ).prop( {
id: 'webfonts-my-fixture',
lang: 'my',
lang: 'MY', // language tag should be case insensitive.
dir: 'ltr'
} ),
$hebrewElement = $( '<span>' )
Expand Down

0 comments on commit 4d9e870

Please sign in to comment.