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

 
 

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

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

Submitted by:  Guido Flohr <gflohr>
Submitted on:  Fri Jan 18 16:48:07 2013  
 
Category: Translator toolsSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Daiki Ueno <ueno>
Open/Closed: Closed

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

Sun May 11 00:15:30 2014, comment #7:

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

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Thu Apr 10 09:00:28 2014, 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 AdministratorIn charge of this item.
Mon Apr 7 09:00:10 2014, comment #5:

Yes, it sounds better.

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Mon Apr 7 08:53:59 2014, comment #4:

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

Guido Flohr <gflohr>
Project Member
Mon Apr 7 08:01:11 2014, 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 AdministratorIn charge of this item.
Fri Apr 4 13:36:23 2014, 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>
Project Member
Fri Apr 4 05:56:41 2014, 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 AdministratorIn charge of this item.
Fri Jan 18 16:48:07 2013, 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>
Project Member

 

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 haible (Updated the item)
  • -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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Nov 27 01:33:41 2016haibleCategoryNone=>Translator tools
      Assigned toNone=>ueno
    Sun May 11 00:15:30 2014uenoStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu Apr 10 09:00:28 2014uenoAttached File-=>Added 0001-msgattrib-Add-empty-option.patch, #31149
    Fri Apr 4 13:36:23 2014gflohrAttached File-=>Added msgattr-clear-translations.patch, #31125

    Back to the top


    Powered by Savane 3.1-cleanup