diff --git a/K-ShakeTune/scripts/analyze_axesmap.py b/K-ShakeTune/scripts/analyze_axesmap.py index 370225d..c47b35e 100755 --- a/K-ShakeTune/scripts/analyze_axesmap.py +++ b/K-ShakeTune/scripts/analyze_axesmap.py @@ -22,7 +22,9 @@ NUM_POINTS = 500 # Set the best locale for time and date formating (generation of the titles) try: - locale.setlocale(locale.LC_TIME, locale.getdefaultlocale()) + current_locale = locale.getlocale(locale.LC_TIME) + if current_locale is None or current_locale[0] is None: + locale.setlocale(locale.LC_TIME, 'C') except locale.Error: locale.setlocale(locale.LC_TIME, 'C') diff --git a/K-ShakeTune/scripts/graph_belts.py b/K-ShakeTune/scripts/graph_belts.py index dc32c1b..c31a6a3 100755 --- a/K-ShakeTune/scripts/graph_belts.py +++ b/K-ShakeTune/scripts/graph_belts.py @@ -46,7 +46,9 @@ KLIPPAIN_COLORS = { # Set the best locale for time and date formating (generation of the titles) try: - locale.setlocale(locale.LC_TIME, locale.getdefaultlocale()) + current_locale = locale.getlocale(locale.LC_TIME) + if current_locale is None or current_locale[0] is None: + locale.setlocale(locale.LC_TIME, 'C') except locale.Error: locale.setlocale(locale.LC_TIME, 'C') diff --git a/K-ShakeTune/scripts/graph_shaper.py b/K-ShakeTune/scripts/graph_shaper.py index 3850ca4..24ae6ea 100755 --- a/K-ShakeTune/scripts/graph_shaper.py +++ b/K-ShakeTune/scripts/graph_shaper.py @@ -40,7 +40,9 @@ KLIPPAIN_COLORS = { # Set the best locale for time and date formating (generation of the titles) try: - locale.setlocale(locale.LC_TIME, locale.getdefaultlocale()) + current_locale = locale.getlocale(locale.LC_TIME) + if current_locale is None or current_locale[0] is None: + locale.setlocale(locale.LC_TIME, 'C') except locale.Error: locale.setlocale(locale.LC_TIME, 'C') diff --git a/K-ShakeTune/scripts/graph_vibrations.py b/K-ShakeTune/scripts/graph_vibrations.py index ca23851..b6a527b 100755 --- a/K-ShakeTune/scripts/graph_vibrations.py +++ b/K-ShakeTune/scripts/graph_vibrations.py @@ -38,7 +38,9 @@ KLIPPAIN_COLORS = { # Set the best locale for time and date formating (generation of the titles) try: - locale.setlocale(locale.LC_TIME, locale.getdefaultlocale()) + current_locale = locale.getlocale(locale.LC_TIME) + if current_locale is None or current_locale[0] is None: + locale.setlocale(locale.LC_TIME, 'C') except locale.Error: locale.setlocale(locale.LC_TIME, 'C')