Re: [Django] #18769: Despite selected language, Forms still rely on LANGUAGE_CODE to format datetime (demo included)

2013-08-30 Thread Django
#18769: Despite selected language, Forms still rely on LANGUAGE_CODE to format
datetime (demo included)
-+-
 Reporter:  houmie   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:   |  Version:  1.4
  Internationalization   |   Resolution:  invalid
 Severity:  Normal   | Triage Stage:
 Keywords:  formats, i18n, l10n  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by justinkhill@…):

 I'm having trouble getting my Canadian and Australian sites to use the
 correct date formatting via the localize=True method mentioned here.  My
 other international sites are working correctly.

 I've decided it is because there are no en_AU and en_CA formats.py files
 in the django core project:
 https://github.com/django/django/tree/master/django/conf/locale
 Am I left to create my own as described here:
 https://docs.djangoproject.com/en/dev/topics/i18n/formatting/#creating-
 custom-format-files

 If so, so be it, but may I ask why such well know countries do not have
 their own formats.py in the core project?  Am I doing it wrong?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.e6457638445f25b97bca39aad9ad3fdf%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #18769: Despite selected language, Forms still rely on LANGUAGE_CODE to format datetime (demo included)

2012-08-19 Thread Django
#18769: Despite selected language, Forms still rely on LANGUAGE_CODE to format
datetime (demo included)
-+-
 Reporter:  houmie   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:   |  Version:  1.4
  Internationalization   |   Resolution:  invalid
 Severity:  Normal   | Triage Stage:
 Keywords:  formats, i18n, l10n  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by kmtracey):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 The form you are using hasn't specified to localize the fields. The
 forms.py file in the sandbox project has:

 {{{
 #!python
 from django.forms.models import ModelForm
 from Sandbox_App.models import Company

 class CompanyForm(ModelForm):
 def date_callback(self, field, **kwargs) :
 return field.date(localize=True, **kwargs)
 def time_callback(self, field, **kwargs) :
 return field.time(localize=True, **kwargs)

 class Meta:
 model = Company
 }}}

 I gather it is expected that these callback functions will turn on
 localization for the fields, but I do not know where the idea for defining
 these callbacks came from. Django model forms do not call these functions,
 so they have no effect. Changing that forrms.py file to:

 {{{
 #!python
 from django import forms
 from Sandbox_App.models import Company

 class CompanyForm(forms.ModelForm):
 date = forms.DateField(localize=True)
 time = forms.TimeField(localize=True)

 class Meta:
 model = Company
 }}}

 results in the form on initial display being localized as per the chosen
 language.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18769: Despite selected language, Forms still rely on LANGUAGE_CODE to format datetime (demo included)

2012-08-15 Thread Django
#18769: Despite selected language, Forms still rely on LANGUAGE_CODE to format
datetime (demo included)
-+-
 Reporter:  houmie   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:   |  Version:  1.4
  Internationalization   |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:  formats, i18n, l10n  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by houmie):

 * needs_better_patch:   => 0
 * type:  Uncategorized => Bug
 * needs_tests:   => 0
 * needs_docs:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.