bugGNU gettext - Bugs: bug #38117, Feature request: New option...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #38117: Feature request: New option --clear-translation (or just --clear)

Submitter:  Guido Flohr <gflohr>
Submitted:  Fri 18 Jan 2013 04:48:07 PM UTC
   
 
Category:  Translator tools Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  ueno
Open/Closed:  Closed

Jump to the original submission

Sun 11 May 2014 12:15:30 AM UTC, comment #7: 
Daiki Ueno <ueno>
Group administrator
Thu 10 Apr 2014 09:00:28 AM UTC, comment #6: 

Guido,

After some more thinking, --clear-fuzzy, --clear-translations, and --discard-fuzzy sound equally ambiguous to me.  I think users will need to check the manual for the actual meaning of "clear" and "discard".  I'd like to be more explicit here.

How about this?

msgattrib --clear-fuzzy --empty

Someone might be confused that --empty will affect all messages, but given that we already have --previous option (which affects only when --set-fuzzy is given), this is not too bad I guess.

At the same time, I'm thinking to add "empty" filter to msgfilter, to clear all msgstr.

I'm attaching a modified patch.

(file #31149)

Daiki Ueno <ueno>
Group administrator
Mon 07 Apr 2014 09:00:10 AM UTC, comment #5: 

Yes, it sounds better.

Daiki Ueno <ueno>
Group administrator
Mon 07 Apr 2014 08:53:59 AM UTC, comment #4: 

What about "--discard-fuzzy" with the help string "discard all translations marked `fuzzy'"?

Guido Flohr <gflohr>
Group Member
Mon 07 Apr 2014 08:01:11 AM UTC, comment #3: 

Thanks for the patch, and I understand the naming issue...

As the actual behavior can be seen as a combination of two operations (removing fuzzy flag and resetting the msgstr to ""), how about:

  msgattrib --no-fuzzy --remove-translations

which can be read as: --remove-translations modifies the --no-fuzzy option, so it sets msgstr empty, instead of removing the entire pair.

Daiki Ueno <ueno>
Group administrator
Fri 04 Apr 2014 01:36:23 PM UTC, comment #2: 

I have prepared a patch, see attachment.

I'm not really happy with the option name.  IMHO "--clear-fuzzy" would be appropriate but that is already taken.  "--clear-fuzzy-translations" is too long and will break the layout of the help output.  So I ended up with "--clear-translations" which is somewhat misleading.

I also wasn't sure how to treat obsolete fuzzy entries.  It may be better to delete them.  Currently they are kept.

(file #31125)

Guido Flohr <gflohr>
Group Member
Fri 04 Apr 2014 05:56:41 AM UTC, comment #1: 

It sounds like a good addition.  Do you have a patch for this?  I'm happy to review/merge before the next release.

Daiki Ueno <ueno>
Group administrator
Fri 18 Jan 2013 04:48:07 PM UTC, original submission:  

In order to clean up PO files I sometimes want to remove the translations of fuzzy entries and I don't see a way to do that painlessly with msgattrib.

Instead, I first have to filter out with --no-fuzzy, and then I can use msgmerge to merge back in the deleted entries.

Other people seem to have the same requirement.  See here: http://stackoverflow.com/questions/7372414/removing-all-fuzzy-entries-of-a-po-file


Guido Flohr <gflohr>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #31125:  msgattr-clear-translations.patch added by gflohr (7KiB - text/x-patch - New option --clear-translations for msgattr)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by gflohr (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-27 haible CategoryNone Translator tools
        Assigned toNone ueno
    2014-05-11 ueno StatusNone Fixed
        Open/ClosedOpen Closed
    2014-04-10 ueno Attached File- Added 0001-msgattrib-Add-empty-option.patch, #31149
    2014-04-04 gflohr Attached File- Added msgattr-clear-translations.patch, #31125

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code