GNU gettext: Print string translated and untranslated at the same time

Dieter Maurer dieter at handshake.de
Thu Aug 17 12:16:03 EDT 2023


c.buhtz at posteo.jp wrote at 2023-8-17 07:10 +0000:
>I want to display one string in its original source (untranslated)
>version and in its translated version site by site without duplicating
>the string in the python source code?

Is it an option for you to replace the `gettext` binding
by `zope.i18nmessageid`? Its `Message` instances provide
access to all interesting attributes (id, default, mapping, domain).
Together with other packages (--> `zope.i18n` and `i18ndude`)
it is compatible with `GNU gettext` translation catalogs.

If this is not an option, use Python's inspection functionality
to learn which attributes are made available by the binding's
message class.


More information about the Python-list mailing list