I'd like to get babel parsing a file and find out translation strings that are simply starting with:
(_
and ending to:
)
So the translation part in the file.myext
could be:
(_ "message")
String literals are always starting and ending with double quote (").
There are some references of doing it on: http://babel.pocoo.org/en/latest/messages.html?highlight=parser
But this seems overwhelmingly complicated thing. Can someone provide a simple example to achieve own message extractor for babel with above constrains?
I can find Jinja2 parser from: https://github.com/pallets/jinja/blob/99498320871a290f5799d4f96a7774fc8a34381e/jinja2/ext.py
But huh?!
Also Django project has their own extractor: https://github.com/python-babel/django-babel/blob/master/django_babel/extract.py