Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am busy to create an application for multi countries and multi-language I need to do the next:
1- to master or (Automatic selection)the application by using geolocation (IP address of countries and sub IP address of cities)
- if someone opens the application in-country will be per default the data and language of his country.

example:
- that means if I am in Netherland per default I will see all data that bind to the Netherland with the language of Netherland and that can happen only by using geolocation and IP address.
- if someone open in Ukraine then per default(Automatic selection ) he will see the data of Ukraine and the language he does not need to select countries

What I have tried:

I tried to use Geolocation and IP address but this is only to select information about countries
Posted
Updated 5-May-20 20:19pm

1 solution

Well, I always think it's dangerous to make assumptions about geographic location vs language anyway : you could say for all of Australia use English as the default language (and many people with their head in the sand would like it to be so), but what about a French colleague I worked with in Australia ?

Geolocation is interesting anyway - http://ip-api.com/json[^] gives
{"status":"success","country":"Australia","countryCode":"AU","region":"NSW","regionName":"New South Wales","city":"Wallsend","zip":"2287","lat":-32.898,"lon":151.6707,"timezone":"Australia/Sydney","isp":"SingTel Optus Pty Ltd","org":"Optus Internet Pty Ltd","as":"AS4804 Microplex PTY LTD","query":"110.33.202.88"}
which is ok on the region (state), but fails miserable on the city (should be Sydney), and zip (postcode) is also incorrect.

I would use the browser accept-language header as my first choice, but allow the user to over-ride it/supply their own language identifier - else you're going to have to find yourself a really good database/service - they are out there, but not free
 
Share this answer
 
v2
Comments
Richard MacCutchan 6-May-20 3:32am    
As with all of these locators it can only locate the public IP location which is provided by the ISP. I have in the past had addresses that are more than 200 miles from where I live. Interestingly this one actually got the town right, so I guess my ISP has a node near here now.
faayez 6-May-20 3:56am    
do you are a pro or anti automatic selecting or filtering data and language your application by using Geolocation and IP Address?
Garth J Lancaster 6-May-20 4:32am    
yes, I am anti automatic selecting using Geolocation/IP address - by the data I showed, I should be speaking Novocastrian - what if the example was based on Belgium (ignoring that people could speak more than one language) - how would you pick from potentially French, Flemish ? I'll ignore personal experience that says when buying chocolate in Belgium they speak English and Money
faayez 6-May-20 5:00am    
Thanks, Mr.Garth in my application I have to create it for 23 countries speak one language only Arabic and every country want to see only the data of the country only if he needs to see another country he can select it from the dropdown list.
so the problem of language is not the issue but my question this has any effect in the database (security, safety .....) if not how do you think I can manage it just IP per country the data loaded for the country
Garth J Lancaster 6-May-20 5:37am    
ok - well, I guess it depends on how accurate Geolocation etc is where you are or in the 23 countries - if it is accurate at least to the geographical 'boundary' - eg Country or 'Region', then, why don't you create your own database for the language component - that mitigates any concerns over security/safety etc

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900