List Info

Thread: Translation of egg-based products




Translation of egg-based products
country flaguser name
Germany
2008-03-18 05:52:54
So far I met two problems while trying to internationalize
my egg- 
based products for Plone 3:


Workflow
--------

I can't give a workflow an i18n_domain. Is there any way to
translate  
my custom workflow states and transitions within an
egg-based product?
I read
http://maurits.vanrees.org/weblog/ar
chive/2007/09/i18n-locales-and-plone-3.0
and
http://ww
w.mattdorn.com/content/plone-i18n-a-brief-tutorial#translati
ng-workflow-states-and-transitions

Creating an old-style product just to add these few terms to
the plone  
i18n domain seems to be the only solution.


Form Controller Tool
--------------------

In one of my products I'm using the Form Controller Tool
because  
zope.formlib (resp. plone.app.forms) seems to be unable to
handle  
validation in an appropriate way when it comes to
interdependent fields.
I'm creating a custom join_form. In the original it is

     from Products.CMFPlone import PloneMessageFactory as _

In my egg-based product I tried to replace it with

     from mynamespace.myproduct import MyMessageFactory as
_

but this gives me an "Insufficient Privileges".
Why? Is there a way to  
do the translation within my own product and domain?


Martin

------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Plone-i18n mailing list
Plone-i18nlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-i18n

Re: Translation of egg-based products
country flaguser name
Norway
2008-03-18 06:04:49
Hi.

Martin Stadler wrote:
> So far I met two problems while trying to
internationalize my egg- 
> based products for Plone 3:
> 
> Workflow
> --------
> 
> I can't give a workflow an i18n_domain. Is there any
way to translate  
> my custom workflow states and transitions within an
egg-based product?
> I read
> http://maurits.vanrees.org/weblog/ar
chive/2007/09/i18n-locales-and-plone-3.0
> and
> http://ww
w.mattdorn.com/content/plone-i18n-a-brief-tutorial#translati
ng-workflow-states-and-transitions
> 
> Creating an old-style product just to add these few
terms to the plone  
> i18n domain seems to be the only solution.

Yes, this is correct. The Zope3 translation machinery which
handles 
locales folders is not able to work with po files for the
same domain 
spread over multiple packages. So the plone domain is either
claimed by 
PloneTranslations (which it probably should) or by your
package. I think 
this situation won't change before Plone 4.0 at this point.

> Form Controller Tool
> --------------------
> 
> In one of my products I'm using the Form Controller
Tool because  
> zope.formlib (resp. plone.app.forms) seems to be unable
to handle  
> validation in an appropriate way when it comes to
interdependent fields.
> I'm creating a custom join_form. In the original it is
> 
>      from Products.CMFPlone import PloneMessageFactory
as _
> 
> In my egg-based product I tried to replace it with
> 
>      from mynamespace.myproduct import MyMessageFactory
as _
> 
> but this gives me an "Insufficient
Privileges". Why? Is there a way to  
> do the translation within my own product and domain?

If you want to allow the MessageFactory to be used in
trusted code, you 
have to allow access to it.

Some code along the lines of:

from AccessControl import ModuleSecurityInfo

ModuleSecurityInfo('mynamespace.myproduct').declarePublic('M
yMessageFactory')

should work if you declare the MyMessageFactory in your
packages 
__init__.py.

HTH,
Hanno


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Plone-i18n mailing list
Plone-i18nlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-i18n

Re: Translation of egg-based products
country flaguser name
Germany
2008-03-18 06:18:26
Am 18.03.2008 um 12:04 schrieb Hanno Schlichting:

> Hi.
>
> Martin Stadler wrote:
>> So far I met two problems while trying to
internationalize my egg-
>> based products for Plone 3:
>>
>> Workflow
>> --------
>>
>> I can't give a workflow an i18n_domain. Is there
any way to translate
>> my custom workflow states and transitions within an
egg-based  
>> product?
>> I read
>> http://maurits.vanrees.org/weblog/ar
chive/2007/09/i18n-locales-and-plone-3.0
>> and
>> http://ww
w.mattdorn.com/content/plone-i18n-a-brief-tutorial#translati
ng-workflow-states-and-transitions
>>
>> Creating an old-style product just to add these few
terms to the  
>> plone
>> i18n domain seems to be the only solution.
>
> Yes, this is correct. The Zope3 translation machinery
which handles
> locales folders is not able to work with po files for
the same domain
> spread over multiple packages. So the plone domain is
either claimed  
> by
> PloneTranslations (which it probably should) or by your
package. I  
> think
> this situation won't change before Plone 4.0 at this
point.

Is there a reason why it is impossible to use my own i18n
domain in my  
workflow as I can in ATConentTypes? I don't see why the
state and  
transition terms of my product go into the plone domain. If
it were  
possible there wouldn't be the need to combine different
domains in  
one egg.


>> Form Controller Tool
>> --------------------
>>
>> In one of my products I'm using the Form Controller
Tool because
>> zope.formlib (resp. plone.app.forms) seems to be
unable to handle
>> validation in an appropriate way when it comes to
interdependent  
>> fields.
>> I'm creating a custom join_form. In the original it
is
>>
>>     from Products.CMFPlone import
PloneMessageFactory as _
>>
>> In my egg-based product I tried to replace it with
>>
>>     from mynamespace.myproduct import
MyMessageFactory as _
>>
>> but this gives me an "Insufficient
Privileges". Why? Is there a way  
>> to
>> do the translation within my own product and
domain?
>
> If you want to allow the MessageFactory to be used in
trusted code,  
> you
> have to allow access to it.
>
> Some code along the lines of:
>
> from AccessControl import ModuleSecurityInfo
>
> ModuleSecurityInfo 
>
('mynamespace.myproduct').declarePublic('MyMessageFactory')
>
> should work if you declare the MyMessageFactory in your
packages
> __init__.py.

Yes I do and this works. Thanks very much!


> HTH,
> Hanno


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Plone-i18n mailing list
Plone-i18nlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-i18n

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )