From 777e397df98c7e87b3b0bdf09b3ac8e4fbd329ba Mon Sep 17 00:00:00 2001 From: Davide Berardi Date: Fri, 14 Jan 2022 11:58:40 +0100 Subject: [PATCH] Platform independent locale management Windows does not have the LANG environment variable, get the language trough the locale library. --- greenpass.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/greenpass.py b/greenpass.py index 16d3c01..b7b5fe7 100755 --- a/greenpass.py +++ b/greenpass.py @@ -27,6 +27,7 @@ import os import sys import shutil +import locale import argparse import platform import colorama @@ -187,7 +188,7 @@ def main(): sm = SettingsManager(cachedir, args.recovery_expiration) - language = get_language(os.environ["LANG"]) + language = get_language(locale.getlocale()[0]) if args.language is not None: language = args.language