Skip to content

Commit

Permalink
Merge pull request #238 from tisdall/update_docs
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
miohtama committed Dec 16, 2016
2 parents 717df75 + 4c55a4a commit 5ea6efe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
16 changes: 7 additions & 9 deletions docs/ajax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ demonstration website:
- `No redirection on validation success
<http://deformdemo.repoze.org/ajaxform/>`_

Note that for AJAX forms to work, the ``deform.js`` and
``jquery.form.js`` libraries must be included in the rendering of the
page that includes the form itself, and the ``deform.load()``
JavaScript function must be called by the rendering in order to
associate the form with AJAX. This is the responsibility of the
wrapping page. Both libraries are present in the ``static`` directory
of the :mod:`deform` package itself. See :ref:`widget_requirements`
for a way to detect which JavaScript libraries are required for a
particular form rendering.
.. note::

As with widgets, you must ensure the required JavaScript
files are included for the AJAX functionality to work. See
:ref:`widget_requirements` for a way to detect which JavaScript
libraries are required for a particular form rendering.


7 changes: 4 additions & 3 deletions docs/i18n.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Internationalization
====================

Deform is fully internationalizable and localizable. :term:`gettext`
``.mo.`` files exist in the :mod:`deform` and :mod:`colander` packages
``.mo`` files exist in the :mod:`deform` and :mod:`colander` packages
which contain (currently incomplete) translations to various languages
for the purpose of rendering localized error messages.

Expand All @@ -28,15 +28,16 @@ Following should get you started with `i18n` in :mod:`pyramid`::
deform_template_dir = resource_filename('deform', 'templates/')
zpt_renderer = deform.ZPTRendererFactory(
[deform_template_dir],
translator=translator)
translator=translator,
)
deform.Form.set_default_renderer(zpt_renderer)


See the `Internationalization demo
<http://deformdemo.repoze.org/i18n/>`_ for an example of how deform
error and status messages can be localized. This demonstration uses
the `internationalization and localization features of Pyramid
<http://docs.pylonsproject.org/projects/pyramid/en/1.0-branch/narr/i18n.html>`_
<http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/i18n.html>`_
to render Deform error messages into :term:`Chameleon` form renderings.


Expand Down

0 comments on commit 5ea6efe

Please sign in to comment.