Fixed 'clock' module to properly format locale specific formats.

This commit is contained in:
Lukáš Mandák 2015-01-17 19:30:49 +01:00
parent 1bacaa1cf5
commit 6e7c225269

View File

@ -32,10 +32,12 @@ class Clock(IntervalModule):
on_downscroll = ["scroll_format", -1] on_downscroll = ["scroll_format", -1]
def init(self): def init(self):
lang = os.environ.get('LANG', None)
if lang:
# affects function time.strftime() in whole program
locale.setlocale(locale.LC_TIME, lang)
if self.format is None: if self.format is None:
lang = os.environ.get('LANG', None)
if lang:
locale.setlocale(locale.LC_ALL, lang)
lang = locale.getlocale()[0] lang = locale.getlocale()[0]
if lang == 'en_US': if lang == 'en_US':
# MDY format - United States of America # MDY format - United States of America