Issue Details (XML | Word | Printable)

Key: MBS-4224
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Ian McEwen
Reporter: nikki
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MusicBrainz Server
MBS-4107

Interface not switching languages properly

Created: 21/Jan/12 10:46 AM   Updated: 09/Jul/12 07:26 AM   Resolved: 09/Jul/12 07:26 AM
Component/s: Internationalization
Affects Version/s: None
Fix Version/s: Bug fixes, 2012-07-09


 Description  « Hide

I think somehow the language to load the page with is being cached. For example, if I set Accept-Language to 'es' and load http://i18n.mbsandbox.org/ I get Spanish. If I change it to 'de' and continue browsing, everything is still in Spanish.

The same problem happens with multiple users on multiple computers - for example, if I load a page requesting German, when reosarevok loads the page requesting Spanish, he will get the interface in German.



Sort Order: Ascending order - Click to sort in descending order
nikki added a comment - 22/Jan/12 08:48 PM

Ian and I made a bit of progress:

MusicBrainz::Server::Translation->_set_language checks $ENV{LANGUAGE} and returns if it's set. If it's not, it sets it from the Accept-Language header. This means that the first person to load the page sets the variable and from there on it never changes regardless of what Accept-Language has. Commenting out the line which returns when $ENV{LANGUAGE} is already set solved that and lead us to the next problem.

By default, it tries to use the XS version of gettext. This appears to have some problems where it caches things instead of returning what you actually asked it for. Adding Locale::Messages->select_package ('gettext_pp'); to the top of MB::S::Translation fixed that.

We're still not sure that using a single $ENV{LANGUAGE} variable will actually work properly with multiple simultaneous requests. The language should probably be linked to the session instead. However the two changes mentioned at least make it possible for http://i18n.mbsandbox.org/ to work with more than one language.



Ian McEwen added a comment - 26/Jun/12 08:45 PM

Adding to appropriate fix version, split-domains fixes this.