4 ms·
There is the accept-language key that the user can send in the header. The correlation of those and country of location should be quite good. I think using geo
by rightbyte 3y ago
There is the accept-language key that the user can send in the header. The correlation of those and country of location should be quite good.
I think using geo IP is borderline spyware behaviour.
Becouse the databases are derived from some sort of spyware, right? Or are ip ranges public on country level? The city location has to be spyware derived?
- ale42 3y agoCountry from IP is usually based on public whois information about the IP range. No spyware involved. For city-level it gets more complicated. Every provider of IP geo-localization has its own way of doing it. I guess google uses aggregated information from web searches to figure out the city/region for a given IP range... and sometimes it blatantly fails, because ISPs might allocate IPs in unexpected ways for their algorithms, or move them around to different cities/regions. I'm often getting geolocalized (by IP) to a totally different part of the country. I've seen similar behaviours in other countries and with other ISPs, so it's not something that can fail relatively easily. Then there might be another source of information, which is more spyware-like. Android devices (via the Google play services, I think) participate in constructing a database of cell tower IDs and WiFi access point MAC addresses along with their GPS-derived estimated geographic position (see more: https://console.cloud.google.com/apis/library/geolocation.googleapis.com https://console.cloud.google.com/apis/library/geolocation.go...). Apple has a similar service, too. Theoretically the could use the submitted information to geolocalize the source IP range, but I'm unsure whether they actually do it.
- rightbyte 3y agoI see thanks for the explaination.
- fragmede 3y agomore like IP allocation databases and ping times
- Semaphor 3y agoEven setting aside languages spoken in multiple places, please leave the accept language header to languages, not regions. I have en us, because that's the language I want, but I've never been in the US and probably never will.
- rightbyte 3y agoYe correct. But the context here is to provide 'top of list' items in a dropdown. E.g. German would be like 3 countries, unless Austria and Schweiz have their own language code. Uk and US got different codes. Diaspora languages could just have 0 added top items, etc. I also have us-en, to avoid these crappy machine translations you get sometimes.
- skissane 3y ago> German would be like 3 countries, unless Austria and Schweiz have their own language code. Officially, we have de-DE for German German, de-AT for Austrian German, de-CH for Swiss German, de-LI for Liechtenstein German – Chrome knows all of those. Plain "de" means German of unknown variant/dialect, but statistically is more likely Germany than any other country. German is also a secondary official language in Belgium (de-BE), Luxembourg (de-LU), Namibia (de-NA), and also in one region of Italy (de-IT), but software awareness of those German variants is less common (Chrome doesn't know about them, but some other software packages do, e.g. ICU and Microsoft .NET).
- skissane 3y ago> I have en us, because that's the language I want, but I've never been in the US and probably never will. On my personal laptop, I have en-US, because I don't know why. Maybe it is the default for Chrome? I have en-AU set on macOS at a system level but Chrome seems to have ignored that. I just reconfigured Chrome to add en-AU before en-US, so now my Accept-Language header is en-AU,en-US,en My work laptop has macOS set to en-AU but Chrome set to en-GB. I'm not sure how en-GB happened, possibly something my employer did for whatever reason.
- gsich 3y agoYes, they are public on IP ranges.
- skissane 3y ago> I think using geo IP is borderline spyware behaviour. With corporate VPNs it often doesn't work anyway. Even though I'm not in the US, I sometimes am forced to use the US VPN access point (e.g. because someone forgot to add the IP range for the non-US VPN access points to the firewall rule for internal service X, and if I complain it will be fixed in a day or two, but I need to use internal service X right now). While I'm doing that, websites will think I'm in the US, even though I'm on the other side of the planet.