Home > Questions and Answers > Tracking Questions

how to display city callout in the visitors language? (2)


09-28-2014 10:20 AM #1 dvir0776 (Member)
how to display city callout in the visitors language?

Hi!

I can call the user's city, but my lander is not in english. How can I translate it from bangkok for example to กรุงเทพฯ (bangkok in thai).
edit: found this answer by maxmind which didn't answer anything for me http://dev.maxmind.com/faq/how-do-i-...tive-language/

Thanks!


09-28-2014 10:35 AM #2 zeno (Administrator)

Yes, it's possible with the GeoIP2 databases and this is one of their advantages over GeoIP legacy.

I'm not sure if localised names are in the databases or whether they just supply a 'geonameId' that lets you then look it up from them.

Note this in the PHP documentation:

print($record->country->isoCode . "\n"); // 'US'
print($record->country->name . "\n"); // 'United States'
print($record->country->names['zh-CN'] . "\n"); // '美国'

So, names['language code'] might work to a limited extent. Looking at the web service documentation suggests only a few languages work:


Home > Questions and Answers > Tracking Questions