multiline blocktrans in django templates should use 'trimmed' option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Medium
|
Akihiro Motoki |
Bug Description
Django templates support 'trimmed' option [1]. 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.
Without 'trimmed' option, translators will get source strings with meaningless newlines and whitespaces like below. Zanata (translation check site) checks the number of newlines, so translators need to insert newlines to silent Zanata validations. It is really annoying and meaningless.
#: openstack_
msgid ""
"\n"
" The status of a volume snapshot is normally managed automatically. "
"In some circumstances\n"
" an administrator may need to explicitly update the status value. This"
" is equivalent to\n"
" the <tt>cinder snapshot-
" "
msgstr ""
By using 'trimmed' option in Django templates, we can get rid of meaningless newlines in extracted message strings.
The recent released version of django-bebal supports 'trimmed' option [2] and now we can move the situation forward.
[1] https:/
[2] https:/
Action items:
* Update g-r to have 'django- babel>= 0.5.1' because django-babel 0.5.1 adds 'trimmed' support.
* Add 'trimmed' option to blocktrans with multi-line contents.
* Update Horizon devref docs