jazzband / django-floppyforms

Full control of form rendering in the templates.
http://django-floppyforms.readthedocs.org/
Other
839 stars 145 forks source link

don't localize tag attributes values #156

Closed ychab closed 9 years ago

ychab commented 9 years ago

Hi,

Since latest commits, DecimalField (and FloatField I guess) have min, max and step properties. Step property use the decimal_place attribute.

However, attribute values are rendered with the template engine. And if settings USE_L10N=True, any values would be localized by default. As a consequence, with the French language enabled, we would got a HTML tag attribut step=0,01. With Chrome at least, this could be invalid and round the step to integer!

I think that we should do the same thing for any attributes: force them to don't be localized.

However, a special note should be throw to other users implementing their own attrs.html template because they may update it too (if using l10n and applying the default behaviour, which is to localize any values).

Thanks

gregmuellegger commented 9 years ago

Awesome! Thanks so much. Good catch. This is part of the just released version 1.5.2: https://pypi.python.org/pypi/django-floppyforms/1.5.2