forked from 0x2620/oxjs
add languages to geo module
This commit is contained in:
parent
a29d7e70ea
commit
7035e207c2
4 changed files with 568 additions and 18 deletions
|
|
@ -161,6 +161,21 @@ Ox.load.Geo = function(options, callback) {
|
|||
return Ox.PATH + 'Ox.Geo/png/' + type + 's/' + size + '/' + code + '.png';
|
||||
};
|
||||
|
||||
Ox.getImageByLanguage = function(type, size, language) {
|
||||
language = language
|
||||
.replace(' languages', '')
|
||||
.replace(' Sign Language', '');
|
||||
var country = '', code;
|
||||
Ox.COUNTRIES.forEach(function(c) {
|
||||
if (c.languages.indexOf(language) > -1) {
|
||||
country = c;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
code = country ? country.code : 'NTHH';
|
||||
return Ox.PATH + 'Ox.Geo/png/' + type + 's/' + size + '/' + code + '.png';
|
||||
};
|
||||
|
||||
callback(true);
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue