Christoph Thielecke | 14 Jan 19:10
Picon

Petal bug: sub elements not translated

Hi list,

I've upgraded from 2.14 to 2.17 and the translation of substrings stops to 
work.

Here is an example:

<span i18n:translate="">Fedora Core 4 RPMs added (<a 
href="http://download.gna.org/kvpnc/kvpnc-0.8.2.1-1.fc4.i386.rpm">RPM</a>, <a 
href="http://download.gna.org/kvpnc/kvpnc-debuginfo-0.8.2.1-1.fc4.i386.rpm">Debug 
RPM</a>).</span>

will produce:

Fedora Core 4 RPMs added (${1}, ${2}).

In 2.14 the ${1} will be replaced with the first sub string (<a ...>...</a>), 
in 2.17 this wont work.

Can you fix that?

Best regards

Christoph
--

-- 
Linux User Group Wernigerode
http://www.lug-wr.de/
Bruno Postle | 17 Jan 14:26
X-Face

Re: bug: sub elements not translated (and 2.18 released)

On Sat 14-Jan-2006 at 19:10 +0100, Christoph Thielecke wrote:
>
> I've upgraded from 2.14 to 2.17 and the translation of substrings 
> stops to work.

Yes thanks for the test, this was a bug introduced into 2.16 to 
allow template designers to use text such as ${1} and ${5foo} in 
templates.

I've reverted to the old behaviour and released Petal-2.18 to CPAN, 
though it may not have yet appeared on your local mirror.

Changes since 2.17:

* $Petal::CodeGenerator::PI_RE should be applied newline 
  insensitively, petal attributes can now contain multiple lines.

* Minor pod fixes.

* Cookbook tal:repeat example (DSL)

* Pod note that on-error isn't fully implemented

* Defang html metacharacters in on-error output

* Undo 2.16 $Petal::Hash::String::VARIABLE_RE_BRACKETS ${1} regression

--

-- 
Bruno

(Continue reading)

Christoph Thielecke | 17 Jan 14:31
Picon

Re: bug: sub elements not translated (and 2.18 released)

Hello Bruno,

> > I've upgraded from 2.14 to 2.17 and the translation of substrings
> > stops to work.
>
> Yes thanks for the test, this was a bug introduced into 2.16 to
> allow template designers to use text such as ${1} and ${5foo} in
> templates.
>
> I've reverted to the old behaviour and released Petal-2.18 to CPAN,
> though it may not have yet appeared on your local mirror.
Thx a lot.

Best regards

Christoph
--

-- 
Linux User Group Wernigerode
http://www.lug-wr.de/
Jonathan | 20 Jan 22:20

bug: documentation uses unsupported (but TAL spec) modifier

I noticed this today in the petal documentation:

=======
omit-tag

Abstract

   <tag tal:omit-tag="EXPRESSION">Some contents</tag>
Example

   <b tal:omit-tag="not:bold">I may not be bold.</b>
If not:bold is evaluated as TRUE, then the <b> tag will be omited. If  
not:bold is evaluated as FALSE, then the <b> tag will stay in place.

Why?

omit-tag statements can be used to leave the contents of a tag in  
place while omitting the surrounding start and end tags if the  
expression which is evaluated is TRUE.

TIP:

If you want to ALWAYS remove a tag, you can use omit-tag="string:1"

=======

i've discussed this before, but "not:" is a TAL modifier that isn't  
in petal

i just wanted to bring this up again, as following the docs in this  
(Continue reading)

Jonathan Vanasco | 25 Jan 07:45

Re: bug: documentation uses unsupported (but TAL spec) modifier


actually, i realized a more elegant solution-

lib/Petal/Hash.pm
(  add this  line @72 )
=====
$MODIFIERS->{'not:'} = $MODIFIERS->{'false:'};
=====

that uses the same approach as the rest of Petal.  I was tired and  
didn't notice that would work earlier.

sorry for suggesting  a poor patch earlier.

Bruno Postle | 27 Jan 14:31
X-Face

Re: bug: documentation uses unsupported (but TAL spec) modifier

On Fri 20-Jan-2006 at 16:20 -0500, Jonathan wrote:
>
> i've discussed this before, but "not:" is a TAL modifier that isn't  
> in petal

> i suggest either:

> * patching petal to use not: which is in the TAL spec (patch below)
> * changing the docs from not to false

Thanks, I've added 'not:' as an alias to 'false:' in Petal::Hash.

Note that 'not:', 'string:' and 'path:' are required by TALES: 

  http://www.zope.org/Wikis/DevSite/Projects/ZPT/TALES%20Specification%201.3

So Petal is still missing 'path:'.

--

-- 
Bruno

Jonathan Vanasco | 27 Jan 17:28

Re: bug: documentation uses unsupported (but TAL spec) modifier


On Jan 27, 2006, at 8:31 AM, Bruno Postle wrote:

> Thanks, I've added 'not:' as an alias to 'false:' in Petal::Hash.
>
> Note that 'not:', 'string:' and 'path:' are required by TALES:
>  http://www.zope.org/Wikis/DevSite/Projects/ZPT/TALES% 
> 20Specification%201.3
>
> So Petal is still missing 'path:'.

I guess the first person who needs to use it gets to make the patch!

( crosses fingers and hopes thats not me )

Bruno Postle | 30 Jan 17:21

Re: bug: documentation uses unsupported (but TAL spec) modifier

Jonathan Vanasco wrote:
> 
> actually, i realized a more elegant solution-

> $MODIFIERS->{'not:'} = $MODIFIERS->{'false:'};

Yep, that's exactly what I did:

https://lists.webarch.co.uk/pipermail/mkdoc-commit/2006-January/001087.html

--

-- 
Bruno


Gmane