Light and fast module to convert iso country and languages codes into country names, there is no unnecessary stuff only the bare essentials.
https://www.npmjs.com/package/isotolanguage
Gets information about the iso.
Example: isoInfo('it')
Args: {"iso":"it"}
{
"name": "Italian",
"original": "Italiano",
"iso3": "ita",
"iso2": "it"
}
Gets information about the iso.
Example: isoInfo('IT')
Args: {"iso":"IT"}
{
"iso2": "IT",
"languages": [
"it"
],
"name": "Italy",
"original": "Italia",
"iso3": "ITA"
}
Gets information about the iso.
Example: isoInfo('ITA')
Args: {"iso":"ITA"}
{
"languages": [
"it"
],
"name": "Italy",
"original": "Italia",
"iso3": "ITA"
}
Gets information about the iso.
Example: isoInfo('it_IT')
Args: {"iso":"it_IT"}
{
"type": "locale",
"country": {
"iso2": "IT",
"languages": [
"it"
],
"name": "Italy",
"original": "Italia",
"iso3": "ITA"
},
"language": {
"name": "Italian",
"original": "Italiano",
"iso3": "ita",
"iso2": "it"
}
}
Gets information about the iso.
Example: isoInfo('it-IT')
Args: {"iso":"it-IT"}
{
"type": "language-code",
"country": {
"iso2": "IT",
"languages": [
"it"
],
"name": "Italy",
"original": "Italia",
"iso3": "ITA"
},
"language": {
"name": "Italian",
"original": "Italiano",
"iso3": "ita",
"iso2": "it"
}
}
Gets information about the iso.
Example: isoInfo('it-IT')
Args: {"iso":"it-IT"}
{
"type": false,
"country": {
"iso2": "IT",
"languages": [
"it"
],
"name": "Italy",
"original": "Italia",
"iso3": "ITA"
},
"language": {
"name": "Italian",
"original": "Italiano",
"iso3": "ita",
"iso2": "it"
}
}
a function that validates if the iso code and returns the type.
Example: validateISO('it')
Args: {"iso":"it"}
language
a function that validates if the iso code and returns the type.
Example: validateISO('GB')
Args: {"iso":"GB"}
country
this case will return false because the iso code is invalid
Example: validateISO('EN')
Args: {"iso":"EN"}
false
passing the type will return if the iso code is valid or not in that type
Example: validateISO('en', 'language')
Args: {"iso":"en","type":"language"}
true
Will format the iso code into a language and country
Example: formatIso('en', 'GB')
Args: {"lang":"en","country":"GB"}
en-GB
Will format the iso code into a language and country
Example: formatIso('Italiano', 'Italy')
Args: {"lang":"Italiano","country":"Italy"}
it-IT
Will format the iso code into a language and country using the locale separator
Example: formatIso('en', 'GB', 'locale')
Args: {"lang":"en","country":"GB","separator":"locale"}
en_GB
Will format the iso code into a language and country using a custom separator
Example: formatIso('ca', 'ES', '😻')
Args: {"lang":"ca","country":"ES","separator":"😻"}
ca😻ES
Returns the information about the iso code
Example: getIso('en')
Args: {"key":"en"}
{
"name": "English",
"original": "English",
"iso3": "eng",
"iso2": "en"
}
Returns the information about the iso code
Example: getIso('GB')
Args: {"key":"GB"}
{
"iso2": "GB",
"languages": [
"en"
],
"name": "United Kingdom",
"original": "United Kingdom",
"iso3": "GBR"
}
Finds for the requested term and returns the information about the iso code, key accepts as value: iso2, iso3, name, original. by default the type is country
Example: getIso('Italy')
Args: {"key":"Italy"}
{
"iso2": "IT",
"languages": [
"it"
],
"name": "Italy",
"original": "Italia",
"iso3": "ITA"
}
Finds for the requested term and returns the information about the language iso code, key accept as value: iso2, iso3, name, original and type: language
Example: getIso('Italiano', 'language')
Args: {"key":"Italiano","type":"language"}
{
"name": "Italian",
"original": "Italiano",
"iso3": "ita",
"iso2": "it"
}
Finds for the requested term and returns the information about the iso code
Example: getIso('Italiano', 'language')
Args: {"key":"Italiano","type":"language"}
{
"name": "Italian",
"original": "Italiano",
"iso3": "ita",
"iso2": "it"
}
Finds for the requested term and returns the information about the iso code and return the required field as value
Example: getIso('Italiano', 'language', 'iso2')
Args: {"key":"Italiano","type":"language","field":"iso2"}
it
Finds for the requested term and returns the information about the iso code and return the required field as value
Example: getIso('Italia', 'country', 'flag')
Args: {"key":"Italia","type":"country","field":"flag"}
https://upload.wikimedia.org/wikipedia/commons/0/03/Flag_of_Italy.svg
the type can be omitted if you want to search in both country and language iso code fields
Example: getIso('Spain', undefined, 'name')
Args: {"key":"Spain","type":"undefined","field":"name"}
Spain
the third parameter can be an array of fields to return even only one
Example: getIso('Switzerland', "country", ['capital'])
Args: {"key":"Switzerland","type":"country","field":"capital"}
Bern
in order to expand the language iso code of the country, works also with the custom data from extra and geo sets
Example: getIso('Tunisia', "country", ['capital', 'currency'])
Args: {"key":"Tunisia","type":"country","field":["capital","currency"]}
{
"capital": "Tunis",
"currency": {
"code": "TND",
"symbol": "DT",
"original": "د.ت.",
"name": "Tunisian Dinar"
}
}
the third parameter can be an array of fields to return
Example: getIso('Spain', undefined, ['name', 'locale', 'language-code'])
Args: {"key":"Spain","field":["name","locale","language-code"]}
{
"name": "Spain",
"locale": [
"es_ES",
"eu_ES",
"ca_ES",
"gl_ES",
"oc_ES"
],
"language-code": [
"es-ES",
"eu-ES",
"ca-ES",
"gl-ES",
"oc-ES"
]
}
in order to expand the language iso code of the country, you need to specify "all" as field parameter
Example: getIso('France', "country", ['all'])
Args: {"key":"France","type":"country","field":["all"]}
{
"iso2": "FR",
"languages": [
{
"name": "French",
"original": "français",
"iso3": "fre",
"iso2": "fr"
}
],
"name": "France",
"original": "France",
"iso3": "FRA",
"capital": "Paris",
"region": "Europe",
"continent": "EU",
"subRegion": "Western Europe",
"nameFormal": "the French Republic",
"tld": ".fr",
"dial": "33",
"currency": {
"code": "EUR",
"symbol": "€",
"original": "€",
"name": "Euro"
},
"flag": "https://upload.wikimedia.org/wikipedia/commons/c/c3/Flag_of_France.svg",
"locale": [
"fr_FR"
],
"language-code": [
"fr-FR"
]
}
in order to expand the language iso code of the country, you need to specify "country-extra" as third parameter
Example: getIso('France', "country", 'country-extra')
Args: {"key":"France","type":"country","field":["country-extra"]}
{
"iso2": "FR",
"languages": [
"fr"
],
"name": "France",
"original": "France",
"iso3": "FRA",
"tld": ".fr",
"dial": "33",
"currency": {
"code": "EUR",
"symbol": "€",
"original": "€",
"name": "Euro"
},
"flag": "https://upload.wikimedia.org/wikipedia/commons/c/c3/Flag_of_France.svg"
}
in order to expand the language iso code of the country, you need to specify "country-geo" as third parameter
Example: getIso('Switzerland', "country", ['country-geo'])
Args: {"key":"Switzerland","type":"country","field":["country-geo"]}
{
"iso2": "CH",
"languages": [
"de",
"fr",
"it"
],
"name": "Switzerland",
"original": "Schweiz",
"iso3": "CHE",
"capital": "Bern",
"region": "Europe",
"continent": "EU",
"subRegion": "Western Europe",
"nameFormal": "the Swiss Confederation"
}
Get all will return an object with all ISO codes and their respective country data
Example: getAll()
Args: {}
{
"AD": {
"languages": [
"ca"
],
"name": "Andorra",
"original": "Andorra",
"iso3": "AND"
},
"AE": {
"languages": [
"ar"
],
"name": "United Arab Emirates",
"original": "دولة الإمارات العربية المتحدة",
"iso3": "ARE"
},
"AF": {
"languages": [
"ps",
"uz",
"tk"
],
"name": "Afghanistan",
"original": "افغانستان",
"iso3": "AFG"
},
"AG": {
"languages": [
"en"
],
"name": "Antigua and Barbuda",
"original": "Antigua and Barbuda",
"iso3": "ATG"
},
"AI": {
"languages": [
"en"
],
"name": "Anguilla",
"original": "Anguilla",
"iso3": "AIA"
},
"AL": {
"languages": [
"sq"
],
"name": "Albania",
"original": "Shqipëria",
"iso3": "ALB"
},
"AM": {
"languages": [
"hy",
"ru"
],
"name": "Armenia",
"original": "Հայաստան",
"iso3": "ARM"
},
"AO": {
"languages": [
"pt"
],
"
(...)
You can specify the field you want to return
Example: getAll('iso2')
Args: {"field":"iso2"}
["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI"
(...)
You can choose the field you want to return and from which type (language|country) you want to return the data
Example: getAll('iso2', 'language')
Args: {"field":"iso2","from":"language"}
["ab","aa","af","ak","sq","am","ar","an","hy","as","av","ae","ay","az","bm","ba","eu","be","bn","bh","bi","bs","br","bg","my","ca","ch","ce","ny","zh","cv","kw","co","cr","hr","cs","da","dv","nl","en","eo","et","ee","fo","fj","fi","fr","ff","gl","ka","de","el","gn","gu","ht","ha","he","hz","hi","ho","hu","ia","id","ie","ga","ig","ik","io","is","it","iu","ja","jv","kl","kn","kr","ks","kk","km","ki","rw","ky","kv","kg","ko","ku","kj","la","lb","lg","li","ln","lo","lt","lu","lv","gv","mk","mg","ms","ml","mt","mi","mr","mh","mn","na","nv","nb","nd","ne","ng","nn","no","ii","nr","oc","oj","cu","om","or","os","pa","pi","fa","pl","ps","pt","qu","rm","rn","ro","ru","sa","sc","sd","se","sm","sg","sr","gd","sn","si","sk","sl","so","st","es","su","sw","ss","sv","ta","te","tg","th","ti","bo","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","cy","wo","fy","xh","yi","yo","za"]
All the same as above but for iso3
Example: getAll('iso3')
Args: {"field":"iso3"}
["AND","ARE","AFG","ATG","AIA","ALB","ARM","AGO","ATA","ARG","ASM","AUT","AUS","ABW","ALA","AZE","BIH","BRB","BGD","BEL","BFA","BGR","BHR","BDI","BEN","BLM","BMU","BRN","BOL","BES","BRA","BHS","BTN","BVT","BWA","BLR","BLZ","CAN","CCK","COD","CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI","CUB","CPV","CUW","CXR","CYP","CZE","DEU","DJI","DNK","DMA","DOM","DZA","ECU","EST","EGY","ESH","ERI","ESP","ETH","FIN","FJI","FLK","FSM","FRO","FRA","GAB","GBR","GRD","GEO","GUF","GGY","GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","SGS","GTM","GUM","GNB","GUY","HKG","HMD","HND","HRV","HTI","HUN","IDN","IRL","ISR","IMN","IND","IOT","IRQ","IRN","ISL","ITA","JEY","JAM","JOR","JPN","KEN","KGZ","KHM","KIR","COM","KNA","PRK","KOR","KWT","CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU","LUX","LVA","LBY","MAR","MCO","MDA","MNE","MAF","MDG","MHL","MKD","MLI","MMR","MNG","MAC","MNP","MTQ","MRT","MSR","MLT","MUS","MDV","MWI","MEX","MYS","MOZ","NAM","NCL","NER","NFK","NGA","NIC","NLD","NO
(...)
All the same as above but for iso3 and from which type (language|country) you want to return the data
Example: getAll('iso3', 'language')
Args: {"field":"iso3","from":"language"}
["aar","abk","ace","ach","ada","ady","afa","afh","afr","ain","aka","akk","alb","ale","alg","alt","amh","ang","anp","apa","ara","arc","arg","arm","arn","arp","art","arw","asm","ast","ath","aus","ava","ave","awa","aym","aze","bad","bai","bak","bal","bam","ban","baq","bas","bat","bej","bel","bem","ben","ber","bho","bih","bik","bin","bis","bla","bnt","bos","bra","bre","btk","bua","bug","bul","bur","byn","cad","cai","car","cat","cau","ceb","cel","cha","chb","che","chg","chi","chk","chm","chn","cho","chp","chr","chu","chv","chy","cmc","cnr","cop","cor","cos","cpe","cpf","cpp","cre","crh","crp","csb","cus","cze","dak","dan","dar","day","del","den","dgr","din","div","doi","dra","dsb","dua","dum","dut","dyu","dzo","efi","egy","eka","elx","eng","enm","epo","est","ewe","ewo","fan","fao","fat","fij","fil","fin","fiu","fon","fre","frm","fro","frr","frs","fry","ful","fur","gaa","gay","gba","gem","geo","ger","gez","gil","gla","gle","glg","glv","gmh","goh","gon","gor","got","grb","grc","gre","grn","gs
(...)
the same as above but for locale
Example: getAll('locale')
Args: {"field":"locale"}
["af_NA","af_ZA","am_ET","ar_AE","ar_BH","ar_DJ","ar_DZ","ar_EG","ar_ER","ar_IL","ar_IQ","ar_JO","ar_KM","ar_KW","ar_LB","ar_LY","ar_MA","ar_MR","ar_OM","ar_PS","ar_QA","ar_SA","ar_SD","ar_SO","ar_SY","ar_TD","ar_TN","ar_YE","ay_BO","az_AZ","be_BY","bg_BG","bi_VU","bn_BD","bs_BA","bs_ME","ca_AD","ca_ES","ch_GU","ch_MP","cs_CZ","da_DK","de_AT","de_BE","de_CH","de_DE","de_LI","de_LU","dv_MV","el_CY","el_GR","en_AG","en_AI","en_AS","en_AU","en_BB","en_BM","en_BS","en_BW","en_BZ","en_CA","en_CC","en_CK","en_CM","en_CW","en_CX","en_DM","en_ER","en_FJ","en_FK","en_FM","en_GB","en_GD","en_GG","en_GH","en_GI","en_GM","en_GS","en_GU","en_GY","en_HK","en_HM","en_IE","en_IM","en_IN","en_IO","en_JE","en_JM","en_KE","en_KI","en_KN","en_KY","en_LC","en_LR","en_LS","en_MF","en_MH","en_MP","en_MS","en_MT","en_MU","en_MW","en_NA","en_NF","en_NG","en_NR","en_NU","en_NZ","en_PG","en_PH","en_PK","en_PN","en_PR","en_PW","en_RW","en_SB","en_SC","en_SD","en_SG","en_SH","en_SL","en_SS","en_SX","en_SZ","en_TC"
(...)
the same as above but for language-code
Example: getAll('language-code')
Args: {"field":"language-code"}
["af-NA","af-ZA","am-ET","ar-AE","ar-BH","ar-DJ","ar-DZ","ar-EG","ar-ER","ar-IL","ar-IQ","ar-JO","ar-KM","ar-KW","ar-LB","ar-LY","ar-MA","ar-MR","ar-OM","ar-PS","ar-QA","ar-SA","ar-SD","ar-SO","ar-SY","ar-TD","ar-TN","ar-YE","ay-BO","az-AZ","be-BY","bg-BG","bi-VU","bn-BD","bs-BA","bs-ME","ca-AD","ca-ES","ch-GU","ch-MP","cs-CZ","da-DK","de-AT","de-BE","de-CH","de-DE","de-LI","de-LU","dv-MV","el-CY","el-GR","en-AG","en-AI","en-AS","en-AU","en-BB","en-BM","en-BS","en-BW","en-BZ","en-CA","en-CC","en-CK","en-CM","en-CW","en-CX","en-DM","en-ER","en-FJ","en-FK","en-FM","en-GB","en-GD","en-GG","en-GH","en-GI","en-GM","en-GS","en-GU","en-GY","en-HK","en-HM","en-IE","en-IM","en-IN","en-IO","en-JE","en-JM","en-KE","en-KI","en-KN","en-KY","en-LC","en-LR","en-LS","en-MF","en-MH","en-MP","en-MS","en-MT","en-MU","en-MW","en-NA","en-NF","en-NG","en-NR","en-NU","en-NZ","en-PG","en-PH","en-PK","en-PN","en-PR","en-PW","en-RW","en-SB","en-SC","en-SD","en-SG","en-SH","en-SL","en-SS","en-SX","en-SZ","en-TC"
(...)
All the names of the countries
Example: getAll('name')
Args: {"field":"name"}
["Afghanistan","Aland","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bonaire","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central African Republic","Chad","Chile","China","Christmas Island","Cocos (Keeling) Islands","Colombia","Comoros","Cook Islands","Costa Rica","Croatia","Cuba","Curacao","Cyprus","Czech Republic","Democratic Republic of the Congo","Denmark","Djibouti","Dominica","Dominican Republic","East Timor","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Guia
(...)
All the available names from type (language|country) for which you want to return the data
Example: getAll('name', 'language')
Args: {"field":"name","from":"language"}
["Abkhaz","Afar","Afrikaans","Akan","Albanian","Amharic","Arabic","Aragonese","Armenian","Assamese","Avaric","Avestan","Aymara","Azerbaijani","Bambara","Bashkir","Basque","Belarusian","Bengali","Bihari","Bislama","Bosnian","Breton","Bulgarian","Burmese","Catalan; Valencian","Chamorro","Chechen","Chichewa; Chewa; Nyanja","Chinese","Chuvash","Cornish","Corsican","Cree","Croatian","Czech","Danish","Divehi; Dhivehi; Maldivian;","Dutch","English","Esperanto","Estonian","Ewe","Faroese","Fijian","Finnish","French","Fula; Fulah; Pulaar; Pular","Galician","Georgian","German","Greek, Modern","Guaraní","Gujarati","Haitian; Haitian Creole","Hausa","Hebrew (modern)","Herero","Hindi","Hiri Motu","Hungarian","Icelandic","Ido","Igbo","Indonesian","Interlingua","Interlingue","Inuktitut","Inupiaq","Irish","Italian","Japanese","Javanese","Kalaallisut, Greenlandic","Kannada","Kanuri","Kashmiri","Kazakh","Khmer","Kikuyu, Gikuyu","Kinyarwanda","Kirghiz, Kyrgyz","Kirundi","Komi","Kongo","Korean","Kurdish","K
(...)
Special case to return all the data available for all fields
Example: getAll('all')
Args: {"field":"all"}
{
"AD": {
"iso2": "AD",
"languages": [
{
"name": "Catalan; Valencian",
"original": "Català",
"iso3": "cat",
"iso2": "ca"
}
],
"name": "Andorra",
"original": "Andorra",
"iso3": "AND",
"capital": "Andorra la Vella",
"region": "Europe",
"continent": "EU",
"subRegion": "Southern Europe",
"nameFormal": "the Principality of Andorra",
"tld": ".ad",
"dial": "376",
"currency": {
"code": "EUR",
"symbol": "€",
"original": "€",
"name": "Euro"
},
"flag": "https://upload.wikimedia.org/wikipedia/commons/1/19/Flag_of_Andorra.svg",
"locale": [
"ca_AD"
],
"language-code": [
"ca-AD"
]
},
"AE": {
"iso2": "AE",
"languages": [
{
"name": "Arabic",
"original": "العربية",
"iso3": "ara",
"iso2": "ar"
}
],
"name": "United Arab Emirates",
"original": "دولة الإمارات العربية المتحدة",
(...)
Returns additional informations as the tld, dialing code, currency and currency code
Example: getAll('country-geo')
Args: {"field":"country-geo"}
{
"AD": {
"iso2": "AD",
"languages": [
"ca"
],
"name": "Andorra",
"original": "Andorra",
"iso3": "AND",
"capital": "Andorra la Vella",
"region": "Europe",
"continent": "EU",
"subRegion": "Southern Europe",
"nameFormal": "the Principality of Andorra"
},
"AE": {
"iso2": "AE",
"languages": [
"ar"
],
"name": "United Arab Emirates",
"original": "دولة الإمارات العربية المتحدة",
"iso3": "ARE",
"capital": "Abu Dhabi",
"region": "Asia",
"continent": "AS",
"subRegion": "Western Asia",
"nameFormal": "the United Arab Emirates"
},
"AF": {
"iso2": "AF",
"languages": [
"ps",
"uz",
"tk"
],
"name": "Afghanistan",
"original": "افغانستان",
"iso3": "AFG",
"capital": "Kabul",
"region": "Asia",
"continent": "AS",
"subRegion": "Southern Asia",
"nameFormal": "the Islamic Republic of Afghanistan"
},
"AG": {
"iso2": "AG",
"languag
(...)
Returns additional informations as the tld, dialing code, currency and currency
Example: getAll('country-extra')
Args: {"field":"country-extra"}
{
"AD": {
"iso2": "AD",
"languages": [
"ca"
],
"name": "Andorra",
"original": "Andorra",
"iso3": "AND",
"tld": ".ad",
"dial": "376",
"currency": {
"code": "EUR",
"symbol": "€",
"original": "€",
"name": "Euro"
},
"flag": "https://upload.wikimedia.org/wikipedia/commons/1/19/Flag_of_Andorra.svg"
},
"AE": {
"iso2": "AE",
"languages": [
"ar"
],
"name": "United Arab Emirates",
"original": "دولة الإمارات العربية المتحدة",
"iso3": "ARE",
"tld": ".ae",
"dial": "971",
"currency": {
"code": "AED",
"symbol": "AED",
"original": "د.إ.",
"name": "United Arab Emirates Dirham"
},
"flag": "https://upload.wikimedia.org/wikipedia/commons/c/cb/Flag_of_the_United_Arab_Emirates.svg"
},
"AF": {
"iso2": "AF",
"languages": [
"ps",
"uz",
"tk"
],
"name": "Afghanistan",
"original": "افغانستان",
"iso3": "AFG",
"tl
(...)
Returns iso3 codes for all languages
Example: getAll('language-iso3', 'language')
Args: {"field":"iso3","type":"language"}
{
"aar": {
"name": "Afar",
"original": "Afaraf",
"iso3": "aar",
"iso2": "aa"
},
"abk": {
"name": "Abkhazian",
"original": "аҧсуа",
"iso3": "abk",
"iso2": "ab"
},
"ace": {
"name": "Achinese"
},
"ach": {
"name": "Acoli"
},
"ada": {
"name": "Adangme"
},
"ady": {
"name": [
"Adyghe",
"Adygei"
]
},
"afa": {
"hierarchy": [
"Afro-Asiatic languages"
],
"name": "Afro-Asiatic languages"
},
"afh": {
"name": "Afrihili"
},
"afr": {
"name": "Afrikaans",
"original": "Afrikaans",
"iso3": "afr",
"iso2": "af"
},
"ain": {
"name": "Ainu"
},
"aka": {
"name": "Akan",
"original": "Akan",
"iso3": "aka",
"iso2": "ak"
},
"akk": {
"name": "Akkadian"
},
"alb": {
"name": "Albanian",
"original": "Shqip",
"iso3": "alb",
"iso2": "sq"
},
"ale": {
"name": "Aleut"
},
"alg": {
"hierarchy": [
"North American Indi
(...)
You can group the results by continent or region or subRegion
Example: getGroupedBy( 'continent' )
Args: {"type":"continent"}
{
"EU": {
"AX": {
"languages": [
"sv"
],
"name": "Aland",
"original": "Åland",
"iso3": "ALA",
"capital": "Mariehamn",
"region": "Europe",
"continent": "EU",
"subRegion": "Northern Europe"
},
"AL": {
"languages": [
"sq"
],
"name": "Albania",
"original": "Shqipëria",
"iso3": "ALB",
"capital": "Tirana",
"region": "Europe",
"continent": "EU",
"subRegion": "Southern Europe",
"nameFormal": "the Republic of Albania"
},
"AD": {
"languages": [
"ca"
],
"name": "Andorra",
"original": "Andorra",
"iso3": "AND",
"capital": "Andorra la Vella",
"region": "Europe",
"continent": "EU",
"subRegion": "Southern Europe",
"nameFormal": "the Principality of Andorra"
},
"AT": {
"languages": [
"de"
],
"name": "Austria",
"original": "Österreich",
"iso3
(...)
You can group the results by continent or region or subRegion and return only the requested key
Example: getGroupedBy( 'region', "Antarctica" )
Args: {"type":"region","key":"Antarctica"}
{
"Antarctica": {
"AQ": {
"languages": [],
"name": "Antarctica",
"original": "Antarctica",
"iso3": "ATA",
"region": "Antarctica",
"continent": "AN",
"subRegion": "Antarctica"
}
}
}
With this function it is possible to prepare the array of objects needed for the selects html charts
Example: getKeyValue( 'original', 'languages' )
Args: {"value1":"original","value2":"languages"}
[
{
"label": "ca_AD",
"value": "Andorra"
},
{
"label": "ar_AE",
"value": "دولة الإمارات العربية المتحدة"
},
{
"label": "ps_AF",
"value": "افغانستان (ps_AF)"
},
{
"label": "uz_AF",
"value": "افغانستان (uz_AF)"
},
{
"label": "tk_AF",
"value": "افغانستان (tk_AF)"
},
{
"label": "en_AG",
"value": "Antigua and Barbuda"
},
{
"label": "en_AI",
"value": "Anguilla"
},
{
"label": "sq_AL",
"value": "Shqipëria"
},
{
"label": "hy_AM",
"value": "Հայաստան (hy_AM)"
},
{
"label": "ru_AM",
"value": "Հայաստան (ru_AM)"
},
{
"label": "pt_AO",
"value": "Angola"
},
{
"label": "es_AR",
"value": "Argentina (es_AR)"
},
{
"label": "gn_AR",
"value": "Argentina (gn_AR)"
},
{
"label": "en_AS",
"value": "American Samoa (en_AS)"
},
{
"label": "sm_AS",
"value": "American Samoa (sm_AS)"
},
{
"label": "de_AT",
"value": "Österreich"
(...)
You can even choose which key you want to return, this can be useful for charts
Example: getKeyValue( 'locale', 'flag', "the language locale", "flag" )
Args: {"value1":"locale","value2":"flag","key1":"the language locale","key2":"flag"}
[
{
"the language locale": "ca_AD",
"flag": "https://upload.wikimedia.org/wikipedia/commons/1/19/Flag_of_Andorra.svg"
},
{
"the language locale": "ar_AE",
"flag": "https://upload.wikimedia.org/wikipedia/commons/c/cb/Flag_of_the_United_Arab_Emirates.svg"
},
{
"the language locale": "ps_AF",
"flag": "https://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_the_Taliban.svg (ps_AF)"
},
{
"the language locale": "uz_AF",
"flag": "https://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_the_Taliban.svg (uz_AF)"
},
{
"the language locale": "tk_AF",
"flag": "https://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_the_Taliban.svg (tk_AF)"
},
{
"the language locale": "en_AG",
"flag": "https://upload.wikimedia.org/wikipedia/commons/8/89/Flag_of_Antigua_and_Barbuda.svg"
},
{
"the language locale": "en_AI",
"flag": "https://upload.wikimedia.org/wikipedia/commons/b/b4/Flag_of_Anguilla.svg"
},
{
"the la
(...)
Returns all the countries of the specified language
Example: getCountriesByLanguage(['it'])
Args: {"languages":["it"]}
{
"CH": {
"languages": [
"de",
"fr",
"it"
],
"name": "Switzerland",
"original": "Schweiz",
"iso3": "CHE"
},
"IT": {
"languages": [
"it"
],
"name": "Italy",
"original": "Italia",
"iso3": "ITA"
},
"SM": {
"languages": [
"it"
],
"name": "San Marino",
"original": "San Marino",
"iso3": "SMR"
},
"VA": {
"languages": [
"it",
"la"
],
"name": "Vatican City",
"original": "Vaticano",
"iso3": "VAT"
}
}
Returns all the countries of the specified languages
Example: getCountriesByLanguage(['it', 'es'])
Args: {"languages":["it","es"]}
{
"AR": {
"languages": [
"es",
"gn"
],
"name": "Argentina",
"original": "Argentina",
"iso3": "ARG"
},
"BO": {
"languages": [
"es",
"ay",
"qu"
],
"name": "Bolivia",
"original": "Bolivia",
"iso3": "BOL"
},
"BZ": {
"languages": [
"en",
"es"
],
"name": "Belize",
"original": "Belize",
"iso3": "BLZ"
},
"CH": {
"languages": [
"de",
"fr",
"it"
],
"name": "Switzerland",
"original": "Schweiz",
"iso3": "CHE"
},
"CL": {
"languages": [
"es"
],
"name": "Chile",
"original": "Chile",
"iso3": "CHL"
},
"CO": {
"languages": [
"es"
],
"name": "Colombia",
"original": "Colombia",
"iso3": "COL"
},
"CR": {
"languages": [
"es"
],
"name": "Costa Rica",
"original": "Costa Rica",
"iso3": "CRI"
},
"CU": {
"languages": [
"es"
],
"name": "Cuba",
"orig
(...)