By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,758 Members | 1,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,758 IT Pros & Developers. It's quick & easy.

Babelfish translation ...

P: n/a
hello,

I've build a translation tool, to translate all strings in a python
source file.
As a extra gadget I added translation through Babel Fish,
using beautifulsoup.

Although it works functionally,
it can take lots of time waiting for the translation.

What I basically do is, after selecting a new string to be translated:

kwds = { 'trtext' : line_to_be_translated, 'lp' :'en_nl'}
soup = BeautifulSoup (urlopen(url, urlencode ( kwds ) ) )
translation= soup.find ( 'div', style='padding:0.6em;' ).string
self.Editor_Babel.SetLabel ( translation )

I'm using Python 2.5 and wxPython.

Probably I should use a separate thread, but that's above my knowledge.
I could also use a timer to check at regualr intervals when the
translation is ready,
but I've no idea how to implement that with the above code.

thanks,
Stef Mientki
Jul 17 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.