@@ -191,9 +191,9 @@ def display_themed_radial_bar(theme_data, value, min_size=0, unit='', custom_tex
191191 background_image = get_theme_file_path (theme_data .get ("BACKGROUND_IMAGE" , None )),
192192 custom_bbox = theme_data .get ("CUSTOM_BBOX" , (0 , 0 , 0 , 0 )),
193193 text_offset = theme_data .get ("TEXT_OFFSET" , (0 , 0 )),
194- bar_background_color = theme_data .get ("BAR_BACKGROUND_COLOR" , (0 , 0 , 0 )),
195- draw_bar_background = theme_data .get ("DRAW_BAR_BACKGROUND" , False ),
196- bar_decoration = theme_data .get ("BAR_DECORATION" , "" )
194+ bar_background_color = theme_data .get ("BAR_BACKGROUND_COLOR" , (0 , 0 , 0 )),
195+ draw_bar_background = theme_data .get ("DRAW_BAR_BACKGROUND" , False ),
196+ bar_decoration = theme_data .get ("BAR_DECORATION" , "" )
197197 )
198198
199199
@@ -742,11 +742,17 @@ def stats():
742742 else :
743743 date_now = datetime .datetime .now ()
744744
745- if platform .system () == "Windows" :
746- # Windows does not have LC_TIME environment variable, use deprecated getdefaultlocale() that returns language code following RFC 1766
747- lc_time = locale .getdefaultlocale ()[0 ]
748- else :
749- lc_time = babel .dates .LC_TIME
745+ try :
746+ if platform .system () == "Windows" :
747+ # Windows does not have LC_TIME environment variable, use deprecated getdefaultlocale() that returns language code following RFC 1766
748+ lc_time = locale .getdefaultlocale ()[0 ]
749+ else :
750+ lc_time = babel .dates .LC_TIME
751+ except :
752+ lc_time = None
753+
754+ if not lc_time :
755+ lc_time = "en_US"
750756
751757 date_theme_data = config .THEME_DATA ['STATS' ]['DATE' ]
752758 day_theme_data = date_theme_data ['DAY' ]['TEXT' ]
0 commit comments