Opened 6 years ago

Closed 6 years ago

#30109 closed Bug (duplicate)

F-String translations don't work

Reported by: ZaArsProgger Owned by: nobody
Component: Internationalization Version: 2.1
Severity: Normal Keywords: translations f-strings formated string
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

So, f-strings connot be translate.

Code:

        modal_important_info_list.append(
            dict(
                type='danger',
                title=_(f'The client {client_instance.title} has debts on:'), 
                content=', '.join([str(x) for x in content_list]),
            )
        )
#: models.py:1031
#, python-brace-format
msgid "The client {client_instance.title} has debts on:"
msgstr "У клиента {client_instance.title} есть задолженности по:"

As result, I see next:

The client НАЗВАНИЕ_КЛИЕНТА has debts on:

Change History (1)

comment:1 by Tim Graham, 6 years ago

Component: UncategorizedInternationalization
Resolution: duplicate
Status: newclosed
Summary: F-String translations no worksF-String translations don't work

Django isn't at fault -- it's a limitation of gettext - see #29174.

Note: See TracTickets for help on using tickets.
Back to Top