@@ -191,9 +191,9 @@ def display_themed_radial_bar(theme_data, value, min_size=0, unit='', custom_tex
191
191
background_image = get_theme_file_path (theme_data .get ("BACKGROUND_IMAGE" , None )),
192
192
custom_bbox = theme_data .get ("CUSTOM_BBOX" , (0 , 0 , 0 , 0 )),
193
193
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" , "" )
197
197
)
198
198
199
199
@@ -742,11 +742,17 @@ def stats():
742
742
else :
743
743
date_now = datetime .datetime .now ()
744
744
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"
750
756
751
757
date_theme_data = config .THEME_DATA ['STATS' ]['DATE' ]
752
758
day_theme_data = date_theme_data ['DAY' ]['TEXT' ]
0 commit comments