summaryrefslogtreecommitdiff
path: root/docs/narr
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-04-19 07:34:46 +0000
committerChris McDonough <chrism@agendaless.com>2010-04-19 07:34:46 +0000
commitf5c6c574ada26ec0b2766f5ca20bb2b5b7393ec5 (patch)
treefdc3eba986d4e598b3455e8402f30c9a3fcc3e69 /docs/narr
parent334f4a7fff13b27d5c2be0bbe75d1507a534cbe0 (diff)
downloadpyramid-f5c6c574ada26ec0b2766f5ca20bb2b5b7393ec5.tar.gz
pyramid-f5c6c574ada26ec0b2766f5ca20bb2b5b7393ec5.tar.bz2
pyramid-f5c6c574ada26ec0b2766f5ca20bb2b5b7393ec5.zip
Dip a toe in the i18n waters.
Diffstat (limited to 'docs/narr')
-rw-r--r--docs/narr/i18n.rst36
-rw-r--r--docs/narr/views.rst5
2 files changed, 41 insertions, 0 deletions
diff --git a/docs/narr/i18n.rst b/docs/narr/i18n.rst
new file mode 100644
index 000000000..e8ad0b554
--- /dev/null
+++ b/docs/narr/i18n.rst
@@ -0,0 +1,36 @@
+.. index::
+ single: i18n
+ single: internationalization
+
+.. _i18n_chapter:
+
+Using Internationalization
+==========================
+
+Setting Up Translation
+----------------------
+
+Pass a :term:`translator factory` object to your application's
+:mod:`repoze.bfg.configuration.Configurator` by supplying it with a
+``translator_factory`` argument. A translator factory is an object
+which accepts a :term:`request` and which returns a callable. The
+callable returned by a translator factory is a :term:`translator`; it
+must accept a single positional argument which represents a
+:term:`translation string` and should return a fully expanded
+translation of the translation string.
+
+The exact operation of a translator is left to the implementor of a
+particular translation factory.
+
+Obtaining the Translator via :func:`repoze.bfg.i18n.get_translator`
+--------------------------------------------------------------------
+
+If you need to perform translation "by hand" in an application, use
+the :func:`repoze.bfg.i18n.get_translator` function to obtain a
+translator. A translator is a callable which accepts either a
+:term:`translation string` or a normal Unicode object and which
+returns a Unicode object representing the translation.
+
+XXX
+
+
diff --git a/docs/narr/views.rst b/docs/narr/views.rst
index a24e4b7b5..eebaa63de 100644
--- a/docs/narr/views.rst
+++ b/docs/narr/views.rst
@@ -840,6 +840,11 @@ In all cases, the message provided to the exception constructor is
made available to the view which :mod:`repoze.bfg` invokes as
``request.exception.args[0]``.
+.. index::
+ single: exception views
+
+.. _exception_views:
+
Exception Views
~~~~~~~~~~~~~~~~