IP tracking help |
[eluser]Justin Patel[/eluser]
Hello Friends !!! I am working on the multiple language. I want to track the IP address and get the name of country and then automatically select the language. is there any api for that? which method would be good for this... Looking forward to here from you
[eluser]xwero[/eluser]
The country doesn't always define the language. For instance in Belgium there are three languages : French, Dutch and German. I think you better get the language string from the browser with the useragent library. It isn't foolproof but i think it's a better method for language detection than using the ip address.
[eluser]Justin Patel[/eluser]
[quote author="xwero" date="1201557006"]The country doesn't always define the language. For instance in Belgium there are three languages : French, Dutch and German. I think you better get the language string from the browser with the useragent library. It isn't foolproof but i think it's a better method for language detection than using the ip address.[/quote] Great, I just understand 5%. Please please tell me in m0re details... thanks
[eluser]xwero[/eluser]
Which 5% did you understand ![]() CIs user agent library gets the string from the browser that gets send along with the http request. Quote:Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2As you can see the language string is embedded (en-US) and with the method accept_lang you can find out if the language you offer exist in the user agent string. Code: $langs = array('en','nl','es'); |
Welcome Guest, Not a member yet? Register Sign In |