Debug report.py lang to locales folder

This commit is contained in:
Félix Aime 2021-02-08 18:59:54 +01:00
parent 50a9eb3a89
commit 0058817b76

View File

@ -34,9 +34,9 @@ class Report(object):
self.userlang = get_config(("frontend", "user_lang"))
# Load template language
if not re.match("^[a-z]{2}$", self.userlang):
if not re.match("^[a-z]{2,3}$", self.userlang):
self.userlang = "en"
with open(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "lang/{}.json".format(self.userlang)))as f:
with open(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "locales/{}.json".format(self.userlang))) as f:
self.template = json.load(f)["report"]
def read_json(self, json_path):