Opened 12 years ago

Closed 11 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

Description

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 https://github.com/django/django/pull/627

Attachments (1)

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

Download all attachments as: .zip

Change History (12)

comment:1 by Ramiro Morales, 12 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Claude Paroz, 12 years ago

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 by wim@…, 12 years ago

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

comment:4 by Claude Paroz, 12 years ago

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

comment:5 by Ramiro Morales, 11 years ago

+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 by Ramiro Morales, 11 years ago

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).

by Claude Paroz, 11 years ago

Attachment: 20566-poc.diff added

comment:7 by Claude Paroz, 11 years ago

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 by Michal Čihař, 11 years ago

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 by Tim Graham, 11 years ago

Patch needs improvement: set

comment:11 by Claude Paroz, 11 years ago

Status: newclosed

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

[06efeae598c6dafbe56d2ea323a0dccdd5bf2b8e]

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