wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

_extract_python ignores firstline parameter. #58

Closed ldaverio closed 9 years ago

ldaverio commented 9 years ago

The firstline parameter is not relevant when extracting messages from a Python (.py) file, however it is required to get correct line numbers when extracting messages from files embedding fragments of Python code, e.g. Mako templates (without it, all messages appear to be located at line # 1)

wichert commented 9 years ago

Thanks! This change needs a test to go with it. Can you supply that as well? If not I'll try to add one later this week.

ldaverio commented 9 years ago

As I wrote earlier, it will make no difference for a .py file, because in that cast firstline is always equal to zero. On the other hand, it makes a difference for Mako templates. I can provide a short (4-5 lines) test template with a unittest testcase. Should I put it in the Lingua, or Mako repository?