Skip to content

Bug: English File Error Handling & Test Coverage #2501

@khushal-winner

Description

@khushal-winner

Describe the bug

The translation checking system in scripts/check_translations.py has two critical bugs:

  1. Silent English file failure: Lines 128-130 silently continue when english_tags is empty, causing corrupted English files to result in CI passing when it should fail
  2. Missing extra tags detection: The _check_translation_tags() method never detects translation tags that exist in non-English files but are absent from English reference files

Expected behavior

  1. Loud failure: Corrupted/empty English files should cause CI to fail with clear error messages
  2. Complete validation: Translation checker should detect and report "extra tags" alongside missing/untranslated/empty tags

Desktop

OS: Windows/Linux/MacOS (affects all)
Browser: N/A (backend system)
Version: All current versions

Additional context

Why we need this fix:
Production impact: Broken English files cause API to serve empty responses → users see "No cards available" instead of security guidance
Detection difficulty: CI always passes due to || echo "Translation issues found, continuing..." workaround

Why we need test coverage:
Current tests: Only test happy paths with valid files, giving false confidence
Missing coverage: No tests for malformed/empty English files, extra tags detection
Regression prevention: Without proper tests, these critical bugs will reoccur

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions