don't localize tag attributes values #156

merged 1 commit into from Jul 30, 2015


None yet

2 participants

ychab commented Jul 28, 2015


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).


@gregmuellegger gregmuellegger merged commit a5464a2 into gregmuellegger:master Jul 30, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
@gregmuellegger gregmuellegger added a commit that referenced this pull request Jul 30, 2015
@gregmuellegger Add changelog for #156 f32762f

Awesome! Thanks so much. Good catch.
This is part of the just released version 1.5.2:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment