The geonames module in its current implementation seems quite oriented to US / English websites only. It would be nice if the alternate names (in other languages) of countries would also get imported into the database and taken into account when using geonames_countries() or geonames_countryinfo().
Comments
Comment #1
lyricnz commentedThe geonames_countries() and geonames_countryinfo() functions simply make use of the data retrieved from http://download.geonames.org/export/dump/countryInfo.txt
This file only contains English - there's nothing we can do about that.
Comment #2
cyberwolf commentedHi lyricnz
GeoNames does offer the country names in different languages though, through their webservices. For example, all variants of the USA are listed here: http://www.geonames.org/US/other-names-for-united-states.html, this information can be retrieved with the web service http://api.geonames.org/countryInfoCSV?lang=it&country=USA&username=demo, simply replace the "it" in lang=it with the language you want the country info in.
The file they offer as a download probably has its (limited) purposes, but from a Drupal module offering an API to GeoNames I'd expect to keep internationalization in mind.
I found a workaround, by querying the webservices with the API this module offers:
Comment #3
lyricnz commentedFeel free to provide a patch that implements a user-friendly wrapper for this.
Comment #4
user654 commented.
Comment #5
lyricnz commentedDoes the query provided in #2 work for you? The data stored in countryinfo table in geonames module isn't much used, the query is better. Results are cached, which should help with performance.
Comment #6
user654 commented.
Comment #7
lyricnz commentedI don't know how you intend to do this reference, but it would be pretty easy to make a contrib module that saves whatever results you need. Sounds like you'd need to get into code development for this reference anyway?
Comment #8
user654 commented.
Comment #9
avpaderno