| 3559 | |
| 3560 | ####################### |
| 3561 | # Tests for form i18n # |
| 3562 | ####################### |
| 3563 | |
| 3564 | >>> from django.utils.translation import gettext_lazy, activate |
| 3565 | >>> class SomeForm(Form): |
| 3566 | ... username = CharField(max_length=10, label=gettext_lazy('Username')) |
| 3567 | >>> f = SomeForm() |
| 3568 | >>> print f.as_p() |
| 3569 | <p><label for="id_username">Username:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p> |
| 3570 | >>> activate('de') |
| 3571 | >>> print f.as_p() |
| 3572 | <p><label for="id_username">Benutzername:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p> |
| 3573 | |
| 3574 | |