views:

54

answers:

3

Hi Everyone

I was just wondering if any of you knew of a free to use api which can translate strings from english to different languages. My program outputs certain text to users from different demographics. I was hoping there would be a translater API. This is not a webapplication ,it is an application that runs via the console.

Thanks in advance :D.

+3  A: 

Would the Google Translate API do?

http://translate.google.com/translate_tools?hl=en&layout=1&eotf=1

Thorbjørn Ravn Andersen
I read about it. I was confused whether or not that api was only for web applications.
Bilzac
It is only for web applications.
Justian Meyer
+1  A: 

After some searching, I uncovered this: http://code.google.com/p/google-api-translate-java/ .

Looks like something that could be of use to you ;).


Some useful notes:

  • This method accesses Google Translator through the web to retrieve your desired information, so retrieving information may be slower/quicker based upon internet speed
  • Don't be fooled when they ask for HTTP Referrer. This code is still for use in both java Applets/Applications, so you don't have to post it on a website to function.
Justian Meyer
+1  A: 

You should also look into internationalization:

http://www.objectsource.com/j2eechapters/Ch19-I18N_and_L10N.htm

So rather than translating strings on the fly, you build out locale definitions to display messages to users. It can be very tedious to create all of these resource strings, but it works far better than on the fly translation.

Freiheit
Easy and better way to internationalize: http://attesoro.org/ . Supports foreign characters.
Justian Meyer