mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #5849 -- Strip whitespace from blocktrans
Add the trimmed option to the blocktrans tag to trim any newlines and whitespace from its content. This allows the developer to indent the blocktrans tag without adding new lines and whitespace to the msgid in the PO file. Thanks to mpessas for the initial patch and Dmitri Fedortchenko for the report.
This commit is contained in:
committed by
Anssi Kääriäinen
parent
30203a0dea
commit
7a7c789d5a
@@ -342,6 +342,15 @@ Internationalization
|
||||
still read from in 1.7. Sessions will be migrated to the new ``_language``
|
||||
key as they are written.
|
||||
|
||||
* The :ttag:`blocktrans` now supports a ``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.
|
||||
|
||||
Management Commands
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user