Edgewall Software
Modify

Opened 8 years ago

Closed 8 years ago

#12582 closed defect (invalid)

Wrong label override set into mainnav when not logged-in

Reported by: thomas.khyn_trac@… Owned by:
Priority: normal Milestone:
Component: general Version: 1.0.12
Severity: normal Keywords: mainnav i18n
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Jun Omae)

Hello,

I have noticed that when using:

[mainnav]
wiki.label = Home

and visiting any trac as an anonymous user, the result was a button names Homeiki. The override works fine once logged in.

I've tracked it down to the fact that when logged-in, _gettext here returned the translated string (which is correctly replaced afterwards), instead of a LazyProxy when not logged-in with no active translation (= when only the first letter is replaced).

Then, when the node is added to the parent Element (this happens here), the node is not recognized as a Stream, Element, basestring, int, float or long and is therefore iterated over, adding 'W', 'i', 'k' and 'i' instead of 'Wiki'.

At line 799 of chrome.py (here), only the first element (the 'W') is then replaced by the override. Hence the final result 'Homeiki' …

Note: this happens using Genshi 0.7

Even if that does not seem to be a big issue, I don't really know how that could be solved without creating an undesirable coupling between Trac and Genshi …

Attachments (0)

Change History (2)

comment:1 by Jun Omae, 8 years ago

Component: web frontendgeneral
Description: modified (diff)

This issue cannot be reproduced on my environment.

I guess one of installed plugins leads it. Please post System Information and Installed Plugins in your About Trac page.

comment:2 by Thomas Khyn <thomas.khyn_trac@…>, 8 years ago

Resolution: invalid
Status: newclosed

Hi Jun, thanks for the quick reply and for your suggestion that it might come from a plugin.

I indeed use a custom auth plugin that, at some point, raised a TracError when no authenticated user could be found. I guess trac could not complete the translation initialization because of that.

Sorry for bothering you about that, as it's a side-effect of my plugin's behavior. I'm closing this as invalid, then. In case you'd want to handle the particular situation exposed in this ticket (namely TracError raised while authenticating) just reopen it!

Thanks again

Modify Ticket

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