Is your feature request related to a problem? Please describe.
Yes. Currently, when running scripts/l10n/generate_po_files.py, the generated .pot and .po files are incomplete in two frustrating ways:
- Missing License Header: The files are created without the standard
# holidays license block. This causes the check-license-headers pre-commit hook to fail immediately, requiring manual copy-pasting to fix.
- Incomplete Metadata: The header metadata is bare-bones. Fields like
Language, Last-Translator, Language-Team, and MIME-Version are missing
Describe the solution you'd like
I am thinking we could update the generate_po_files.py script to automate this fully. The script could:
- Read the License dynamically: detailed in
docs/file_header.txt and inject it into the header of every generated file.
- Add Translator Placeholder: Automatically set the Last-Translator field to a placeholder (e.g., YOUR NAME ) or populate it from git config if appropriate.
- Standardize Metadata: Automatically populate fields like
Language (detected from the folder path) and Last-Translator so the files are "commit-ready" immediately after generation.
Describe alternatives you've considered
- Manual Editing: The current workflow requires opening every new
.po file and pasting the header from an existing file, which is error-prone.
- Auto-filling from Git Config: I considered pulling the name/email from
git config, but a placeholder might be better to ensure contributors consciously opt-in to sharing their details.
Additional context
Is your feature request related to a problem? Please describe.
Yes. Currently, when running
scripts/l10n/generate_po_files.py, the generated.potand.pofiles are incomplete in two frustrating ways:# holidayslicense block. This causes thecheck-license-headerspre-commit hook to fail immediately, requiring manual copy-pasting to fix.Language,Last-Translator,Language-Team, andMIME-Versionare missingDescribe the solution you'd like
I am thinking we could update the
generate_po_files.pyscript to automate this fully. The script could:docs/file_header.txtand inject it into the header of every generated file.Language(detected from the folder path) andLast-Translatorso the files are "commit-ready" immediately after generation.Describe alternatives you've considered
.pofile and pasting the header from an existing file, which is error-prone.git config, but a placeholder might be better to ensure contributors consciously opt-in to sharing their details.Additional context