i18n of form buttons? overall i18n guidance?

30 views
Skip to first unread message

pe...@koodaamo.fi

unread,
May 4, 2015, 5:30:47 AM5/4/15
to substanc...@googlegroups.com
Hi,

I managed to i18n form schema field names and descriptions nicely just as expected per docs, but how can I i18n the button labels? Apparently simply replacing:

buttons = ("add",)

With:

buttons = (_("add", default="add"),) # etc.

does not work (for schema fields this works fine). I checked pyramid_deform & deform docs & did a bit of googling but did not find anything useful.

Any suggestions?

I also translated everything in substanced.pot (see fork by "koodaamo", pull request coming) into Finnish. 

I noticed there's a bunch of strings in the substanced management interface that are not yet translatable, or the msgid is wrong or whatever since not all (correct according to pot file) translations show up while most do. I would be happy to put in a bit work a bit on that. I can of course just go through the substanced.pot file for locations of translatables and work my way through that way, but an overview of the big picture of i18n in substanced would be helpful to start with. 

thx, Petri

Cédric Messiant

unread,
May 4, 2015, 7:02:39 AM5/4/15
to substanc...@googlegroups.com
Hi,

For the buttons, you have to use the Button class instead of the "shortcut" version (it is not well documented and I searched for long before to find the trick). Something like :

from deform. form import Button
buttons = (Button(name='add', title=_("Add")), ), etc


It may not exactly be it but I can't find an example.

Hope this helps,

Cédric




--
You received this message because you are subscribed to the Google Groups "substanced-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to substanced-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pe...@koodaamo.fi

unread,
May 4, 2015, 8:19:47 AM5/4/15
to substanc...@googlegroups.com
Thanks, it works!

Here's a link to deform.Button API docs for further details on the Button.

 Petri
Reply all
Reply to author
Forward
0 new messages