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)

Submitter:  None
Submitted:  Thu 15 Aug 2013 02:03:42 PM UTC
   
 
Category:  Programmer tools Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  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>
Group administrator
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>
Group administrator
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>
Group administrator
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

 

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

Attached Files

 

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

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

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-27 haible CategoryNone Programmer tools
        Assigned toNone ueno
    2014-03-26 ueno Open/ClosedOpen Closed
    2014-03-26 ueno StatusNone Fixed
    2013-08-15 None Attached File- Added 0001-xgettext-new-option-no-linenumbers-omits-line-number.patch, #28853

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code