Hi,

formatted string literals are great, but can't be used together with localization:

   _(f"These are {count} stones")

will crash babel ("NameError: name 'count' is not defined". And even it it would succeed, the *evaluated* string would be passed to "_(…)", resulting in a not-translated string.

Is there a better solution than

   _("These are {count} stones").format(count=count)

("Better" = without passing args or kwargs to `format()`)

--
Regards
Hartmut Goebel

| Hartmut Goebel          |h.goe...@crazy-compilers.com                |
|www.crazy-compilers.com  | compilers which you thought are impossible |

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to