wichert / lingua

Translation toolkit for Python
Other
45 stars 32 forks source link

Exclude files and skip lines #77

Open maconfr opened 8 years ago

maconfr commented 8 years ago

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".

omarkohl commented 7 years ago

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

thet commented 2 years ago

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