Manually translating message ids
If you need to manipulate translated text outside page templates, you need to perform the final translation manually.
Translation always needs context (i.e. under which site translation happens), as the active language and other preferences are read from the HTTP request object and site settings.
Translation can be performed using context.translate() method which all content objects inherit:
# Create a message id which will be translated msgid = _(u"My text") # Use translate() function to get the final text string translated = self.context.translate(msgid) # translated value is now u"Käännetty teksti" (in Finnish)

Author: