Re: [Zope3-Users] PT, i18n and dynamic attributes...how to?

2007-02-02 Thread Marius Gedminas
On Fri, Feb 02, 2007 at 08:20:42AM +0100, Sascha Ottolski wrote:
> Sure. It might very well be my stupidity, but up to now I couldn't find a 
> solution to this problem. Note that it's not solved like most examples would 
> suggest with
> 
> 
>   Hi, please  i18n:name="click">click here!
> 
> 
> cause that would replace the whole  tag, so the tal:attributes gets lost 
> (and none of the docs I've seen so far has got an example for my case). If 
> I'm not mistaken, that would result in
> 
> msgid="Hi, please ${click} here!"
> 
> which is certainly not what I want.

How about

  
Hi, please click here!
  

?

That should give you two msgids:

Hi, please $click here!

and

click

.

Marius Gedminas
-- 
Life was simple before World War II. After that, we had systems.
-- Grace Murray Hopper, 1987


signature.asc
Description: Digital signature
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] PT, i18n and dynamic attributes...how to?

2007-02-02 Thread David Johnson
I'm very experienced at this stuff myself, I must admit.  However it  
seems Stephan's online book discusses it here: http://wiki.zope.org/ 
zope3/webgui.html in the later part of the chapter.


--
David
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] PT, i18n and dynamic attributes...how to?

2007-02-01 Thread Sascha Ottolski
On Thursday 01 February 2007 23:35:54 you wrote:
> Are you new to Zope?  

not quite.


> If I understand correctly, yes it is possible 
> and Zope does an excellent job with this.

would you mind sharing a working example?


> Both Zope books are particularly good in explaining this.  Have you referred 
> to either?

Sure. It might very well be my stupidity, but up to now I couldn't find a 
solution to this problem. Note that it's not solved like most examples would 
suggest with


  Hi, please click here!


cause that would replace the whole  tag, so the tal:attributes gets lost 
(and none of the docs I've seen so far has got an example for my case). If 
I'm not mistaken, that would result in

msgid="Hi, please ${click} here!"

which is certainly not what I want.


Cheers, Sascha

>
> On Feb 1, 2007, at 5:51 PM, Sascha Ottolski wrote:
> > Hi,
> >
> > I'm wondering if there is a proper solution to a common problem:
> > translating a page template with dynamic attributes. If I put
> > something
> > like
> >
> > 
> >   Hi, please click
> > here!
> > 
> >
> > in a page template, this wouldn't be translated properly, cause it
> > ends
> > in a msgid like
> >
> > msgid="Hi, please click here!"
> >
> > Therefore I end up writing
> >
> > 
> >
> > class MyView:
> >
> > def renderLink(self):
> > return _('Hi, please click here!',
> > mapping={'href': self.click_url()}
> >
> > to get a msgid that reads
> >
> > msgid="Hi, please click here!"
> >
> > Isn't there a way to express the same in the PT alone? Or should the
> > first example do the trick, and it should be considered a bug that it
> > doesn't?
> >
> >
> > Thanks, Sascha
> >
> > --
> > Lalisio GmbH  www.lalisio.com
> >
> > Puschkinstraße 1 fon +49-(0)361/541 43 80
> > 99084 Erfurt fax +49-(0)361/541 43 79
> >   [EMAIL PROTECTED]
> > ___
> > Zope3-users mailing list
> > Zope3-users@zope.org
> > http://mail.zope.org/mailman/listinfo/zope3-users




Mit freundlichen Grüssen,

Sascha Ottolski

-- 
Lalisio GmbH                            www.lalisio.com

Puschkinstraße 1                   fon +49-(0)361/541 43 80
99084 Erfurt                       fax +49-(0)361/541 43 79
                                       [EMAIL PROTECTED]
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] PT, i18n and dynamic attributes...how to?

2007-02-01 Thread David Johnson
Are you new to Zope?  If I understand correctly, yes it is possible  
and Zope does an excellent job with this.  Both Zope books are  
particularly good in explaining this.  Have you referred to either?


On Feb 1, 2007, at 5:51 PM, Sascha Ottolski wrote:


Hi,

I'm wondering if there is a proper solution to a common problem:
translating a page template with dynamic attributes. If I put  
something

like


  Hi, please click  
here!



in a page template, this wouldn't be translated properly, cause it  
ends

in a msgid like

msgid="Hi, please click here!"

Therefore I end up writing



class MyView:

def renderLink(self):
return _('Hi, please click here!',
mapping={'href': self.click_url()}

to get a msgid that reads

msgid="Hi, please click here!"

Isn't there a way to express the same in the PT alone? Or should the
first example do the trick, and it should be considered a bug that it
doesn't?


Thanks, Sascha

--
Lalisio GmbH  www.lalisio.com

Puschkinstraße 1 fon +49-(0)361/541 43 80
99084 Erfurt fax +49-(0)361/541 43 79
  [EMAIL PROTECTED]
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users