[Plone-developers] Translating plone.app.querystring registry entries

3 views
Skip to first unread message

Eric Steele

unread,
Mar 24, 2012, 2:12:54 AM3/24/12
to Plone Developers List

As a part of (4.2 blocker) https://dev.plone.org/ticket/12377, we need to translate the criteria dropdowns. The values for each field are stored in the registry thusly:

    <records interface="plone.app.querystring.interfaces.IQueryOperation"
             prefix="plone.app.querystring.operation.date.between">
        <value key="title">Between dates</value>
        <value key="description">Please use YYYY/MM/DD.</value>
        <value key="operation">plone.app.querystring.queryparser._between</value>
        <value key="widget">DateRangeWidget</value>
    </records>


What are our options for turning this into something we can properly translate?


David Glick

unread,
Mar 25, 2012, 2:41:49 AM3/25/12
to plone-de...@lists.sourceforge.net
I added support for i18n:translate in the plone.app.registry import handler and added (empty) i18n:translate attributes to the relevant records in plone.app.querystring's registry.xml. I think that should take care of it.

We probably need an upgrade step for instances that already have an older plone.app.querystring.

David

 

David Glick
Web Developer
david...@groundwire.org
206.286.1235x32

The NPO Engagement Party 2012. So much more fun than the wedding reception.


Laurence Rowe

unread,
Mar 25, 2012, 1:51:06 PM3/25/12
to David Glick, plone-de...@lists.sourceforge.net
On 25 March 2012 07:41, David Glick <david...@groundwire.org> wrote:
>
> On 3/23/12 11:12 PM, Eric Steele wrote:
>
>
> As a part of (4.2 blocker) https://dev.plone.org/ticket/12377, we need to
> translate the criteria dropdowns. The values for each field are stored in
> the registry thusly:
>
>     <records interface="plone.app.querystring.interfaces.IQueryOperation"
>              prefix="plone.app.querystring.operation.date.between">
>         <value key="title">Between dates</value>
>         <value key="description">Please use YYYY/MM/DD.</value>
>         <value
> key="operation">plone.app.querystring.queryparser._between</value>
>         <value key="widget">DateRangeWidget</value>
>     </records>
>
>
> What are our options for turning this into something we can properly
> translate?
>
>
> I added support for i18n:translate in the plone.app.registry import
> handler and added (empty) i18n:translate attributes to the relevant records
> in plone.app.querystring's registry.xml. I think that should take care of
> it.
>
> We probably need an upgrade step for instances that already have an older
> plone.app.querystring.

Translating the strings on the way into the persistent registry seems
like it might be the wrong approach here some sites use multiple
languages. Shouldn't the terms be translated on the way out instead?

Laurence

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Plone-developers mailing list
Plone-de...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-developers

David Glick

unread,
Mar 25, 2012, 2:12:34 PM3/25/12
to Laurence Rowe, plone-de...@lists.sourceforge.net
I think you misunderstood. zope.i18nmessageid Messages are stored when
the records are imported, but not translated then. They are not
translated until they make it into a template or are manually translated
using zope.i18n.translate

David


----------

David Glick
Web Developer
david...@groundwire.org
206.286.1235x32

The Engagement Party 2012. So much more fun than the wedding reception.

http://www.npoengagementparty.com

Reply all
Reply to author
Forward
0 new messages