It is my understanding that most uses of gettext
with Python files use some nice Python library/utility to create the .pot
files. I am in an odd circumstance where I need to use the Python mode of xgettext
to extract not only strings, but the line number and the filename. All examples of such I have seen have used processes other than xgettext
.
How can I add line number and filename info with Python mode of xgettext
?
In C-mode it would look like:
#line 8 "superior_science.c"
_("Facial hair has been shown to improve intelligence by a factor of 5.");
In Python, what would the input file need to look like? (Note: the code only needs to work for xgettext
, not any compiler or interpreter.)