#7972 closed defect (fixed)
Default language wrongly displayed as english
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | normal | Milestone: | 0.12 | 
| Component: | i18n | Version: | none | 
| Severity: | minor | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
In trunk r7788, when opening the language panel in preferences in a browser where the preferred language is defined to french, the popup list wrongly displays "langage par défaut (anglais)" ("default language (english)"), even though french is actually the selected language/locale used by Trac.
Michel
Attachments (0)
Change History (6)
follow-up: 2 comment:1 by , 17 years ago
| Owner: | set to | 
|---|---|
| Severity: | minor → normal | 
| Status: | new → assigned | 
comment:2 by , 17 years ago
Replying to cboos:
… req.languages shouldn't be sorted but should rather keep the ordering given in the Accept-Language header
The problem was actually that sort didn't keep the original order in case of a tie on the quality coefficient. See attachment:t7973-Locale-negotiation-r7795.diff:ticket:7973.
comment:3 by , 17 years ago
With the patch the problem remains the same for me. Tested with 2 different browsers:
- IE : FR is the only language. From the project log:
2009-01-15 13:58:41,113 Trac[main] DEBUG: Negociated locale: ['fr'] -> fr_FR
 
- Opera : several languages. From the project log:
2009-01-15 14:02:12,782 Trac[main] DEBUG: Negociated locale: ['fr-fr', 'fr', 'en'] -> fr_FR
 
Michel
comment:4 by , 17 years ago
Well yes, that patch doesn't fix the ("default language (english)") issue, only the other locale negotiation problem I discovered while checking this issue… (hope this clarifies).
comment:5 by , 16 years ago
| Resolution: | → fixed | 
|---|---|
| Severity: | normal → minor | 
| Status: | assigned → closed | 
Also fixed in r8716, by Stéphane Raimbault.
comment:6 by , 16 years ago
| Owner: | changed from to | 
|---|



  
You're right - verifying this one actually made me try the default language negotiation code and I found a nice bug: req.languages shouldn't be sorted but should rather keep the ordering given in the Accept-Language header.
trac/web/api.py
langs.sort()Back to the point: I think there should be a note on the Language preference tab specifying that the "default language" corresponds to the language which was set in the browser preferences, and not to a server setting or (as I thought) to the English language.