3 ms·
See the gettext module, at https://docs.python.org/3/library/gettext.html https://docs.python.org/3/library/gettext.html , where gettext() is usually aliased to
by eesmith 7y ago
See the gettext module, at https://docs.python.org/3/library/gettext.html https://docs.python.org/3/library/gettext.html , where gettext() is usually aliased to "_()" so people can write _("int'l string") . There are also tools to extract such strings.
You are correct - translatable strings require late-binding, including possible re-ordering. As the Django documentation points out: 'an English translation may be "Today is November 26.", while a Spanish translation may be "Hoy es 26 de noviembre." – with the month and the day placeholders swapped.'
It adds that f-strings aren't currently supported... And I don't see how they could be supported.