Opened 15 years ago
Closed 15 years ago
#15674 closed (invalid)
Error using {% blocktrans %} with variable and {% plural %}
| Reported by: | anonymous | Owned by: | nobody | 
|---|---|---|---|
| Component: | Internationalization | Version: | dev | 
| Severity: | Keywords: | blocktrans, template, plural, i18n | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
I need to print a value of one variable, and the translation depends on another variable. I tried the following code:
{% blocktrans with all_count|num_delimiter as amount count all_count as years %}
    cost $ {{ amount }} per year.
{% plural %}
    cost $ {{ amount }} per {{ years }} years.
{% endblocktrans %}
It works. But I can't use only one variable:
{% blocktrans with all_count|num_delimiter as amount count all_count as years %}
    take $ {{ amount }} per year.
{% plural %}
    take $ {{ amount }} per some years.
{% endblocktrans %}
It displays the value of a amount variable, but does not translate text.
  Note:
 See   TracTickets
 for help on using tickets.
    
The problem was in "fuzzy" flag inside .mo file.