Crissi | 5 Feb 22:48
Picon
Picon

Petal problem

Hello list,

I wrote a small program which use Petal. It convertes  a file with given 
language code to a new file which is translated.

But it fails on a html file which is correct xml and i could not find a 
mistake for use of Petal. It fails only on that file other files will be 
processed successfully.

I found the reason, the translated text is:
-- snip --
(for example: ${1}) 
-- snap --

I think this is a bug. If yes, could someone fix it?

the output is:

 ./create_localized_html.pl de_DE /home/crissi/testout 
i18n_with_tal_and_perl.html i18n_with_tal_and_perl.html
[PETAL ERROR] bad syntax for Petal::Hash::Var: 1 ($path) 
at /usr/local/share/perl/5.8.4/Petal/Hash/Var.pm line 38
        Petal::Hash::Var::process('Petal::Hash::Var', 
'Petal::Hash=HASH(0x845ee10)', 1) called 
at /usr/local/share/perl/5.8.4/Petal/Hash.pm line 186
        Petal::Hash::fetch('Petal::Hash=HASH(0x845ee10)', 1) called 
at /usr/local/share/perl/5.8.4/Petal/Hash.pm line 167
        Petal::Hash::__FETCH('Petal::Hash=HASH(0x845ee10)', 1) called 
at /usr/local/share/perl/5.8.4/Petal/Hash.pm line 117
        Petal::Hash::get('Petal::Hash=HASH(0x845ee10)', 1) called 
(Continue reading)

Crissi | 5 Feb 22:56
Picon
Picon

Re: Petal problem

Hello list,

I forgot something...

> I found the reason, the translated text is:
> -- snip --
> (for example: ${1})
> -- snap --
This is the text wich in the html file and should be parsed...

greetings

Christoph

Bruno Postle | 7 Feb 01:25
X-Face

Re: Petal problem

On Sat 05-Feb-2005 at 22:48 +0100, Crissi wrote:
>
> But it fails on a html file which is correct xml and i could not 
> find a mistake for use of Petal. It fails only on that file other 
> files will be processed successfully.
>
> I found the reason, the translated text is:
> -- snip --
> (for example: ${1})
> -- snap --

I'm not sure I know what you mean, could you provide a longer piece 
of XML, or attach a file that causes Petal to fail?

--

-- 
Bruno

Picon

Re: Petal problem

Am Montag, 7. Februar 2005 01:25 schrieb Bruno Postle:
> On Sat 05-Feb-2005 at 22:48 +0100, Crissi wrote:
> > But it fails on a html file which is correct xml and i could not
> > find a mistake for use of Petal. It fails only on that file other
> > files will be processed successfully.
> >
> > I found the reason, the translated text is:
> > -- snip --
> > (for example: ${1})
> > -- snap --
>
> I'm not sure I know what you mean, could you provide a longer piece
> of XML, or attach a file that causes Petal to fail?
I made a howto which describes howto use petal for translating webpages. In 
the XHTML file I wrote:

-- snip --
Attention: If text which should be translated contains other tags you will get 
a reference instead of the tag (for example: ${1}).
-- snap --

If the "${1}" is in the text the parser fails.

Could you proove it?

greetings

Christoph
--

-- 
Linux User Group Wernigerode
(Continue reading)

Josh Narins | 8 Feb 21:43

Another simple question, concatenation

I've got my dynamic includes working, I used the Petal::Hash::Include
method, thanks for all the help.

Now I am working with petal:attribute

I have a variable, the server name, stored in a hash.  But I want to add
a constant string to the end of the variable, sorta like this...

<form method="GET" action="https://" 
     petal:attributes="action c/SROOT + '/path' " />

But that doesn't work.

Any ideas?

TIA,
Josh

--

-- 
xplanet -body earth -transpng a.png -geometry "300x300-0+0" -origin sun
My politics : http://satp.blogspot.com
Programmer
Josh Narins | 8 Feb 21:45

Re: Recap on utf8 encoding issues and PerlIO patch

> > > (after eliminating the issue of the browser trying to display utf8
> > > as Western ISO-8859-1)
> > 
> > We have discovered that browsers sometimes do this even when
> > presented with all the right hints.  We currently put this <snip>
> 
> To add another tip to the bucket, I've discovered that even though I
> have Apache setup with 'AddDefaultCharset utf-8', I would get
> dynamically generated webpages coming through with the charset set to
> ISO-8859-1. It turns out that if you are using CGI.pm to create queries,
> it automatically defaults to this charset (aka, latin1).
> 
> This situation leads to a couple of options when using Petal with
> CGI.pm:

<message source="mod_perl community">
Please don't use CGI.pm
</message>

--

-- 
xplanet -body earth -transpng a.png -geometry "300x300-0+0" -origin sun
My politics : http://satp.blogspot.com
Programmer
Fergal Daly | 8 Feb 21:49
Picon

Re: Another simple question, concatenation

On Tue, Feb 08, 2005 at 03:43:48PM -0500, Josh Narins wrote:
> I've got my dynamic includes working, I used the Petal::Hash::Include
> method, thanks for all the help.
> 
> Now I am working with petal:attribute
> 
> I have a variable, the server name, stored in a hash.  But I want to add
> a constant string to the end of the variable, sorta like this...
> 
> <form method="GET" action="https://" 
>      petal:attributes="action c/SROOT + '/path' " />
> 
> But that doesn't work.
> 
> Any ideas?

"action string:${c/SROOT}/path"

should do what you want,

Fergal

William McKee | 8 Feb 21:53
Favicon

Re: Another simple question, concatenation

On Tue, Feb 08, 2005 at 03:43:48PM -0500, Josh Narins wrote:
> I've got my dynamic includes working, I used the Petal::Hash::Include
> method, thanks for all the help.

Glad to hear that method works. Could you show me the code you ended up
using so I can have examples for adding include: modifier to
Petal::Utils.

> <form method="GET" action="https://" 
>      petal:attributes="action c/SROOT + '/path' " />

Try this (assuming c/SROOT is an assigned value; I'm not entirely sure
about the {} around the variable name):

 <form method="GET" action="https://" 
      petal:attributes="string:action ${c/SROOT}/path" />

William

--

-- 
Knowmad Services Inc.
http://www.knowmad.com

William McKee | 8 Feb 21:58
Favicon

Re: Recap on utf8 encoding issues and PerlIO patch

On Tue, Feb 08, 2005 at 03:45:36PM -0500, Josh Narins wrote:
> <message source="mod_perl community">
> Please don't use CGI.pm
> </message>

Why the plea? It's been a pretty stable, albeit beastly, module in my
experience (sans my recent problem with it setting a default charset
which doesn't seem to out-of-sorts since it is generating a response
header).

Anyhow, my scripts live between mod_cgi and Apache::Registry so I'm
living with it for now. Do you have other suggestions (besides rewriting
my code as mod_perl modules)?

William

--

-- 
Knowmad Services Inc.
http://www.knowmad.com

William McKee | 8 Feb 22:00
Favicon

Re: Another simple question, concatenation

On Tue, Feb 08, 2005 at 03:53:53PM -0500, William McKee wrote:
> Try this (assuming c/SROOT is an assigned value; I'm not entirely sure
> about the {} around the variable name):

Doh! Use Fergal's example. I mistakenly put the 'action' attribute
inside the string: modifier.

William

--

-- 
Knowmad Services Inc.
http://www.knowmad.com


Gmane