Internationalization
====================
Forms are fully internationalized. The field names, descriptions,
labels, and hints are all automatically translated if they are made
i18n messages in the schema.
Let's take this simple add form...
>>> print http(r"""
... GET /+/addfieldcontent.html HTTP/1.1
... Authorization: Basic mgr:mgrpw
... """, handle_errors=False)
HTTP/1.1 200 Ok
...
with an error...
>>> print http(r"""
... POST /+/addfieldcontent.html HTTP/1.1
... Authorization: Basic mgr:mgrpw
... Content-Length: 670
... Content-Type: multipart/form-data; boundary=---------------------------19588947601368617292863650127
...
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="field.title"
...
...
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="field.description"
...
...
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="field.somenumber"
...
... 0
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Hinzufxgen
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="add_input_name"
...
...
... -----------------------------19588947601368617292863650127--
... """, handle_errors=False)
HTTP/1.1 200 Ok
...
There are 1 input errors.
...
Translated
----------
And now the add form in German:
>>> print http(r"""
... GET /+/addfieldcontent.html HTTP/1.1
... Accept-Language: de
... Authorization: Basic mgr:mgrpw
... """, handle_errors=False)
HTTP/1.1 200 Ok
...Felderinhalt hinzuf...
...Eine kurz...Titel...
...Eine ausf...Beschreibung...
...Irgendeine Zahl...
...Irgendeine Liste...
...hinzuf...
...Auffrischen...
...Hinzuf...
...Objektname...
The same with an input error:
>>> print http(r"""
... POST /+/addfieldcontent.html HTTP/1.1
... Accept-Language: de
... Authorization: Basic mgr:mgrpw
... Content-Length: 670
... Content-Type: multipart/form-data; boundary=---------------------------19588947601368617292863650127
...
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="field.title"
...
...
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="field.description"
...
...
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="field.somenumber"
...
... 0
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Hinzufxgen
... -----------------------------19588947601368617292863650127
... Content-Disposition: form-data; name="add_input_name"
...
...
... -----------------------------19588947601368617292863650127--
... """, handle_errors=False)
HTTP/1.1 200 Ok
...Felderinhalt hinzuf...
...Ein Fehler ist aufgetreten...
...Es gab 1 Eingabefehler...
...Eine kurz...Titel...
...Erforderliche Eingabe fehlt...
...Eine ausf...Beschreibung...
...Irgendeine Zahl...
...Irgendeine Liste...
...hinzuf...
...Auffrischen...
...Hinzuf...
...Objektname...