Opened 6 years ago

Closed 6 years ago

#1828 closed bug (fixed)

default language

Reported by: beatnickgr Owned by: dima42
Priority: major Milestone: 1.6
Component: BW Internationalization Keywords: default language
Cc:

Description (last modified by shevek)

Issue: Default language is english, even if we connect from non-english speaking countries.

How to reproduce error: Log out, clean cookies, and open again www.bewelcome.org

Expected behaviour: When connecting for a non-english speaking country we should see the page in the local language (if translated). When creating an account the default language should be the local (not english).

Related tickets:

Change History (34)

comment:1 Changed 6 years ago by shevek

@beatnickgr: Which language does your browser send?

comment:2 Changed 6 years ago by shevek

Works fine with Italiano on www. I suppose a browser will send 'el' for Greek which fails as the language table contains 'gr' instead. We really need to cleanup there.

comment:3 Changed 6 years ago by shevek

  • Description modified (diff)

comment:4 Changed 6 years ago by shevek

  • Description modified (diff)

comment:5 Changed 6 years ago by jsfan

Deployed on alpha.

comment:6 follow-up: Changed 6 years ago by shevek

Fix doesn't do anything as the whole function setLanguage in roxfrountrouter was never adapted to the new setup of the servers.

setLanguage needs a rewrite based on this functionality (sorry German only): http://aktuell.de.selfhtml.org/artikel/php/httpsprache/

comment:7 Changed 6 years ago by shevek

  • Milestone changed from unassigned to 1.6-proposed

Adding to 1.6

comment:8 Changed 6 years ago by dima42

  • Owner set to dima42
  • Status changed from new to accepted

i'm committing to get this done by 3/15

comment:9 Changed 6 years ago by shevek

@dima42: Could you make that 3/10?

comment:10 Changed 6 years ago by shevek

Additional information. To solve this you must execute the SQL attached to #1809.

comment:12 Changed 6 years ago by shevek

@dima42: Could you please rebase/merge this into develop? Thanks.

comment:15 Changed 6 years ago by shevek

  • Status changed from local_testing to to_alpha

Worked for me. State change to_alpha.

comment:16 Changed 6 years ago by shevek

  • Status changed from to_alpha to testing

comment:17 Changed 6 years ago by crumbking

Mmm I see the alpha still in English (would expect German) Tried chrome, ff and chromium on ubuntu. Cleaned all browser data.

comment:18 Changed 6 years ago by crumbking

Thought on my local version it switches perfectly to German. Maybe a server issue?

comment:19 Changed 6 years ago by sitatara

I also still see alpha.bewelcome.org in English (not German).

comment:20 Changed 6 years ago by shevek

Could you check your cookies please if you find one for bewelcome named lang?

comment:21 follow-up: Changed 6 years ago by midsch

I also get English on alpha, German on www. The only cookie from alpha / www is named sidTB

But what's much more annoying: on http://alpha.bewelcome.org/mypreferences the pulldown is always set to browser language instead of the choosen standard. So my german browser always sets it to german and if I change any other preference I end up on the german bw-page instead of the preferred english one.

So somehow we now how to choose the browser language, but we do it at the wrong place.

comment:22 in reply to: ↑ 21 Changed 6 years ago by crumbking

Replying to midsch:

I also get English on alpha, German on www. The only cookie from alpha / www is named sidTB

But what's much more annoying: on http://alpha.bewelcome.org/mypreferences the pulldown is always set to browser language instead of the choosen standard. So my german browser always sets it to german and if I change any other preference I end up on the german bw-page instead of the preferred english one.

So somehow we now how to choose the browser language, but we do it at the wrong place.

Than´t is another issue. I can't reproduce that.

@shevek: There is no cookie named lang. Checked the patch. There is a check for www. Could that be the issue? ($urlheader="www")

comment:23 Changed 6 years ago by shevek

Oh, that awful bit of code is still there? Yes, that might be the reason.

Comment out a huge area of the old code to check if that helps: https://www.gitorious.org/bewelcome/rox/commit/7d78b14905233d15102007a24efc173de5401024

(BW seems to set a cookie named LastLang? so make sure to clean caches.)

comment:24 Changed 6 years ago by dima42

@shevek: you commented out "model" which is referred to later. anyway i'm pretty sure the 'www' checking isn't it; i tried setting urlheader="alpha" and it worked fine. i haven't found the problem yet though; if i don't find it for another hour i'll submit a commit with some debug strings and hopefully someone can deploy it to alpha.

@midsch: can i get more details on how to reproduce (e.g. what your browser is, what the language settings on your browser are, what your profile default language is, what your current browsing language was)

comment:25 in reply to: ↑ 6 Changed 6 years ago by dima42

Replying to shevek:

Fix doesn't do anything as the whole function setLanguage in roxfrountrouter was never adapted to the new setup of the servers.

what is the "new setup of the servers"?

comment:26 Changed 6 years ago by midsch

This really bugs me, as it is weird and not to reproduce well, for me it looks not like an browser issue, but like related to my profile.

I'm using for test now Chromium Version 25.0.1364.160 Ubuntu 12.10 (25.0.1364.160-0ubuntu0.12.10.1) / also Firefox 19.0.2 (but with cookie management and scripts blocked), so now no testing here.

1) Starting Chromium, deleting all browser data "since the beginning of time" including cache, cookiesm website- and plug-in data löschen; auto fillin for forms is completely off; browser language is german, preferred language is german also 2) Restart browser 3) go to alpha.bewelcome.org BEFORE Login: NOW: language is german (this was different 3 hours ago; also on a Firefox 19.0.2 language is german!) -> this was, was this ticket was about and looks fixed for me now. 4) Login, afterwards to http://alpha.bewelcome.org/mypreferences - language is english (as I want to), but the pulldown for default language is set to German. 5) I can change the language and as a result this language is displayed, but the pulldown is always set to "german/duits/deutsch/niemcy/whatever" 6) logout 7) repeat 1-4 but login with another profile (made today) -> language pulldown is correctly set to English

Besides the age (the midsch profile is quite old, the other one from today), the profiles differ in translating rights for midsch (eng-ger).

I'm lost (and tired).

comment:27 Changed 6 years ago by dima42

i pushed some debug strings to develop before i read the last comment. anyway i guess this means that alpha had a different urllanguage_header database than the test database.

the comment midsch made is perhaps related to http://trac.bewelcome.org/ticket/1748#comment:60

comment:28 Changed 6 years ago by dima42

the debugging on alpha confirmed that the problem was the urllanguage_header stuff.

i hardcoded against alpha being found in the urllanguage_header lookup. but this is really a terrible solution. what really needs to happen is one of two things:

  1. the urllanguage_header database on alpha/production needs to be updated, with "www" and "alpha" removed, and then we can deal away with overriding logic hardcoded.
  1. do we even use language based subdomains? if not, we can just delete urllanguage_header code altogether.

so fixed as of https://www.gitorious.org/bewelcome/rox/commit/99a8c091557c9bc87bcbbb7cd796068c6139d2f0

(not yet redeployed on alpha, and i broke it earlier for debugging, so don't test until alpha gets redeployed)

comment:29 Changed 6 years ago by shevek

@dima: That was the new server setup I referred to, there where language subdomains at some point or they were planned, but they don't exist anymore.

comment:30 Changed 6 years ago by shevek

Patch is deployed on alpha. Please test again.

comment:31 Changed 6 years ago by midsch

For me alpha shows the prefered browser language now, tested for German and English (with Firefox, Midori, Chromium / all on [k]Ubuntu)

comment:32 Changed 6 years ago by crumbking

Tested WIN 7, IE8. Shows up in German. Will try again in the evening with FF, Chromium.

comment:33 Changed 6 years ago by crumbking

works on chrome and on FF. Please mark as fixed after you removed the debug stuff.

comment:34 Changed 6 years ago by shevek

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

Debug stuff already deleted. -> Fixed.

Note: See TracTickets for help on using tickets.