vikassharma27 / google-api-translate-java

Automatically exported from code.google.com/p/google-api-translate-java
0 stars 0 forks source link

0.96 have exception #154

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
i use jdk1.6,google-api-translate-java-0.96-SNAPSHOT.jar

 public static void main(String[] args) throws Exception {
        Translate.setHttpReferrer("http://qiuriyuchen.com");
        GoogleAPI.setKey("ABQIAAAAGuYk5mnoBkmue5dprMuGOBQF78tPPrvZTt73nV0GYqFFoVejohQ3M3fVj87wmvRsNayRPTt6X74xMA");
        String translatedText = Translate.execute("中国", Language.CHINESE, Language.ENGLISH);
        System.out.println(translatedText);
    }
and the exception is:
Exception in thread "main" java.lang.Exception: Google returned the following 
error: [403] Quota Exceeded.  Please see 
http://code.google.com/apis/language/translate/overview.html
    at com.google.api.translate.Translate.getJSONResponse(Translate.java:182)
    at com.google.api.translate.Translate.execute(Translate.java:71)
    at goodenglish.Main.main(Main.java:18)
Java Result: 1

Original issue reported on code.google.com by qiuriyuc...@gmail.com on 3 Nov 2011 at 5:48

GoogleCodeExporter commented 8 years ago
Seems like you've exceeded your quota. I think you can configure your quota 
here: https://code.google.com/apis/console/?api=translate

Either up the allocation for your user, or I think there's an option to pay for 
more usage if you need beyond what you're currently allocated.

Original comment by rich.mid...@gmail.com on 5 Nov 2011 at 5:17

GoogleCodeExporter commented 8 years ago
i exceeded 403 error 
i used jdk1.6,google-api-translate-java-0.95.jar file 

translate.setOnClickListener(new OnClickListener()
{
    public void onClick(View v) 
{
    String string1=et1.getText().toString();
    String translatedText="";
        Language languages[]={Language.TELUGU,Language.CHINESE,Language.ENGLISH,Language.HINDI};
    Translate.setHttpReferrer("http://translate.google.com");
        try {
        translatedText = Translate.execute(string1, languages[x], languages[y]);
        AlertDialog.Builder builder=new AlertDialog.Builder(LangTranslator.this);
        builder.setMessage(translatedText);
        builder.setPositiveButton("ok",new DialogInterface.OnClickListener() {                  
        public void onClick(DialogInterface dialog, int which) 
{
            // TODO Auto-generated method stub
        dialog.cancel();
}
});

and the exception is:
Exception in thread "main" java.lang.Exception: Google returned the following 
error: [403] Quota Exceeded.  Please see 
http://code.google.com/apis/language/translate/overview.html

Original comment by sweeet.a...@gmail.com on 23 Nov 2011 at 7:09