I have created a small demo to show the problem.
When you click on British English, you can see how both the date- and time format change accordingly, which is grea
Fixed!! Hi Kave, after some time looking into your problem, finally I have found a solution.
Sample switch language:
def display_current_language(request):
if request.LANGUAGE_CODE == 'en-gb':
lang = "You prefer to read British English {code}.".format(
code=request.LANGUAGE_CODE )
activate(request.LANGUAGE_CODE)
elif request.LANGUAGE_CODE == 'en-us':
lang = "You prefer to read American English {code}.".format(
code=request.LANGUAGE_CODE )
activate('en-us')
else:
lang = "You prefer to read Deutsch {code}.".format(
code=request.LANGUAGE_CODE )
activate(request.LANGUAGE_CODE)
return lang
Sample using your model (company) and your field ( date ):
class CompanyForm(ModelForm):
class Meta:
model = Company
def __init__(self, *args, **kwargs):
super(CompanyForm, self).__init__(*args, **kwargs)
self.fields['date'].localize = True
self.fields['date'].widget.is_localized = True