[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: |
Wed, 1 Dec 2021 11:02:16 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0 |
URL:
<https://savannah.gnu.org/bugs/?61596>
Summary: Support for Python f-strings
Project: GNU gettext
Submitted by: qtclyinh
Submitted on: Wed 01 Dec 2021 04:02:14 PM UTC
Category: Python
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Python 3.5 introduced f-strings, as specified in PEP 498 Literal String
Interpolation:
https://www.python.org/dev/peps/pep-0498/
Basically it means that if a string is prefixed with the letter f (uppercase
or lowercase), inside the string there can be any Python expression within
braces, such as:
f'My name is {name}!' # Inserts the value of variable name.
f"My name is {sanitise(name)}!"
f'''<label>{gettext("Title")}:</label>'''
f'<label>{self._("Title")}:</label>"""
Currently, xgettext does not recognise gettext() calls inside f-strings.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?61596>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #61596] Support for Python f-strings,
Ben <=