My favorites | Sign in
Project Logo
                
People details
Project owners:
  rich.midwinter

Provides a simple, unofficial, Java client API for using Google Translate.

News

Version 0.5 was mistakenly compiled against a version 6 JDK. It's now compiled against a version 5 JDK again. Apologies to anyone affected by that.

Install

Simply include the google-api-translate-java.jar file in your application's classpath.

Quickstart

This is our "Hello World" example:

import com.google.api.translate.Language;
import com.google.api.translate.Translate;

public class Main {
  public static void main(String[] args) {
    try {
      String translatedText = Translate.translate("Bonjour le monde", Language.FRENCH, Language.ENGLISH);
      System.out.println(translatedText);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
}

Well done. You're now an expert in using this API! The wiki has a more complete example usage within a desktop application.

Features

Automatically throttles repeated queries to within Google limits.

Uses English as an intermediate language to attempt translations between language pairings that are unsupported directly by Google Translate.

Now available via a Maven plugin.

Problems / Suggestions?

Please do report an issue if you find any bugs or have any feature requests.









Hosted by Google Code