Hi Russell,

A brief example to answer your question...

On Monday, 19 August 2013 00:59:13 UTC+1, Russell Keith-Magee wrote:
>
>  
>
>> I wondered if you are using internationalisation? If so have you run into 
>> the same problems or is it easy to circumvent for you?
>>
>  
> I'm not using it myself, so can you clarify how multiline tags affects 
> internationalization?
>

Consider a basic case:
{% blocktrans with adjective=widsom.adjective animal=wisdom.animal %}The {{ 
adjective }} {{animal}} jumps over the lazy dog, lorem ipsum dolor sit 
amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut 
labore et dolore magna aliqua."{% endblocktrans %}

*(NB it causes a great deal of pain to have line breaks inside {% 
blocktrans %}; advice originally from Jacob Burch's "Gringo's Guide to 
Internationalisation 
<https://speakerdeck.com/jacob/gringos-guide-to-internationalization>" at 
DC 2012)*

If nothing else, multi-line template tags would allow the following (with 
variables on their own line) instead:
{% blocktrans with adjective=widsom.adjective animal=wisdom.animal 
%}The {{ adjective }} {{animal}} jumps over the lazy dog, lorem ipsum dolor 
sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut 
labore et dolore magna aliqua."{% endblocktrans %}
which I am by now willing to give my right arm for after two projects spent 
hunting for text in lines that span more than 1920px at 14pt.

I'm not thrilled by how this ends up looking, but surely "usable i18n" is 
at least as high a priority as "stylistic preference".

The really obvious use case for me is {% url %} — here is a verbatim line 
from a current project:
{% url 'workshop_manuscript_detail' workshop_slug=workshop.slug 
slug=manuscript.slug as url %}

I'm as much of an opinionated aesthete as the next person, but do people 
honestly prefer that over the alternative?
{% url 'workshop_manuscript_detail' 
workshop_slug=workshop.slug 
slug=manuscript.slug as url %}

As someone said earlier in the thread, making Python programmers deal with 
long lines seems like some special form of torture ;)

Cheers,

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d5476fc3-5d1b-49ef-8be9-f401b0410f7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to