Skip to content

fix: Make translation check stricter and deterministic#33

Merged
mverteuil merged 1 commit intomainfrom
fix/deterministic-translation-check
Feb 23, 2026
Merged

fix: Make translation check stricter and deterministic#33
mverteuil merged 1 commit intomainfrom
fix/deterministic-translation-check

Conversation

@mverteuil
Copy link
Owner

Summary

  • Add version header validation to _check_pot_freshness
  • Add entry flags validation (python-format, no-python-format, etc.)
  • Extract helper functions to reduce complexity
  • Update POT and PO files to use correct version (2.0.0a0)
  • Update tests to use proper POT header template

Problem

After PR #32 centralized the version in pyproject.toml, running manage-translations extract produced changes because:

  1. The POT file had version 2.0.0 but birdnetpi.__version__ now returns 2.0.0a0
  2. Entry flags could change without being detected

The existing check only validated msgid completeness, not header version or entry flags.

Solution

The check command now validates:

  • msgid completeness (existing)
  • Header version matches birdnetpi.__version__ (new)
  • Entry flags match freshly extracted POT (new)

Test plan

  • All existing translation CLI tests pass
  • manage-translations check passes after running workflow
  • Pre-commit checks pass

- Add version header validation to _check_pot_freshness
- Add entry flags validation (python-format, no-python-format, etc.)
- Extract helper functions for version, msgid, and flag checking
- Update POT and PO files to use correct version (2.0.0a0)
- Update tests to use proper POT header template with version

The check command now validates:
- msgid completeness (existing)
- Header version matches package version (new)
- Entry flags match freshly extracted POT (new)

This ensures the translation workflow produces consistent results
and catches version mismatches introduced by PR #32.
@mverteuil mverteuil merged commit 4659ef7 into main Feb 23, 2026
4 checks passed
@mverteuil mverteuil deleted the fix/deterministic-translation-check branch February 23, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant