Finding translations in code

2 messages Options
Embed this post
Permalink
askvictor

Finding translations in code

Reply Threaded More More options
Print post
Permalink
Hi,

The product I'm developing creates a certain amount of content when it
is installed. I would like for this content to have translations
installed as well. The way I envisage this happening is the installer
script creates an object, then tries to find all possible translations
for that object. For each translation found in my translation domain,
it creates a LinguaPlone translation of that object. But I'm having
trouble finding a function that will find me all the available
translations for an string in a particular domain.

Can anyone point me in the right direction?

Cheers,

Victor

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plone-i18n mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-i18n
Vincent Fretin

Re: Finding translations in code

Reply Threaded More More options
Print post
Permalink
Hi,

I think the code you are looking for is in translationdomain.py in zope.i18n.
Each i18n domain is registered as named ITranslationDomain utility.
You should try:
getUtility(ITranslationDomain, 'yourdomain').getCatalogsInfo()


Vincent Fretin
Ecreall
Site : http://vincentfretin.ecreall.com


On Fri, Aug 21, 2009 at 4:21 AM, victor rajewski <[hidden email]> wrote:
Hi,

The product I'm developing creates a certain amount of content when it
is installed. I would like for this content to have translations
installed as well. The way I envisage this happening is the installer
script creates an object, then tries to find all possible translations
for that object. For each translation found in my translation domain,
it creates a LinguaPlone translation of that object. But I'm having
trouble finding a function that will find me all the available
translations for an string in a particular domain.

Can anyone point me in the right direction?

Cheers,

Victor

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plone-i18n mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-i18n


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plone-i18n mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-i18n