Opened 3 years ago

Closed 3 years ago

#20566 closed New feature

Store previous string in po files

Reported by: Michal Čihař Owned by: nobody
Component: Internationalization Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


Currently while there is changed text to be translated, the string is only marked fuzzy not providing translators any information what has been changed. This can be improved by adding --previous parameter to msgmerge.

There is pull request to implement this at

Attachments (1)

20566-poc.diff (4.5 KB) - added by Claude Paroz 3 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 3 years ago by Ramiro Morales

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

comment:2 Changed 3 years ago by Claude Paroz

Will we really offer a management command option for each msgmerge option? What about switching on the --previous flag without adding yet another option?

comment:3 Changed 3 years ago by wim@…

@claudep I think it is nice to provide backwards compatibility, though I don't find it necessary for myself.

comment:4 Changed 3 years ago by Claude Paroz

I don't see any backwards compatibility issue with --previous.

comment:5 Changed 3 years ago by Ramiro Morales

+1 to Claude proposal. And I don't see any backward incompatibility danger either, any 3rd. party tool handling GNU gettext catalog files should handle (ignore) these comments gracefully.

comment:6 Changed 3 years ago by Ramiro Morales

Also, the PR actually proposes making the new behavior (adding the old literal as a comment) the default. And it adds a command line switch to get the old behavior. Maybe we can drop the latter one? (sorry if this was what you meant in the first place).

Changed 3 years ago by Claude Paroz

Attachment: 20566-poc.diff added

comment:7 Changed 3 years ago by Claude Paroz

Just attached how I would like to solve this issue (proof-of-concept, untested). If such an approach would be accepted, we then need to document the new class-level attributes and encourage people to subclass and override to customize behaviour.

comment:8 Changed 3 years ago by Michal Čihař

The only reason I've added command option was to follow current state where the options were provided. It would be probably about as useful as --no-location. Proposed patch looks good to me as it quite simplifies the code.

comment:9 Changed 3 years ago by Tim Graham

Patch needs improvement: set

comment:10 Changed 3 years ago by anonymous

comment:11 Changed 3 years ago by Claude Paroz

Status: newclosed

Argh, sorry. Forgot to add ticket number in the fixing commit:


Added --previous flag to msgmerge command used by makemessages

Also took the opportunity to slightly refactor gettext options
so as to ease customization by subclassing the command.
Thanks Michal Čihař for the report and initial patch.

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