Issue Details (XML | Word | Printable)

Key: MBS-4853
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Ian McEwen
Reporter: Kuno Woudt
Votes: 0
Watchers: 0
Operations

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

$ENV{LANGUAGE} shouldn't end up in xml:lang and lang attributes.

Created: 07/Jun/12 06:31 PM   Updated: 06/Aug/12 09:58 AM   Resolved: 06/Aug/12 09:58 AM
Component/s: Internationalization
Affects Version/s: Bug fixes, 2012-05-28
Fix Version/s: Bug fixes, 2012-08-06


 Description  « Hide

The server by default sets the xml:lang and lang attributes of the <html> element to the the value of $ENV{LANGUAGE}. The LANGUAGE environment variable contains a colon separated list of POSIX locales. The xml:lang and lang attributes contain a BCP47 language code (aka an IETF language tag).

It isn't clear to me how different POSIX and BCP47 language codes are, but xml:lang and lang certainly do not allow a colon separated list. Considering that usually the user running the server is not the user interacting with the software, I think the musicbrainz server should ignore the LANGUAGE environment variable set by the user entirely.



Sort Order: Ascending order - Click to sort in descending order
nikki added a comment - 07/Jun/12 08:18 PM

Hm? On musicbrainz.org I see xml:lang="en" lang="en" and on i18n.mbsandbox.org I see xml:lang="en_AQ" lang="en_AQ", no colons (or semicolons) anywhere...

AFAIK the main difference between the POSIX and BCP 47 ones (for our needs) is that the former use underscores where the latter uses a dash, i.e. en_AQ should be en-AQ - http://www.w3.org/International/articles/language-tags/


Ian McEwen added a comment - 07/Jun/12 08:53 PM

The steps to fix this are:

a.) set $ENV{LANGUAGE} to en by default within the server, to overwrite any system-set variable – this solves the colon-separated-list problem.
b.) munge the format of $ENV{LANGUAGE} to BCP 47, presumably by s/_/-/g


Kuno Woudt added a comment - 11/Jun/12 02:43 PM

@nikki, on my local machine I have LANGUAGE=fy_NL:en_GB and LANG=en_GB.UTF-8. so the full "fy_NL:en_GB" now ends up in the xml:lang attribute when I run the server under my user account – which shouldn't happen.