This commit is contained in:
Stan Ulbrych 2025-06-19 15:20:29 +01:00
parent c85d0c26ad
commit c40039fa3d
No known key found for this signature in database
GPG key ID: B8E58DBDB2A1A0B8
3 changed files with 50 additions and 17 deletions

View file

@ -493,8 +493,8 @@ def find(domain, localedir=None, languages=None, all=False):
languages = []
if val := os.environ.get('LANGUAGE'):
languages = val.split(':')
elif (loc := locale.setlocale(locale.LC_MESSAGES)) != (None, None):
languages = [".".join(filter(None, loc))]
elif loc := locale.setlocale(locale.LC_MESSAGES):
languages = loc.split(':')
else:
for envar in ('LC_ALL', 'LC_MESSAGES', 'LANG'):
val = os.environ.get(envar)