Re: FormEncode i18n translation integration in TurboGears

Ian Bicking <[email protected]>
Newsgroups gmane.comp.python.formencode,gmane.comp.web.turbogears
Message-ID <[email protected]>
Gregor Horvath wrote:
> Ian Bicking schrieb:
> 
>> That would be fine, but for this case we might also just put
>> "gettext_domain='FormEncode'" into the class too, no?  It seems
>> reasonable to set the domain to 'FormEncode' by default.
>>
> 
> yes, but the standard gettext function does not accept a domain argument
> like the TG gettext function does. Instead the domain is definied at
> creation time of the translation object:
> 
> import gettext # standard
> t = gettext.translation(domain='FormEncode', \
>                             languages=None, \
>                             fallback=True)
> _stdtrans = t.ugettext

Ah.  OK then, your strategy sounds right then.  Though I guess it means 
that TG will have to do:

   Validator.gettextargs['domain'] = 'FormEncode'

?  I.e., it will have to TGify the Validator class on startup.

How does the turgogears.mo file get generated?  Is it every translatable 
string in TG?  Or is it every translatable string in the individual 
project?  If it's just the project itself, then an extraction process 
that understands validators and schemas could do it.  If not, then 
people will have to carefully look at their code to see what portion of 
FormeEncode.mo needs to be translated (assuming they don't feel like 
translating the entire thing, though I suppose contributors could 
translate it and distribute the entire translation with FormEncode itself).

If FormEncode does start distributing translations, I should say that I 
don't really want to manage that process, though I'm more than happy to 
give someone access to manage that.


-- 
Ian Bicking | [email protected] | http://blog.ianbicking.org

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.