INNER CODE UNIT · Python

pct

blokadaorg/blokada · .github/scripts/translation_coverage.py:72

def pct(covered, total):
    return 100.0 * covered / total if total else 0.0


def run():
    primary, arb = load_langs()

    # Load the English baseline once per category.
    baselines = {cat: load_json(TRANSLATIONS / cat / "en.json") for cat in CATEGORIES}

    rows = []
    warnings = []
    for lang in primary:
        mapped = arb.get(lang, lang)
        per_cat = {}
        tot_cov = tot_all = 0
        for cat in CATEGORIES:
            en = baselines[cat]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…