Skip to content

Commit

Permalink
Add indent to cached translation files to make them easier to navigate (
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Aug 22, 2024
1 parent 1d568ea commit d6adeac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d6adeac

Please sign in to comment.