def calculate_coverage(filename):
    """
    Calculate translation coverage for a .po file
    """

    with open(filename, 'r') as f:
        lines = f.readlines()

    lines_count = 0
    lines_covered = 0
    lines_uncovered = 0

    for line in lines:

        if line.startswith("msgid "):
            lines_count += 1

        elif line.startswith("msgstr"):
            if line.startswith('msgstr ""') or line.startswith("msgstr ''"):
                lines_uncovered += 1
            else:
                lines_covered += 1

    # Return stats for the file
    return (lines_count, lines_covered, lines_uncovered)