Apply formatting

This commit is contained in:
Chocobo1
2024-03-17 15:39:31 +08:00
parent 34d19e5714
commit 47c38e8d91
7 changed files with 61 additions and 43 deletions

View File

@@ -14,6 +14,7 @@ import os
import sys
import xml.etree.ElementTree as ET
def getTsStrings(ts_file: str, key: str) -> list[str]:
tr_strings: list[str] = []
tree = ET.parse(ts_file)
@@ -33,6 +34,7 @@ def getTsStrings(ts_file: str, key: str) -> list[str]:
return tr_strings
def migrate2Json(ts_dir: str, json_dir: str, locale: str) -> None:
ts_file: str = f"{ts_dir}/webui_{locale}.ts"
js_file: str = f"{json_dir}/{locale}.json"
@@ -71,6 +73,7 @@ def migrate2Json(ts_dir: str, json_dir: str, locale: str) -> None:
print("\tFinished.")
def main() -> int:
script_path: str = os.path.dirname(os.path.realpath(__file__))
ts_dir: str = f"{script_path}/translations"
@@ -97,5 +100,6 @@ def main() -> int:
return 0
if __name__ == '__main__':
sys.exit(main())