Stripping spaces and linebreaks from blocktrans?

2007-10-26 Thread Dmitri Fedortchenko
I've started using blocktrans in my templates and noticed that when using make_messages it includes all the tabs and linebreaks around the text that is surrounded by blocktrans tags. For example: {% blocktrans %} Translate this string {% plural %}

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-26 Thread Malcolm Tredinnick
On Fri, 2007-10-26 at 15:04 +, Dmitri Fedortchenko wrote: > I've started using blocktrans in my templates and noticed that when > using make_messages it includes all the tabs and linebreaks around the > text that is surrounded by blocktrans tags. > > For example: > {% blocktrans %}

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-26 Thread [EMAIL PROTECTED]
I would argue against ANY implicit stripping. some of us use the template system for generating things like .ics files and others for which every space counts as part of the syntax. Please don't break the pycon website calendar support ;-) -Doug On Oct 26, 7:41 pm, Malcolm Tredinnick <[EMA

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-26 Thread Malcolm Tredinnick
On Sat, 2007-10-27 at 00:57 +, [EMAIL PROTECTED] wrote: > I would argue against ANY implicit stripping. some of us use the > template system for generating things like .ics files and others for > which every space counts as part of the syntax. > > Please don't break the pycon website calendar

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-26 Thread [EMAIL PROTECTED]
Sorry, I somehow missed that. On Oct 26, 9:06 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2007-10-27 at 00:57 +, [EMAIL PROTECTED] wrote: > > I would argue against ANY implicit stripping. some of us use the > > template system for generating things like .ics files and others f

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-28 Thread Dmitri Fedortchenko
That's a great idea! I'll see if I can squeeze out a patch for this, since I feel that I want to be able to indent blocktrans without having the extra spaces in the po files (I realize one can remove the extra spaces manually in the po files, but I like consistent autogeneration hehe). In other w

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-28 Thread Malcolm Tredinnick
On Sun, 2007-10-28 at 21:46 +, Dmitri Fedortchenko wrote: > That's a great idea! I'll see if I can squeeze out a patch for this, > since I feel that I want to be able to indent blocktrans without > having the extra spaces in the po files (I realize one can remove the > extra spaces manually in

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-31 Thread Dmitri Fedortchenko
Ok I got the patch. Should I open a ticket? I attached it, but not sure if it will get through to the mailing list. I also attached a semi-comprehensive battery of tests, showing the outcome of the stripping process. Basically it strips indentation based on the indentation of the first line of t

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-31 Thread Dmitri Fedortchenko
Now that I re-read your definition, there is one difference between your suggestion and my patch. My patch just uses the first line to define the amount of whitespace to strip, while you suggest we use the shortest indentation in the whole block. Which is better? //D On 10/29/07, Malcolm Tredinn

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-31 Thread Dmitri Fedortchenko
I opened a ticket, looking forward to your input and ideas. http://code.djangoproject.com/ticket/5849 On 10/31/07, Dmitri Fedortchenko <[EMAIL PROTECTED]> wrote: > > Now that I re-read your definition, there is one difference between your > suggestion and my patch. > My patch just uses the first

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-31 Thread Malcolm Tredinnick
On Wed, 2007-10-31 at 19:17 +0100, Dmitri Fedortchenko wrote: > I opened a ticket, looking forward to your input and ideas. > > http://code.djangoproject.com/ticket/5849 Thanks. I'll get to it eventually, but it might take a week or so. I'm pretty busy right at the moment and have a few other Dj

Re: Stripping spaces and linebreaks from blocktrans?

2007-10-31 Thread Dmitri Fedortchenko
Sounds good. I'll try to clean up the patch as much as possible when I get some time too. Right now it's a little rough around the edges. //D On 11/1/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Wed, 2007-10-31 at 19:17 +0100, Dmitri Fedortchenko wrote: > > I opened a ticket, lookin