views:

156

answers:

4

Is there a Python module for the translation of texts from one human language to another? I'm planning to work with texts that are to be pre and post processed with Python scripts. What other Python-integrated approaches can be used?

A: 

The Python Natural Language Toolkit will almost certainly be useful to you:

"Open source Python modules, linguistic data and documentation for research and development in natural language processing"

I don't believe it will do translation directly, but it's great for machine understanding of natural language text.

RichieHindle
+4  A: 

If you're looking to actually translate a string of text between two languages, say from English "Hello" to Spanish "Hola", you might want to look into the Google Language API.

jgeewax
+1  A: 

Python supports gettext. Check out the docs here.

Pinochle
A: 

What to use depends on what you want to translate.

  1. Texts that are a part of your application, like UI etc. Then use gettext directly, or zope.i18n, which wraps gettext so it's easier to use.
  2. Arbitrary texts: The Google Translation API is the thing for you.
  3. "Content", ie things that the user of the application will modify and translate: Well... nothing, really. You have to implement that yourself.

On your description, it sounds like you are after #2.

Lennart Regebro