Skip to content
Java wrapper for the Google Translate service
Latest commit 4fa224b Aug 9, 2015 @richmidwinter Merge pull request #8 from epylar/fix-detect-and-tests
Fix tests, update Detect to v2, support referrer in tests


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


Small library size - less than 50Kb.

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

The jar is runnable and has a very lightweight GUI to demonstrate translation functionality.



public class Main {
  public static void main(String[] args) throws Exception {
    // Set the HTTP referrer to your website address.
    GoogleAPI.setHttpReferrer(/* Enter the URL of your site here */);

    // Set the Google Translate API key
    // See:
    GoogleAPI.setKey(/* Enter your API key here */);

    String translatedText = Translate.DEFAULT.execute("Bonjour le monde", Language.FRENCH, Language.ENGLISH);

Something went wrong with that request. Please try again.