lingua icon indicating copy to clipboard operation
lingua copied to clipboard

Exclude files and skip lines

Open maconfr opened this issue 10 years ago • 2 comments

In the current version pot-create outputs the following message in our project:

$ pot-create --keyword=_ts app -o app/locale/translations.pot
./app/utils.py[92]: Message argument must be a string
./app/utils.py[118]: Message argument must be a string
No translatable strings found, aborting

In line 92 we defined our translation function which is also used as keyword

def _ts(string, mapping=None):
    pass

I think the python extractor should ignore this in general.

And in line 118 we used this function with variables, which is intended.

It would be great to be able to exclude files from directory scan and/or to skip lines lines by a simple comment hint like e.g. "# I18N !skip".

maconfr avatar Feb 26 '16 15:02 maconfr

+1 for this. We get the same output and it would be nice to clean that up.

omarkohl avatar May 16 '17 14:05 omarkohl

I used the --list-files option to circumvent this issue. See: https://github.com/wichert/lingua/issues/103 https://github.com/wichert/lingua/pull/102

thet avatar Jan 03 '22 11:01 thet