Image the following blocktrans
in some Django template:
{% blocktrans %}
Some Text
{% endblocktrans %}
After some changes in the templates, you might like to indent the block:
<div>
{% blocktrans %}
Some Text
{% endblocktrans %}
</div>
This is going to change your message in the translation files, and mark them as fuzzy. While technically, it is the same message (only the indentation is different).
The whole process of "unfuzzyfying" those messages is tedious and error-prone.
What I tried so far:
trans
as much as possible - doesn't always workblocktrans
statements - hard to maintainIs there a way to make the indentation in blocktrans
insignificant?
According to the documentation here:
Another feature {% blocktrans %} supports is the trimmed option. This option will remove newline characters from the beginning and the end of the content of the {% blocktrans %} tag, replace any whitespace at the beginning and end of a line and merge all lines into one using a space character to separate them. This is quite useful for indenting the content of a {% blocktrans %} tag without having the indentation characters end up in the corresponding entry in the PO file, which makes the translation process easier.
so for example
<div>
{% blocktrans trimmed %}
Some Text
{% endblocktrans %}
</div>
will result in the entry "Some Text"
in your PO file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With