python-babel / babel

The official repository for Babel, the Python Internationalization Library
http://babel.pocoo.org/
BSD 3-Clause "New" or "Revised" License
1.29k stars 433 forks source link

Extract doesn't work with long spliced strings in parentheses #996

Closed AiroPi closed 1 year ago

AiroPi commented 1 year ago

Overview Description

There is some ways to write long strings in python, one is to use multiple strings in parentheses without any operator between the strings.

Steps to Reproduce

_((
    "This is a very long string that should be split into multiple lines.\n"
    f"This is a very long string that should be split into multiple {}."
), 'lines')

pybabel extract test.py -o test.pot

Actual Results

Nothing except the headers in test.pot

Expected Results

#: test.py:1
msgid ""
"This is a very long string that should be split into multiple lines.\n"
"This is a very long string that should be split into multiple lines."
msgstr ""
AiroPi commented 1 year ago

Or I could just remove the inner parentheses...