On 28/07/11 15:33, miamia wrote: > Hello, > I have > variable OUHH and > print _('This is %(OUHH)s a translatable string.' % locals()) > > how can I translate this ?
Get the translation first, insert values second. _('This string contains a variable: {0}. Amazing').format(OUHH) Depending on what the actual string is, you may need to consider plurals. See gettext.ngettext() -- http://mail.python.org/mailman/listinfo/python-list