Opened 2 years ago

Closed 15 months ago

#20566 closed New feature

Store previous string in po files

Reported by: nijel 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 claudep 2 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 2 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 2 years ago by claudep

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 2 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 2 years ago by claudep

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

comment:5 Changed 2 years ago by ramiro

+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 2 years ago by ramiro

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 2 years ago by claudep

comment:7 Changed 2 years ago by claudep

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 22 months ago by nijel

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 16 months ago by timo

  • Patch needs improvement set

comment:10 Changed 15 months ago by anonymous

comment:11 Changed 15 months ago by claudep

  • Status changed from new to closed

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