Babelfish translation ...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stef Mientki

    Babelfish translation ...

    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_tran slated, 'lp' :'en_nl'}
    soup = BeautifulSoup (urlopen(url, urlencode ( kwds ) ) )
    translation= soup.find ( 'div', style='padding: 0.6em;' ).string
    self.Editor_Bab el.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
Working...