WeblateOrg / WeblateOrg/weblate

Allow adding custom lines to xgettext POT header

Open
#20,786 2 comments 0 reactions 0 assignees View on GitHub
Area: File format support Waiting for: Demand
Dominant language
Python
Stars
6.1k
Forks
1.4k
Avg merge
9h 53m
Merged PRs (30d)
395

Description

### Describe the problem

My scripts for .pot generation were injecting "Copyright (C)" and "SPDX-License-Identifier:" [lines into .pot file](https://github.com/ddterm/gnome-shell-extension-ddterm/blob/1deb372b3c8ef0ca09f40cd7761deadf734e805a/po/ddterm%40amezin.github.com.pot#L2-L3) using `--copyright-holder` xgettext flag and some postprocessing with `sed`.

Ideally, I'd want to add the same lines to Weblate-generated .pot file.

### Solution brainstorm

Support for `--copyright-holder` flag alone would be better than the current situation (no way to customize the header at all), but it'll generate "Copyright (C) YEAR" instead of "Copyright (C) 2026".

Weblate already supports templates in multiple places (for example, commit messages and pull request descriptions). Ideally, I'd want a template that gets rendered (with "current year" supported as macro) and inserted into .pot file header comment.

### Describe alternatives you have considered

Just not have the comment, add metadata in `REUSE.toml`/`*.pot.license` instead

### Screenshots

_No response_

### Additional context

This is primarily to comply with REUSE spec, with minimal number of extra metadata files

Contributor guide

Open the contributing guide

Research direction

Start by tracing Weblate's POT generation path and reviewing how its existing templates are rendered. Define a configurable header template that can add custom comment lines and support the current year, then verify that Weblate-generated POT files contain the requested lines without postprocessing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
internationalization, localization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.