[QGIS-Developer] QGIS and QLocale handling not used?

Richard Duivenvoorde rdmailings at duif.net
Sat Sep 30 04:22:38 PDT 2017


On 30-09-17 10:18, Richard Duivenvoorde wrote:

> Given QGIS is used in so many different languages/locales, I think QGIS3
> is the right time to handle this in a proper way?
> 
> Or is my testing just plain wrong :-)

Ok, see comments at the issue [0], I think there is nothing wrong with
the separator handling of the delimitedtextprovider.
It would be cool though if the dialog would check the 'Decimal separator
is comma' when the locale is european (and maybe show the locale there...)

And my test was plain wrong: 1,0 will NEVER be a valid float in Python.
'1,0' is, if you have the right locale, see [1]
Note that this is about plain Python. In our case there is Qt in between...

I think though that changing the locale and then asking for the locale
in QGIS should show the locale used.

I hope somebody can tell something about this?

Regards,

Richard Duivenvoorde



[0] https://issues.qgis.org/issues/17221

[1]
https://stackoverflow.com/questions/6633523/how-can-i-convert-a-string-with-dot-and-comma-into-a-float-number-in-python


More information about the QGIS-Developer mailing list