Opened 8 years ago

Last modified 5 months ago

#26803 new New feature

Add a statistics option to makemessages

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

Description

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 (11)

comment:1 by Claude Paroz, 8 years ago

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

comment:2 by Vlastimil Zíma, 8 years ago

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

comment:3 by Claude Paroz, 8 years ago

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 by Vlastimil Zíma, 8 years ago

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

comment:5 by Claude Paroz, 8 years ago

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

comment:6 by Sergey Kolosov, 7 years ago

Owner: changed from nobody to Sergey Kolosov
Status: newassigned

Looking into this during DjangoCon EU 2017 sprints.

comment:7 by Sergey Kolosov, 5 years ago

Posted a PR: https://github.com/django/django/pull/11226

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

comment:8 by Baptiste Mispelon, 4 years ago

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

comment:9 by Mariusz Felisiak, 2 years ago

Owner: Sergey Kolosov removed
Status: assignednew

comment:10 by Sage Abdullah, 10 months ago

Cc: Sage Abdullah added

comment:11 by HarryKane, 5 months ago

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