Skip to content

l10n: Automate License Headers and Metadata in generate_po_files.py #3180

@pareshjoshij

Description

@pareshjoshij

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:

  1. 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.
  2. 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:

  1. Read the License dynamically: detailed in docs/file_header.txt and inject it into the header of every generated file.
  2. Add Translator Placeholder: Automatically set the Last-Translator field to a placeholder (e.g., YOUR NAME ) or populate it from git config if appropriate.
  3. 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

Metadata

Metadata

Assignees

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