Opened 9 years ago

Closed 8 years ago

#810 closed enhancement (fixed) lang-guess

Reported by: marcozink's profile marcozink Owned by:
Milestone: Priority: normal
Component: International Sites (Rosetta) Keywords:


I think not every spanish speaking country should be redirected to the es_ES site trough the lang-guess. Can it be done geographically so Chilean, Peruvian, Argentinian, Spanish and Mexican visitors are invited to go to the appropiate local site?

This request also extends to every language spoken in more than one country.

Change History (8)

#1 @Otto42
9 years ago

The language guess code isn't actually based on location, most of the time. It uses IP based location as a fallback, but generally it's actually getting the information from your web browser.

Most browsers have the ability to set the desired Language in some manner. This information gets passed along with the request to the server in an "Accept-Language" http header. The lang-guess program uses this information, compares it with our list of sites, and returns the appropriate response, more or less.

In other words, if your browser was sending Accept-Language: es-cl, then you would indeed receive a response that linked to, as that site does exist. Similarly, sending it es-pe would cause it to get instead.

This is basically a limitation of the browsers not knowing about those locales, or at least not supporting them as separate languages.

Adding additional IP based lookups to that is possible, but the data for IP 2 location is generally pretty bad. It probably wouldn't be very accurate. Still, the data is there, so it's worth looking into.

#2 @Otto42
9 years ago

Additionally, the Accept-Language header currently overrides any IP based lookups. So, if you configure your web browser for English only (English is ignored by lang-guess, as it's the default), then the current IP based lookup will take effect, and you can see if you get the expected response. If you're on an IP in that country, and if the database we have is accurate, of course.

#3 @marcozink
9 years ago

I am currently in Mexico, everytime I go to the lang-guess points to, even though my OS and browsers are in English. I tried changing a couple of browser language settings, Opera and Chorme, they both only have Spanish and Spanish (Latin American).

Is there a way IP location is used to define the lang-guess?

This ticket was mentioned in Slack in #meta by ocean90. View the logs.

8 years ago

#5 @ocean90
8 years ago

Related: #198, #1438

#6 @ocean90
8 years ago

#108 was marked as a duplicate.

This ticket was mentioned in Slack in #meta by ocean90. View the logs.

8 years ago

#8 @ocean90
8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In [dotorg11568]: If the Accept-Language HTTP header doesn't contain a region for a language we now look up the country code by the IP address.

Note: See TracTickets for help on using tickets.