wichert / lingua

Translation toolkit for Python
Other
45 stars 32 forks source link

Skip function definitions in Python extractor #93

Closed alexbrault closed 4 years ago

alexbrault commented 5 years ago

When defining a function with the same name as a keyword (e.g. to perform some preprocessing before forwarding to the translation engine), pot-create tries and fails to extract the parameter names as arguments.

With this PR, it will skip the first token following the def keyword (i.e. the function name). Calls to a translation function as a default value will still work.