From d6adeac6fb679da9930dc100833100895b87ff8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Thu, 22 Aug 2024 16:05:30 +0200 Subject: [PATCH] Add indent to cached translation files to make them easier to navigate (#562) --- source/macros.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/macros.py b/source/macros.py index 8b6d7a28..1dc9753a 100644 --- a/source/macros.py +++ b/source/macros.py @@ -22,12 +22,12 @@ def init_translations(): if not os.path.exists(f"{TRANSLATIONSFILES}/hacs.json"): with open(f"{TRANSLATIONSFILES}/hacs.json", "w") as file: translations = requests.get("https://raw.githubusercontent.com/hacs/frontend/main/src/localize/languages/en.json").json() - json.dump(flatten_json(translations), file) + json.dump(flatten_json(translations), file, indent=4, sort_keys=True) if not os.path.exists(f"{TRANSLATIONSFILES}/core.json"): with open(f"{TRANSLATIONSFILES}/core.json", "w") as file: translations = requests.get("https://raw.githubusercontent.com/home-assistant/frontend/dev/src/translations/en.json").json() - json.dump(flatten_json(translations), file) + json.dump(flatten_json(translations), file, indent=4, sort_keys=True) def define_env(env):