Disable code for updating index.html

This commit is contained in:
Isaiah Odhner 2023-04-18 02:23:03 -04:00
parent 2e4d6e9c16
commit 160beeb6ce

View File

@ -92,11 +92,11 @@ loaded_localizations("{target_lang}", {localizations_json});
with open(f"{os.path.dirname(__file__)}/{target_lang}/localizations.js", "w", encoding="utf8") as f:
f.write(js)
file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "index.html"))
with open(file_path, "r") as f:
code = f.read()
available_langs_json = json.dumps(available_langs).replace('","', '", "')
code = re.sub(r"(available_languages\s*=\s*)\[[^\]]*\]", f"$1{available_langs_json}]", code)
with open(file_path, "w") as f:
f.write(code)
print(f'Updated available_languages list in "{file_path}"')
# file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "index.html"))
# with open(file_path, "r") as f:
# code = f.read()
# available_langs_json = json.dumps(available_langs).replace('","', '", "')
# code = re.sub(r"(available_languages\s*=\s*)\[[^\]]*\]", f"$1{available_langs_json}]", code)
# with open(file_path, "w") as f:
# f.write(code)
# print(f'Updated available_languages list in "{file_path}"')