#5849: Strip indentation and leading/trailing spaces/linebreaks from contents of
blocktrans block.
----------------------------------------------------+-----------------------
Reporter:  Dmitri Fedortchenko <[EMAIL PROTECTED]>  |       Owner:  nobody      
                
  Status:  new                                      |   Component:  Template 
system             
 Version:  SVN                                      |    Keywords:  blocktrans 
strip indentation
   Stage:  Unreviewed                               |   Has_patch:  1           
                
----------------------------------------------------+-----------------------
 The idea is to strip whitespace indentation from the contents of the
 blocktrans tag, as well as leading and trailing whitespace and linebreaks.

 Blocktrans tags allow you to split your translation strings onto multiple
 lines and this is a good feature, especially if using the "plural" mode.

 Picture this:
 {{{
 {% blocktrans number as count %}
 There is {{count}} message
 waiting for you
 {% plural %}
 There are {{count}} messages
 waiting for you
 {% endblocktrans %}
 }}}
 The biggest issue is if you indent the above block. Suddenly those msgids
 are obsolete and you need to edit all your language files....

 Indentation is often changed in HTML since you might nest that block in a
 new DIV element or whatnot, and the ability to spread the msgids along
 many lines makes for cleaner looking code.

 Furthermore, the current blocktrans tag implementation generates some ugly
 translation strings when using make-messages if you have indented your
 msgid block.
 Since most HTML is somehow indented, the above can easily look like this:
 {{{
 msgid "\n"
 "\t\t\t\t\tThere are %(count)s messages\n"
 "\t\t\t\t\twaiting for you\n"
 "\t\t\t\t\t"
 }}}

 Note the last line of tabs, since it includes the indentation of the
 "endblocktrans" tag as well.

 See this thread for more:
 http://groups.google.com/group/django-
 developers/browse_thread/thread/60f0a0ac2347c5f5

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5849>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to