From 6e7c22526975c75d7bc893b856fb73a933ff1610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Mand=C3=A1k?= Date: Sat, 17 Jan 2015 19:30:49 +0100 Subject: [PATCH] Fixed 'clock' module to properly format locale specific formats. --- i3pystatus/clock.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/i3pystatus/clock.py b/i3pystatus/clock.py index ba95678..d0db703 100644 --- a/i3pystatus/clock.py +++ b/i3pystatus/clock.py @@ -32,10 +32,12 @@ class Clock(IntervalModule): on_downscroll = ["scroll_format", -1] 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: - lang = os.environ.get('LANG', None) - if lang: - locale.setlocale(locale.LC_ALL, lang) lang = locale.getlocale()[0] if lang == 'en_US': # MDY format - United States of America