INNER CODE UNIT · Python
progress_bar
nielsfaber/scheduler-card · scripts/cleanup_translations.py:120
def progress_bar(pct: float, width: int = 10) -> str:
filled = round(pct / 100 * width)
return "█" * filled + "░" * (width - filled)
def main() -> int:
if not os.path.isfile(ENGLISH_FILE):
print(f"ERROR: English reference file not found: {ENGLISH_FILE}")
return 1
reference = load_json(ENGLISH_FILE)
total_en_keys = count_leaf_keys(reference)
pattern = os.path.join(LANGUAGES_DIR, "*.json")
files = sorted(glob.glob(pattern))
file_changes: list[dict] = []
all_stats: list[tuple[str, int, float]] = [] # (code, count, pct)