Opened 14 years ago
Last modified 8 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.9 |
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.
Change History (2)
comment:1 in reply to: ↑ description Changed 14 years ago by Martin Scharrer <martin@…>
comment:2 Changed 8 years ago by hodgestar
- Milestone changed from 0.7 to 0.9
Moved to milestone 0.9.
Replying to Martin Scharrer <martin@…>:
While this workaround works with Genshi it doesn't with Babels extract_messages setup command. :-(