Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#7973 closed enhancement (fixed)

Add a few debug messages about locale selection

Reported by: jouvin@… Owned by: Christian Boos
Priority: normal Milestone: 0.12
Component: i18n Version: 0.12dev
Severity: normal Keywords: babel
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I spent quite a lot of time to get I18N working because Babel is installed in a non standard location and it was not found by Trac. Unfortunatly, Trac is silent when it doesn't found Babel and it had been difficult to understand what whas the pb and after Babel was found, why it was not working…

I'd suggest to add a few debug message about locale selection. Attached is a proposed patch to trac/web/main.py.

Michel

Attachments (2)

main.py.patch (690 bytes ) - added by anonymous 15 years ago.
t7973-Locale-negotiation-r7795.diff (2.7 KB ) - added by Christian Boos 15 years ago.
Improve diagnostics when Babel package is not found and add a debug message for Locale negotiation.

Download all attachments as: .zip

Change History (7)

by anonymous, 15 years ago

Attachment: main.py.patch added

comment:1 by Christian Boos, 15 years ago

Keywords: babel added

Ok, but the second log.debug about Babel not found should rather be done once in some place, next to the code to report Babel version, something like:

  • trac/web/chrome.py

     
    354354        try:
    355355            import babel
    356356            babel_version = get_pkginfo(babel).get('version')
    357             self.env.systeminfo.append(('Babel', babel_version))
    358         except ImportError:
    359             pass
     357        except ImportError, e:
     358            self.log.debug("Babel not found: %s", exception_to_unicode(e))
     359            babel_version = '-'
     360        self.env.systeminfo.append(('Babel', babel_version))
    360361
    361362    # IEnvironmentSetupParticipant methods

(untested)

comment:2 by Christian Boos, 15 years ago

Owner: set to Christian Boos
Status: newassigned
Version: none0.12dev

Can you please test the above patch? Thanks.

comment:3 by Christian Boos, 15 years ago

Wait, the sorting bug is actually more subtle.

by Christian Boos, 15 years ago

Improve diagnostics when Babel package is not found and add a debug message for Locale negotiation.

comment:4 by jouvin@…, 15 years ago

Thanks, it works (for the debugging message, not for #7972).

comment:5 by Christian Boos, 15 years ago

Resolution: fixed
Status: assignedclosed

Committed in r8099.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.