New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 added a commit that referenced this pull request Jul 30, 2015

Merge pull request #156 from ychab/master
don't localize tag attributes 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 added a commit that referenced this pull request Jul 30, 2015


This comment has been minimized.


gregmuellegger commented Jul 30, 2015

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

@pyup-bot pyup-bot referenced this pull request Jul 27, 2016


Initial Update #344

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