Results 1 to 5 of 5
  1. #1
    raghavi is offline Member
    Join Date
    Mar 2014
    Posts
    2
    Rep Power
    0

    Default language translation

    hi,
    I want to use google translate api to translate language from one language to another...
    can anyone help me how to use it...

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    946
    Rep Power
    2

    Default Re: language translation

    - Study the API: https://developers.google.com/translate/v2/using_rest
    - Create a Java REST client: https://jersey.java.net/
    - ?
    - Profit
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    raghavi is offline Member
    Join Date
    Mar 2014
    Posts
    2
    Rep Power
    0

    Default Re: language translation

    hi,I have included a jar file- google-translate-api-java 0.97.jar and this is my code...

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

    public class Main {
    public static void main(String[] args) throws Exception {

    Translate.setHttpReferrer("http://code.google.com/p/google-api-translate-java");
    String translatedText = Translate.execute("Bonjour monde le",Language.FRENCH, Language.ENGLISH);
    System.out.println(translatedText);
    }

    }

    and I got the following error

    Exception in thread "main" java.lang.RuntimeException: Uncompilable source code

    how to clear it???? thanks in advance

  4. #4
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Posts
    219
    Rep Power
    1

    Default Re: language translation

    See google-api-translate-java - Enables using Google Translate from a Java application - Google Project Hosting for an example of how to use the API.

    Note that you'll need a Google Translate API key, and according to the terms of service at the Google APIs console,
    The Google Translate API is provided to you without any free usage quota at all. You will be charged for each successful request you make through the Translate API.

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: language translation

    Uncompilable source code
    That looks like the IDE is skipping over compiler error(s) and trying to execute the code anyways.
    Try compiling the code with the javac compiler to get the compiler's error messages to see what the problem is.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Compilator translation
    By claudiocarcaci in forum Advanced Java
    Replies: 14
    Last Post: 07-31-2012, 12:40 PM
  2. Language Translation using Google API
    By anuramoh in forum Java Applets
    Replies: 1
    Last Post: 07-25-2012, 09:07 PM
  3. Language translation
    By archanaanbu in forum Java Applets
    Replies: 13
    Last Post: 02-19-2011, 06:56 PM
  4. Language translation
    By archanaanbu in forum Java Applets
    Replies: 0
    Last Post: 02-09-2011, 05:21 AM
  5. Replies: 5
    Last Post: 08-25-2009, 09:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •