views:

429

answers:

2

Hi,

I try to get CultureInfo with country code. I'm using hostip.info for getting country code.

For example, "http://api.hostip.info/?ip=207.46.197.32&position=true" returns me "US" for country code or http://api.hostip.info/?ip=82.151.131.196&position=true returns "TR".

If I could have "en-US", "tr-TR", it's easy, but I can't have these culture names. I have country codes.

So is there any way to get CultureInfo with country codes or do you have any suggestion for getting CultureInfo with IP Address?

A: 

I am not sure you can do this in practice.

If you have Switzerland, Canada or India as country code which language would you want?

Mark
Yes, you're right, it's better if I can get CultureName from IP Address? is there any way or what's the best way for localization with IP address?
Can
A: 

If the request is made by a browser, the "Accept-Language" field in the HTTP request header will list desired culture(s). Granted, it's not from an IP, but it may be a solution if you have HTTP request headers.

E.g.,

Accept-Language: en-us,en

Doug D