Skip to content

SQL panel fix for locales that use comma as a decimal separator. #173

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

Merged
merged 3 commits into from
Jun 10, 2011

Conversation

thinred
Copy link

@thinred thinred commented Jun 3, 2011

I've noticed this problem some time ago. "width_ratio" and "start_offset" were printed with comma as a separator (I use polish locale) and this confused CSS parser. I couldn't find a way to forcibly print a number in a dotted notation so I rolled out my own template filter.

@thinred
Copy link
Author

thinred commented Jun 9, 2011

Quite mistakinbly I've added another commit to this pull request. Is it still pullable properly?

Anyway - the second patch fixes another problem - when a "djDebugLineChart" container is shifted with the "left" CSS property its width changes accordingly. Therefore the width of a "<strong>" inside must be scaled relatively to the remaining space.

@dcramer
Copy link
Contributor

dcramer commented Jun 10, 2011

Do you know what's actually being printed localized? Do ints automatically get localized in templates or is there some other magic?

@thinred
Copy link
Author

thinred commented Jun 10, 2011

I've noticed that floating points numbers are localized - here in Poland we use comma as a decimal separator, but this is true for other countries as well (France I guess?).

@thinred thinred closed this Jun 10, 2011
@thinred thinred reopened this Jun 10, 2011
@thinred
Copy link
Author

thinred commented Jun 10, 2011

ups!

@dcramer
Copy link
Contributor

dcramer commented Jun 10, 2011

@thinred do you know if thats any float that you print in the templates?

dcramer added a commit that referenced this pull request Jun 10, 2011
SQL panel fix for locales that use comma as a decimal separator.
@dcramer dcramer merged commit 64edae3 into django-commons:master Jun 10, 2011
@dcramer
Copy link
Contributor

dcramer commented Jun 10, 2011

Seems that the localization does automatically format it (from what I'm told). I'll try to get a test case added for this (unless you beat me to it :)

@thinred
Copy link
Author

thinred commented Jun 10, 2011

An obvious moral from this bug is to be very careful when floating-point number is used in HTML attributes. :)

ryneeverett pushed a commit to ryneeverett/django-debug-toolbar that referenced this pull request Oct 2, 2016
SQL panel fix for locales that use comma as a decimal separator.
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