bugGNU gettext - Bugs: bug #39792, feature request: add an option to...

 
 

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

bug #39792: feature request: add an option to record only the file name, omitting the line number (patch included)

Submitted by:  None
Submitted on:  Thu 15 Aug 2013 02:03:42 PM UTC  
 
Category: Programmer toolsSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Daiki Ueno <ueno>
Open/Closed: Closed

Wed 26 Mar 2014 09:47:27 AM UTC, comment #5:

With this commit:
http://git.savannah.gnu.org/cgit/gettext.git/commit/?h=maint&id=90c76fda268779b80c2fa969b8efddbb4aa5da1e

You can omit line numbers with:

xgettext --add-location=file ...

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Tue 03 Sep 2013 08:52:55 AM UTC, comment #4:

I was thinking something like:

--location-format="%f:%l"

where %f for filename, %l for line number, and perhaps %d for directory. It might be too much though, as you say.

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Tue 03 Sep 2013 08:13:45 AM UTC, comment #3:

I submitted the patch to the mailing list, but there was no reply?

I'm not sure what you mean by it not being flexible enough. Perhaps that it implies --add-location? It didn't seem worth adding another option variable as line_comment already supports using different numbers for different comment styles (with a value of 0 meaning no location comments).

Anonymous
Fri 16 Aug 2013 02:02:28 AM UTC, comment #2:

Sure thing.

Anonymous
Thu 15 Aug 2013 03:43:06 PM UTC, comment #1:

Sounds a reasonable idea, though I'm not sure the command line option is flexible enough. Do you want to discuss it on the mailing list, where other people may also be interested?

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Thu 15 Aug 2013 02:03:42 PM UTC, original submission:

Including line numbers in the .pot file is causing a lot of churn in our git repository. Every time a source file changes, a whole heap of line numbers are modified in the .pot file. This leads to unwieldy git diffs, and obscures any actual changes.

At the same time, we'd like to retain the filenames, as they are very useful for translation context. Omitting only the line numbers seems like the best solution for our use case. If a technically proficient translator wants to find the exact place where the string is used in the code, a simple grep or text search of the source file is quite sufficient.

I don't think we're the only ones who would like to keep a .pot file in our git repository, so i think the option is worth adding.

I made a quick patch to implement it, but i'm not sure if the name i gave the option was appropriate. I called it "--no-linenumbers", which is the first thing I tried when wishing for the functionality.

It seems to work just fine, but I could of course be missing something glaringly obvious.

Anonymous

 

Attached Files

 

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

    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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 27 Nov 2016 01:47:57 AM UTChaibleCategoryNone=>Programmer tools
      Assigned toNone=>ueno
    Wed 26 Mar 2014 09:47:27 AM UTCuenoOpen/ClosedOpen=>Closed
    Wed 26 Mar 2014 09:47:26 AM UTCuenoStatusNone=>Fixed
    Thu 15 Aug 2013 02:03:42 PM UTCNoneAttached File-=>Added 0001-xgettext-new-option-no-linenumbers-omits-line-number.patch, #28853

    Back to the top


    Powered by Savane 3.1-cleanup1