INNER CODE UNIT · Python

main

nielsfaber/scheduler-card · scripts/cleanup_translations.py:125

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)

    for filepath in files:
        filename = os.path.basename(filepath)
        code = filename[:-5]  # strip ".json"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…