From f26c8ab0a171f5d0183d9b4851cc5667119ce582 Mon Sep 17 00:00:00 2001 From: derrod Date: Thu, 21 Jul 2022 18:25:06 +0200 Subject: [PATCH] [core] Change locale env variable order Fixes #457 --- legendary/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/legendary/core.py b/legendary/core.py index 3b5a60a..63689cb 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -77,7 +77,8 @@ class LegendaryCore: self.local_timezone = datetime.now().astimezone().tzinfo self.language_code, self.country_code = ('en', 'US') - if locale := self.lgd.config.get('Legendary', 'locale', fallback=getdefaultlocale()[0]): + if locale := self.lgd.config.get('Legendary', 'locale', + fallback=getdefaultlocale(('LANG', 'LANGUAGE', 'LC_ALL', 'LC_CTYPE'))[0]): try: self.language_code, self.country_code = locale.split('-' if '-' in locale else '_') self.log.debug(f'Set locale to {self.language_code}-{self.country_code}')