Issue Details (XML | Word | Printable)

Key: MBS-4223
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

.po files with country codes don't seem to work

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


 Description  « Hide

I can't seem to figure out how to get the .po files with country codes (e.g. fr_FR, es_ES) to work. When I rename them to remove the country, they work fine. I think the problem might be that Accept-Language sends "es-es" but the .po files use "es_ES" and it's not seeing them as equivalent.



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

The problem seems to be that Accept-Charset uses the form xx-yy whereas gettext expects xx_YY.

I hacked around that adding @avail_lang = map { s/-([a-z]{2})/\U$1/; $; } @avail_lang; in MB::S::Translation->_set_language however it's not a permanent solution because it messes up the lang tags in the HTML (which should use the same format as Accept-Language).

Then we found a very strange problem where "es" worked fine but when using the same .po file for "es-es", all the accented characters were broken. It seems that this is because there is an es_ES locale on the machine which is defined as ISO-8859-1. Adding $ENV{OUTPUT_CHARSET} = "UTF-8"; below the line in the previous paragraph fixed that.


Ian McEwen added a comment - 12/Jun/12 06:31 PM

This is in review now, along with split domains; we'll need to create a new ticket for fixing the language in the HTML output.


Oliver Charles added a comment - 25/Jun/12 10:49 AM

This is in beta testing with the origin/split-domains branch (one merge conflict addressed since Ian's branch).