bugGNU gettext - Bugs: bug #42376, xgettext: comment for...

 
 

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

bug #42376: xgettext: comment for language=Python may be omitted if first argument starts not at a line with keyword

Submitted by:  nott <nott_>
Submitted on:  Fri 16 May 2014 12:24:16 PM UTC  
 
Category: Programmer toolsSeverity: 3 - Normal
Item Group: NoneStatus: Duplicate
Privacy: PublicAssigned to: Daiki Ueno <ueno>
Open/Closed: Closed

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

Mon 01 Dec 2014 07:48:02 AM UTC, comment #8:

Added a note in the xgettext manual:
http://git.sv.gnu.org/cgit/gettext.git/commit/?id=9c69b129

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Wed 21 May 2014 04:47:03 PM UTC, comment #7:

Indeed, you're right, I'm sorry, it worked when placing the comment above the string when I retried it.
I don't know what went wrong with my first try.

Maybe we should document to put it just above the string and not before the gettext call.

Thanks for your help.

Yves-Gwenael Bourhis <ygbo>
Wed 21 May 2014 09:15:08 AM UTC, comment #6:

That's strange. I got the output below if I run xgettext as follows:

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Wed 21 May 2014 08:49:14 AM UTC, comment #5:

Hi,

I have tried doing so as mentionned here: https://code.djangoproject.com/ticket/22578#ticket :
with https://github.com/django/django/blob/master/django/core/management/commands/makemessages.py line 107:

But it doesn't seem to work.

Thanks for your help.

Yves-Gwenael Bourhis <ygbo>
Tue 20 May 2014 10:50:44 PM UTC, comment #4:

Well, I meant to put comments inside the argument list, like this:

PEP8 doesn't seem to forbid this and actually flake8 accepts it.

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Tue 20 May 2014 12:13:00 PM UTC, comment #3:

We can't always easily workaround this by putting the comment immediately followed by the first argument, because by doing so the code could fail being validated by PEP8:
http://legacy.python.org/dev/peps/pep-0008/#indentation
http://legacy.python.org/dev/peps/pep-0008/#maximum-line-length

example:

"Aligned with opening delimiter" indentation would make it harder by needing to split the text even more into very short lines each

We often need this kind of indentation otherwise code gets rejected by pep8 and flake8 code styling validators.

Strings formatted this way (implicit multi-line joined strings) is very common in python code in order to respect it's indentation requirements.

Yves-Gwenael Bourhis <ygbo>
Sat 17 May 2014 01:22:17 AM UTC, comment #2:

https://savannah.gnu.org/bugs/?33451

It is known but I wonder if it is worth being supported, though we probably should clarify the current behavior in the documentation.

Can't you easily work this around by putting the comment immediately followed by the first argument?

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Fri 16 May 2014 12:30:00 PM UTC, comment #1:

$ xgettext --version
xgettext (GNU gettext-tools) 0.18.3
Copyright (C) 1995-1998, 2000-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ulrich Drepper.

nott <nott_>
Fri 16 May 2014 12:24:16 PM UTC, original submission:

xgettext: comment for language=Python may be omitted if first argument starts not at a line with keyword

Consider we have a file like that:

The bug was initially found in Django: https://code.djangoproject.com/ticket/22578#no4

nott <nott_>

 

No files currently attached

 

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 ygbo (Posted a comment)
  • -unavailable- added by ueno (Posted a comment)
  • -unavailable- added by nott_ (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 27 Nov 2016 11:51:46 AM UTChaibleCategoryNone=>Programmer tools
      Assigned toNone=>ueno
    Mon 01 Dec 2014 07:48:02 AM UTCuenoOpen/ClosedOpen=>Closed
    Sat 17 May 2014 01:22:17 AM UTCuenoStatusNone=>Duplicate

    Back to the top


    Powered by Savane 3.1-cleanup1