Beremiz_service.py
branchwxPython4
changeset 3738 9ce94d0d3764
parent 3642 cd3d15e8ef42
parent 3731 549763a28934
child 3750 f62625418bff
--- a/Beremiz_service.py	Tue Feb 28 15:06:13 2023 +0100
+++ b/Beremiz_service.py	Tue Feb 28 15:08:43 2023 +0100
@@ -186,6 +186,12 @@
     return os.path.join(beremiz_dir, *args)
 
 
+import locale
+# Matiec's standard library relies on libC's locale-dependent
+# string to/from number convertions, but IEC-61131 counts
+# on '.' for decimal point. Therefore locale is reset to "C" */
+locale.setlocale(locale.LC_NUMERIC, "C")
+
 def SetupI18n():
     # Get folder containing translation files
     localedir = os.path.join(beremiz_dir, "locale")
@@ -206,7 +212,6 @@
     # Define locale domain
     loc.AddCatalog(domain)
 
-    import locale
     global default_locale
     default_locale = locale.getdefaultlocale()[1]