[modules/datetime] Fix fallback

Fallback handling for setting the locale was completely broken.

fixes #386
This commit is contained in:
Tobias Witek 2019-05-14 20:46:28 +02:00
parent c34ec25523
commit 23377a3ed8

View file

@ -40,7 +40,7 @@ class Module(bumblebee.engine.Module):
try: try:
locale.setlocale(locale.LC_TIME, lcl.split(".")) locale.setlocale(locale.LC_TIME, lcl.split("."))
except Exception as e: except Exception as e:
locale.setlocale(locale.LC_TIME, lcl.split("en_US.UTF-8")) locale.setlocale(locale.LC_TIME, ('en_US', 'UTF-8'))
def get_time(self, widget): def get_time(self, widget):
enc = locale.getpreferredencoding() enc = locale.getpreferredencoding()