diff --git a/translations/translations.py b/translations/translations.py index 6d154b85b..bd2d6a772 100644 --- a/translations/translations.py +++ b/translations/translations.py @@ -1,14 +1,16 @@ import os + def load_translations(): # Load all available translations - translations_dir = os.path.join(os.path.dirname(__file__), 'translations') + translations_dir = os.path.join(os.path.dirname(__file__), "translations") translations = {} for file in os.listdir(translations_dir): - if file.endswith('.json'): - with open(os.path.join(translations_dir, file), 'r') as f: + if file.endswith(".json"): + with open(os.path.join(translations_dir, file), "r") as f: language = file[:-5] translations[language] = json.load(f) return translations + translations = load_translations()