Currently the API taxa endpoint returns the locale with each name when all_names=true, this is okay if the name is in one of the ~30 site translated languages (plus a few extra). But, for the other +400-600(?) lexicons it returns ‘und’ making it difficult to determine the language.
Would it be possible to include the lexicon for each name returned? This would be useful for finding duplicate names, names with missing lexicons (this thread) and names in specific languages (comments here and here).
For example searching Birds (taxon_id=3) returns 99 names, 42 of these are ‘und’. A simpler example for a single species:
https://api.inaturalist.org/v1/taxa?taxon_id=8211&all_names=true
{
"total_results": 1,
"page": 1,
"per_page": 30,
"results": [
{
...
"names": [
{
"is_valid": true,
"name": "Laniarius atrococcineus",
"position": 0,
"locale": "sci"
},
...
{
"is_valid": true,
"name": "Kgaragoba",
"position": 12,
"locale": "und"
},
{
"is_valid": true,
"name": "Hvidbåndet Gonolek",
"position": 13,
"locale": "da"
}
],
...
}
]
}
In the example above the name Kgaragoba would be returned with the lexicon Setswana:
...
{
"is_valid": true,
"name": "Kgaragoba",
"position": 12,
"locale": "und",
"lexicon":"Setswana"
},
...