Opened 4 years ago

Closed 4 years ago

#15674 closed (invalid)

Error using {% blocktrans %} with variable and {% plural %}

Reported by: anonymous Owned by: nobody
Component: Internationalization Version: master
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: UI/UX:

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.

Change History (1)

comment:1 Changed 4 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

The problem was in "fuzzy" flag inside .mo file.

Note: See TracTickets for help on using tickets.
Back to Top