This allows wagtail to be used when USE_L10N=True. It also adds support
for translations of the jquery datepicker sice L10N and I18N go together
for the datepicker.
It defines two new components on edit_handlers.py: LocalizedDateInput and
LocalizedTimeInput. The first one is a normal DateInput having the
localize attribute set to True, while the LocalizedTimeInput can parse
times in 24h format (since parsing localized 12h format times doesn't seem
that easy). FORM_FIELD_OVERRIDES will use these new components when
USE_L10N=True or else we will fall back to the Friendly date and time.
Instead of always forcing the ISO yy-mm-dd format, localized dates will be
used (meaning in the format of dd/mm/yy for EU dates and mm/dd/yy for US
dates). This is a common requirement from most people that have to work
with ISO dates.
However, one thing to notice is that django had bad behavior when I was
trying to parse localized greek dates. It seems that the localized
DATE_INPUT_FORMAT has not been defined for greece (and I suspect that this
may be true for other locales as well). So Django instead used the US and
was not able to parse a greek date in the format dd/mm/yy !
To resolve this a custom smart node name "get_date_format_override" was
defined. This smart node would check the django/conf/locale/xx/formats.py
to see if DATE_INPUT_FORMATS is actually defined. If not it will return a
date input format that should used by the jquery datepicker instead of the
localized one (in our case it returns the ISO format).
Concerning the L10N of the jquery datepicker component, a number of files
is defined in http://jquery-ui.googlecode.com/svn/tags/latest/ui/i18n/
each one with L10N and I18N options for each locale. A template tag named
{% get_localized_datepicker_js %} has been defined that returns the
correct '<script>' tag for each locale -- if I18N and L10N are not used it
won't return anything. This {% get_localized_datepicker_js %} is define
*outside* of compress for _editor_js.html since compress works only for
local files. If we wanted to put it inside compress we should download the
files needed for the translated locales and put them in js/vendor.
The page-editor.js now defines new functions for initialization of the
localized time and date chooser. The localized date input take into
consideration the value of get_date_format_override in order to either use
the correct input format for the locale or fall back to the ISO one