#4039 closed (fixed)
New forms and the set_language redirect view don't work together
| Reported by: | anonymous | Owned by: | hugo | 
|---|---|---|---|
| Component: | Internationalization | Version: | 0.96 | 
| Severity: | Keywords: | unicode-branch | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
When using the 'set_language redirect view' along with newforms, where the newform fields' labels are marked with gettext_lazy, after the view is reloaded, the fields' labels are still in the original language (while template internationalized string are actualized).
Example code for the form:
from django import newforms as forms
from django.utils.translation import gettext_lazy as _
class GetInForm(forms.Form):
    name = forms.CharField(label=_('Name'), max_length=30)
    password = forms.CharField(label=_('Password'),
                                 widget=forms.PasswordInput(render_value=False))
View code:
from django.shortcuts import render_to_response
from django.template import RequestContext
import GetInForm
def getin(request):
    return render_to_response('template_name',
                                  {'test': _('Hello'), 'form': GetInForma().as_p()},
                                  context_instance=RequestContext(request))
Inside the template, the set_language redirect view' is used.  Hello is translated, but the form labels no.
Change History (4)
comment:1 by , 19 years ago
| Triage Stage: | Unreviewed → Accepted | 
|---|
comment:2 by , 18 years ago
| Keywords: | unicode-branch added | 
|---|
comment:3 by , 18 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
  Note:
 See   TracTickets
 for help on using tickets.
    
This is fixed on the Unicode branch and will be closed when that branch is merged into trunk.