Home > Programming, Servers & Scripts >

Geo Call Out In Any Language (2)


03-31-2016 01:18 PM #1 marketdot ()
Geo Call Out In Any Language

Hi STM,

Just wondering if anyone has a script which can call out the User's GEO but in their own language or browser language.


For example, in English "Wien" is "Vienna" but if I had a German LP it wouldn't make sense for us to call out the user location in English.

Any solutions for this??


03-31-2016 04:41 PM #2 archieaff (Member)

Simple solution, but you need to manually write every city combo:

Code:
function getURLParameter(name) {return decodeURI((RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] ||'' );}

var city = getURLParameter("city");

if (city == "Vienna") {
  city = "Wien";
}
else if (city == "EnglishName1") {
  city = "LocalName1";
}
else if (city == "EnglishName2") {
  city = "LocalName2";
}
and so on...


Home > Programming, Servers & Scripts >