[Zope] i18n from a python script or external method

Josef Meile jmeile at hotmail.com
Mon Sep 15 05:02:38 EDT 2008


Hi,

> However, I have failed to get it to work from a python script or external python method. 
> 
> I have found several different methods via google however none of them work (ie none will translate a msg).
> 
> Can someone please give me a valid method to do this for Zope 2.10 .3 or later. 
I used to use PTS; however, now I'm using five, so, I don't know if my
code still works:

translationService = context.Control_Panel.TranslationService
translation = translationService.translate(domain,msgid)
if translation is None:
   translation = msgid

I think there is a cleaner way of doing this by using the PTS API to get 
the TranslationService object, so, you may look at the source code of 
this product.

Best regards
Josef


More information about the Zope mailing list