Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 65 lines (44 sloc) 1.159 kB
5046ea4 @mcdonc first cut (one test still fails)
mcdonc authored
1 .. _translationdir_directive:
2
3 ``translationdir``
4 ------------------
5
6 Add a :term:`gettext` :term:`translation directory` to the current
7 configuration for use in localization of text.
8
9 Attributes
10 ~~~~~~~~~~
11
12 ``dir``
13 The path to the translation directory. This path may either be 1)
14 absolute (e.g. ``/foo/bar/baz``) 2) Python-package-relative
15 (e.g. ``packagename:foo/bar/baz``) or 3) relative to the package
16 directory in which the ZCML file which contains the directive
17 (e.g. ``foo/bar/baz``).
18
19 Example 1
20 ~~~~~~~~~
21
22 .. code-block:: xml
23 :linenos:
24
25 <!-- relative to configure.zcml file -->
26
27 <translationdir
28 dir="locale"
29 />
30
31 Example 2
32 ~~~~~~~~~
33
34 .. code-block:: xml
35 :linenos:
36
37 <!-- relative to another package -->
38
39 <translationdir
40 dir="another.package:locale"
41 />
42
43 Example 3
44 ~~~~~~~~~
45
46 .. code-block:: xml
47 :linenos:
48
49 <!-- an absolute directory name -->
50
51 <translationdir
52 dir="/usr/share/locale"
53 />
54
55 Alternatives
56 ~~~~~~~~~~~~
57
58 Use :meth:`pyramid.config.Configurator.add_translation_dirs`
59 method instance during initial application setup.
60
61 See Also
62 ~~~~~~~~
63
64 See also :ref:`activating_translation`.
Something went wrong with that request. Please try again.