Home > Programming, Servers & Scripts >

Translating geoip city name to native language (3)


07-07-2012 10:12 AM #1 bandit09 ()
Translating geoip city name to native language

Anyone know how to translate a city-name result, say from maxmind's javascript geoip service into the native language? For example, if someone from Rome, Italy accesses a page with the maxmind javascript geoip script on it, it will return in geoip_city() as Rome. But, in Italian, Rome is actually Roma. Same thing for Venice. They call it Venezia in Italy. So does anyone know of a script/service/API/way to do this?


07-07-2012 10:28 AM #2 hd2010 (Member)

I think need some custom coding


07-07-2012 02:36 PM #3 dario (Member)

When i was using the MaxMind geo IP database I translated only the biggest cities and got nice results

[PHP]include("CountryCode.php");
include("Detail.php");
include("geoipregionvars.php");

$ip =$_SERVER['REMOTE_ADDR'];
$CCode = tstCount($ip);
$IPDet = tstdet($ip);

$paese = $CCode[0];
$citta = $IPDet[1];

if ($citta == 'Naples') {$citta = 'Napoli';}
if ($citta == 'Milan') {$citta = 'Milano';}
if... and so on[/PHP]


Home > Programming, Servers & Scripts >