Skip to content
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
merged 1 commit into from
Jul 30, 2015
Merged

don't localize tag attributes values #156

merged 1 commit into from
Jul 30, 2015

Conversation

ychab
Copy link

@ychab ychab commented Jul 28, 2015

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 added a commit that referenced this pull request Jul 30, 2015
don't localize tag attributes values
@gregmuellegger gregmuellegger merged commit a5464a2 into jazzband:master Jul 30, 2015
gregmuellegger added a commit that referenced this pull request Jul 30, 2015
@gregmuellegger
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants