Hi Tom,

On Mon, Jan 18, 2010 at 6:17 AM, Tom Gross <itconse...@gmail.com> wrote:
> Hi all,
>
>  what is the preferred form generation tool for repoze.bfg? I tried
> chameleon.formish, which seems a nice solution.
> I found the fileupload-widget is broken, attached is a patch to fix it.
>
> This is probably the wrong list to ask about i18n support of formish, but
> since chameleon is involved the key is maybe there. I solved the
> localization issue of the form labels with the following monkey patch, but
> I'm not really happy to use monkey patches in general. does anyone know of a
> better solution?

I wouldn't argue that it's better ...

I've been using formencode which has i18n support,
formencode.validators is easy to work with, the package has minimal
html generation (formencode.htmlfill) which was a design decision.

http://formencode.org/i18n.html
http://formencode.org/Design.html

Best,
Darryl

>
> -Tom
>
> from formish.forms import Field
> from zope.i18nmessageid.message import Message
> from zope.i18n import translate
>
> @property
> def title(self):
>    title = self._orig_title
>    if isinstance(title, Message):
>        lang = getattr(self.form, 'target_language', 'en')
>        return translate(title, target_language=lang)
>    return title
>
> Field._orig_title = Field.title
> Field.title = title
>
> @property
> def description(self):
>    description = self._orig_description
>    if isinstance(description, Message):
>        lang = getattr(self.form, 'target_language', 'en')
>        return translate(description, target_language=lang)
>    return description
>
> Field._orig_description = Field.description
> Field.description = description
>
> _______________________________________________
> Repoze-dev mailing list
> Repoze-dev@lists.repoze.org
> http://lists.repoze.org/listinfo/repoze-dev
>
>
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to