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

Richard Duivenvoorde rdmailings at duif.net
Sat Sep 30 01:18:15 PDT 2017


Hi,

was checking this locale issue:

https://issues.qgis.org/issues/17221

And think that the provider seems to work with a point as decimal
separator hardcoded:

https://github.com/qgis/QGIS/blob/release-2_18/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp#L873

https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp#L848


Then I thought to check in the python console to see the current locale via:

iface.mainWindow().locale().name()

(en_US in my case) BUT after setting the QGIS locale to dutch it is
still en_US in my case

You can check by typing '1,0' in the console (or plugin), it will NOT
give you a double, but a tuple: (1,0)

So Question:
- is QGIS locale handling not used in Python world? (both plugins and
console will not see 1,0 as 'one')

- is QGIS locale not handled at all?

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

Regards,

Richard Duivenvoorde


More information about the QGIS-Developer mailing list