Hi folks,

my exams are over, and I'm more than 100% on Django i18n right now.

I've been researching and testing many different options for the part
of displaying values in localized formats, and I have some conclusions
that I would like to discuss with you:

 * It'll be a USE_FORMAT_I18N setting, defaulting to False, to avoid
automatic changes on websites after a Django upgrade (and letting
users not use this new feature of course).
 * IMHO, Django should localize dates, times and numbers
automatically, when displaying values from database (another option is
forcing to use a filter in templates, like {{ my_field|localize }} but
I don't think it's the right way).
 * We should avoid localizing data everywhere, so it could cause
problems, for example if we change the format of data when saving it
to fixtures. I'm not sure on that, may be we can do the opposite,
localizing by default when casting a field to a string, and allow not
doing it for serialization...
 * We should allow a way to not localize data in templates, and even
to localize to a specific locale, and not the current one (an idea
could be creating a filter, so something like {{ my_field|localize
('default') }} or {{ my_field|localize('en') }}, to let users use
default or any locale formats)
 * I think it's better to add localization stuff on the models, not
directly on the templates, so we could want to format fields in other
places different from templates (directly in a view...).

I implemented a simple prototyping version of what's explained above
[1], any feedback will be really appreciated.

Cheers and thanks for your comments,
  Marc

[1] http://code.djangoproject.com/changeset/11159
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to