Merge pull request #265 from 4shadoww/master

Add proper test to check is locale defined.
This commit is contained in:
tobi-wan-kenobi 2018-05-31 17:00:36 +02:00 committed by GitHub
commit ec74ea8ec6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,7 @@ class Module(bumblebee.engine.Module):
bumblebee.output.Widget(full_text=self.get_time)) bumblebee.output.Widget(full_text=self.get_time))
self._fmt = self.parameter("format", default_format(self.name)) self._fmt = self.parameter("format", default_format(self.name))
l = locale.getdefaultlocale() l = locale.getdefaultlocale()
if not l: if not l or l == (None, None):
l = ('en_US', 'UTF-8') l = ('en_US', 'UTF-8')
lcl = self.parameter("locale", ".".join(l)) lcl = self.parameter("locale", ".".join(l))
locale.setlocale(locale.LC_TIME, lcl.split(".")) locale.setlocale(locale.LC_TIME, lcl.split("."))