Optional line number in the occurrences column

Useful when the line number is omitted in the comment lines in language 
files using makemessages with --add-location=file.
https://docs.djangoproject.com/en/stable/ref/django-admin/#cmdoption-makemessages-add-location
This commit is contained in:
Paolo Melchiorre 2018-12-19 16:16:50 +01:00
parent 710da65f04
commit a8305f4d22

View file

@ -130,7 +130,7 @@
</td>
<td class="location">
{% for fn,lineno in message.occurrences %}
<code{% if forloop.counter|gt:"3" %} class="hide"{% endif %}>{{ fn }}:{{lineno}}</code>
<code{% if forloop.counter|gt:"3" %} class="hide"{% endif %}>{{ fn }}{% if lineno %}:{{lineno}}{% endif %}</code>
{% endfor %}
{% if message.occurrences|length|gt:"3" %}
<a href="#">&hellip; ({% blocktrans count message.occurrences|length|minus:"3" as more_count %}{{more_count}} more{% plural %}{{more_count}} more{% endblocktrans %})</a>