File: i18n.txt

package info (click to toggle)
python-formencode 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,880 kB
  • sloc: python: 6,564; makefile: 114; sh: 8
file content (35 lines) | stat: -rw-r--r-- 1,043 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FormEncode Internationalization (gettext)
+++++++++++++++++++++++++++++++++++++++++

:author: Gregor Horvath <gh at gregor-horvath dot com> 2006

There are different translation options available:

Domain "FormEncode" 
^^^^^^^^^^^^^^^^^^^

for standalone use of FormEncode. The language to use is determined out of the local system (see gettext documentation http://docs.python.org/lib/node733.html). Optionally you can also set the language or the domain explicitly with the function.

example:
formencode.api.set_stdtranslation(domain="FormEncode", languages=["de"])

The mo files are located in the i18n subdirectory of the formencode installation.

state._
^^^^^^^
A custom _ gettext function provided as attribute of the state object.

__builtins__._
^^^^^^^^^^^^^^
A custom _ gettext function provided in the builtin namespace.
This function is only used when:

Validator.use_builtin_gettext == True (True is default)


Without translation
^^^^^^^^^^^^^^^^^^^

If no translation mechanism is found a fallback returns the plain string.