Edgewall Software
Modify

Opened 6 years ago

Last modified 6 years ago

#405 new defect

i18n:choose displays both choices when i18n is not enabled

Reported by: Martin Scharrer <martin@…> Owned by: cmlenz
Priority: major Milestone: 0.7
Component: General Version: 0.6
Keywords: i18n:choose py:choose fallback Cc: hoff.st@…

Description

I'm trying to have a i18n aware Genshi template which supports both Trac 0.11 and 0.12. It has a i18n:choose directive in it to display different user messages depending if it is singular or plural. This works fine with Genshi 0.6 and Trac 0.12. When I use Trac 0.11, which as I know does not support i18n, with the same template and the same version of Genshi, both choices are displayed, i.e. the i18n:choose and i18n:singular/i18n:plural tags seem to simple be ignored.

This should not be the case. While there will be of course no translation, the original English text should still be displayed in the correct form. The numeral argument can still be evaluated and the whole thing could simply fall-back to a py:choose directive.

As a workaround I set a i18n_enabled variable and added the arguments py:if="i18n_enabled or len(elem) == 1" and py:if="i18n_enabled or len(elem) > 1" to the i18n:singular and i18n:plural tags, respectively. This seems to be working ok with i18n enabled under Trac 0.12.

Attachments (0)

Change History (1)

comment:1 in reply to: ↑ description Changed 6 years ago by Martin Scharrer <martin@…>

Replying to Martin Scharrer <martin@…>:

As a workaround I set a i18n_enabled variable and added the arguments py:if="i18n_enabled or len(elem) == 1" and py:if="i18n_enabled or len(elem) > 1" to the i18n:singular and i18n:plural tags, respectively. This seems to be working ok with i18n enabled under Trac 0.12.

While this workaround works with Genshi it doesn't with Babels extract_messages setup command. :-(

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain cmlenz.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from cmlenz to the specified user. Next status will be 'new'.
The owner will be changed from cmlenz to anonymous. Next status will be 'assigned'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.