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

 
 

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

Submitted by:  Guido Flohr <gflohr>
Submitted on:  Fri 18 Jan 2013 04:48:07 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 11 May 2014 12:15:30 AM UTC, comment #7:

Pushed it: http://git.savannah.gnu.org/cgit/gettext.git/commit/?id=2832f5c072ad569ddda09262a526018ba8fda265

Daiki Ueno <ueno>
Project 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>
Project Administrator
Mon 07 Apr 2014 09:00:10 AM UTC, comment #5:

Yes, it sounds better.

Daiki Ueno <ueno>
Project 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>
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>
Project 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>
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>
Project 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>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #31125:  msgattr-clear-translations.patch added by gflohr (7kB - 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
  • -unavailable- added by ueno (Posted a comment)
  • -unavailable- added by gflohr (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 11 May 2014 12:15:30 AM UTCuenoStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 10 Apr 2014 09:00:28 AM UTCuenoAttached File-=>Added 0001-msgattrib-Add-empty-option.patch, #31149
    Fri 04 Apr 2014 01:36:23 PM UTCgflohrAttached File-=>Added msgattr-clear-translations.patch, #31125

    Back to the top


    Powered by Savane 3.1-cleanup