@view_config(renderer="templates/form.pt", name="richtext_i18n")
@demonstrate("Rich Text Widget (internationalized)")
def richtext_i18n(self):
locale_name = get_locale_name(self.request)
class Schema(colander.Schema):
text = colander.SchemaNode(
colander.String(),
widget=deform.widget.RichTextWidget(),
description=_("Enter some text"),
)
_LOCALE_ = colander.SchemaNode(
colander.String(),
widget=deform.widget.HiddenWidget(),
default=locale_name,
)
schema = Schema()
form = deform.Form(
schema, buttons=[deform.Button("submit", _("Submit"))]
)
return self.render_form(form, is_i18n=True)