Opened 4 years ago

Last modified 9 months ago

#26803 assigned New feature

Add a statistics option to makemessages

Reported by: Vlastimil Zíma Owned by: Sergey Kolosov
Component: Internationalization Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Command makemessage has serious downfall - it always changes at least one *.po file. In order to use makemessages to validate whether gettext catalog is up to date, i.e. all translated messages are in the catalog and there are no extra, the actual change of the *.po file is unwanted.

There should be either option to generate *.pot files only, which would allow msgcmp to be used, or validation mode which would check if the catalog contains all the messages.

Change History (8)

comment:1 Changed 4 years ago by Claude Paroz

What change do you talk about? The date field in the po header?

comment:2 Changed 4 years ago by Vlastimil Zíma

Not only the po header. All the file changes - new messages are added, obsolete are removed or marked, etc.

comment:3 Changed 4 years ago by Claude Paroz

What about a --stats-only option which would not touch existing po files, but merge po files in a temporary directory and output translation statistics for each file? Would it fulfill your use case?

comment:4 Changed 4 years ago by Vlastimil Zíma

If it also returns appropriate exit code, similar to makemigrations --exit, then yes.

comment:5 Changed 4 years ago by Claude Paroz

Summary: Allow makemessages to be used for validation of gettext filesAdd a statistics option to makemessages
Triage Stage: UnreviewedAccepted

comment:6 Changed 3 years ago by Sergey Kolosov

Owner: changed from nobody to Sergey Kolosov
Status: newassigned

Looking into this during DjangoCon EU 2017 sprints.

comment:7 Changed 16 months ago by Sergey Kolosov

Posted a PR:

Exit code part is not that straightforward to implement so that it is reliable enough.

comment:8 Changed 9 months ago by Baptiste Mispelon

I closed #31048 as a partial duplicate. It suggested using --dry-run instead of --exit which seems more consistent with other commands.

Note: See TracTickets for help on using tickets.
Back to Top