Edgewall Software
Modify

Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#7972 closed defect (fixed)

Default language wrongly displayed as english

Reported by: jouvin@… Owned by: Stéphane Raimbault <stephane.raimbault@…>
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)

comment:1 by Christian Boos, 16 years ago

Owner: set to Christian Boos
Severity: minornormal
Status: newassigned

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

     
    536536                except ValueError:
    537537                    q = 0
    538538            langs.append((-q, code))
    539         langs.sort()
    540539        return [code for q, code in langs]
    541540
    542541    def _reconstruct_url(self):

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.

in reply to:  1 comment:2 by Christian Boos, 16 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 jouvin@…, 16 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 Christian Boos, 16 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 Christian Boos, 15 years ago

Resolution: fixed
Severity: normalminor
Status: assignedclosed

Also fixed in r8716, by Stéphane Raimbault.

comment:6 by Christian Boos, 15 years ago

Owner: changed from Christian Boos to Stéphane Raimbault <stephane.raimbault@…>

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Stéphane Raimbault <stephane.raimbault@…>.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Stéphane Raimbault <stephane.raimbault@…> to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.