[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #61596] Support for Python f-strings
From: |
Ben |
Subject: |
[bug #61596] Support for Python f-strings |
Date: |
Tue, 7 Dec 2021 13:10:58 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0 |
Follow-up Comment #3, bug #61596 (project gettext):
I am afraid I did not express myself well: xgettext should not accept
f-strings as arguments of _() or gettext(), but should recognise _() or
gettext(), or whatever is defined, inside f-strings.
So, in the last example:
f'<label>{self._("Title")}:</label>'
xgettext should recognise "Title", because of _() inside the f-string.
So, what xgettext should do is evaluate anything inside braces {} within
f-strings as normal Python (which it is!) to see whether there are any
gettext() calls.
An f-string is any Python string (with ', ", ''' or """) prepended by an 'f'
or an 'F'.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?61596>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/