From 6aa94f8e5f71d01b3fbd04c1b71218c832e03893 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Thu, 22 Aug 2024 14:00:02 +0000 Subject: [PATCH] Add indent to cached translation files to make them easier to navigate --- 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):