
| Key: |
MBS-4223
|
| Type: |
Sub-task
|
| Status: |
Closed
|
| Resolution: |
Fixed
|
| Priority: |
Normal
|
| Assignee: |
Ian McEwen
|
| Reporter: |
nikki
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
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.
|
|
Description
|
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. |
Show » |
Sort Order:
|
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.