Git Product home page Git Product logo

microsoft-translator-java-api's People

Contributors

boatmeme avatar

microsoft-translator-java-api's Issues

Library hangs on second usage on Android

What steps will reproduce the problem?
1) Use the translator in an Android app(tested on 4.1.1)
2) Wait 2-3 minutes and use again
3) Library will hang on:
final int responseCode = uc.getResponseCode();
File: MicrosoftTranslatorAPI.java
Line: 177

What is the expected output? What do you see instead?
Response code will be transmitted successfully and the library will return a 
result.

What version of the product are you using? On what operating system?
Latest Github fork

Please provide any additional information below.
Probably related to the connection not closing correctly, but code seems fine 
for closing a HttpURLConnection.

Using the library again makes it work successfully. Waiting another 2-3 minutes 
makes it get stuck again, and vice versa.

Original issue reported on code.google.com by [email protected] on 19 Nov 2013 at 2:19

Function Translate() returns: "android.widget.EditText@b74a0218"

What steps will reproduce the problem?
1.
2.
3.



What is the expected output? What do you see instead?
I excepted the Translated Text




What version of the product are you using? On what operating system?
I try with the versions: 0.3, 0.4, 0.6.1 and 0.6.2 on Android 2.3.3 and 4.2.2. 
The same issue...




Please provide any additional information below.


###In AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET"/>



###And in Main.java:


import android.os.Bundle;
import android.app.Activity;
import android.widget.Button;
import android.widget.EditText;
import android.view.View;
import android.view.View.OnClickListener;

import com.memetix.mst.language.Language;
import com.memetix.mst.translate.Translate;


public class Principal extends Activity {

    private Button btraducir;
    private EditText eentrada;
    private EditText esalida;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_principal);


        btraducir = (Button) findViewById(R.id.bTraducir);
        eentrada = (EditText) findViewById(R.id.eEntrada);
        esalida = (EditText) findViewById(R.id.eSalida);

        btraducir.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (eentrada.length() == 0) {
                    esalida.setText("No hay texo para traducir.");
                }
                else {
                    String textotraducido = "";
                    String textoatraducir = eentrada.toString();

                    Translate.setHttpReferrer("<MyReferrer>");
                    Translate.setKey("<MyKey>");

                    try {
                        textotraducido = Translate.execute(textoatraducir, Language.ENGLISH, Language.SPANISH);
                    }
                    catch (Exception e)
                    {
                        textotraducido = e.toString();
                    }
                    esalida.setText(textotraducido);
                }
            }   
        });

    }

}


Please Help!. Thanks in advance.

Original issue reported on code.google.com by [email protected] on 26 Mar 2013 at 5:38

Attachments:

Exception when text contains "\n"

What steps will reproduce the problem?
Translate text with \n
For example, "This is a test.\nThis is a test."

What is the expected output? What do you see instead?

java.lang.Exception: [microsoft-translator-api] Error retrieving translation.
    at com.memetix.mst.MicrosoftTranslatorAPI.retrieveStringArr(MicrosoftTranslatorAPI.java:220)
    at com.memetix.mst.translate.Translate.execute(Translate.java:101)
    at translator.BingTranslator.translate(BingTranslator.java:28)
    at translator.BingTranslator.main(BingTranslator.java:40)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to 
org.json.simple.JSONArray
    at com.memetix.mst.MicrosoftTranslatorAPI.jsonToStringArr(MicrosoftTranslatorAPI.java:273)
    at com.memetix.mst.MicrosoftTranslatorAPI.retrieveStringArr(MicrosoftTranslatorAPI.java:218)
    ... 3 more

What version of the product are you using? On what operating system?
0.6.2
windows 7

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 27 Nov 2013 at 7:48

It does not implement the new Windows Azure with odata api

It cannot be used for odata and azure services, it seems that only the "already 
almost deprecated" way has been implemented.


It should implement the actual Windows Azure api for translate, since the old 
one will not be supported any more. These is from Microsoft:

"On September 14, 2011 at the BUILD conference, Microsoft President Satya 
Nadella announced the availability of the Microsoft Translator API through 
Windows Azure Marketplace, a tiered pricing structure and the availability of a 
new OData API end-point."

"For existing partners (those with an active Translator AppID as of September 
14, 2011) you can continue to access the Microsoft Translator API directly from 
http://api.microsofttranslator.com without any interruption or change to 
existing throughput levels. For those of you who have an active commercial 
license, Microsoft will extend the terms and conditions of your license, and 
your existing throughput limits, through September 30, 2012. For those of you 
who have not signed a commercial license but have been using the Translator API 
for testing or non-commercial purposes (“non-commercial partners”), you can 
continue using the Translator API through the earlier access mechanisms through 
March 31, 2012."



Original issue reported on code.google.com by [email protected] on 15 Nov 2011 at 11:51

android 4.0.3 can't use this

What steps will reproduce the problem?
1.using api 0.6.1 version  can't get language.getname(language.french) for     
android 4.0, Why I used android 2.3.3 This error does not occur, but the 
android 4.0 error,please tell me how to fix this !! thanks . 


What is the expected output? What do you see instead?
log.error::[microsoft-translator-api] Error retrieving translation.

What version of the product are you using? On what operating system?
android 4.0



Original issue reported on code.google.com by [email protected] on 7 Sep 2012 at 3:19

relax Language to String

Current Language is Enum. JP is not supported. But it seems bing support JP 
right now. I suggest relax Language as String so that when Bing supports new 
lanaguage, API is not needed to change.


Original issue reported on code.google.com by [email protected] on 3 Sep 2013 at 3:19

API does not work with Android version 4.0.4

What steps will reproduce the problem?
1. Call Translate.execute(      evWord2Name.getText().toString(), 
mappingLang[0],mappingLang[1]);         
2. Produces URI: 
http://api.microsofttranslator.com/V2/Ajax.svc/Translate?appId=MY_API_ID&from=de
&to=it&text=test
3.

What is the expected output? What do you see instead?
If I call the URI in Chrome it is "prova".

In Java I got an error like:
java.lang.Exception: [microsoft-translator-api] Error retrieving translation : 
null

What version of the product are you using? On what operating system?

microsoft-translator-java-api-0.4-jar-with-dependencies.jar
Android 4.0.4 produces an error.
In Android Version 2.3.6 and older the API still works fine.

Please provide any additional information below.

Maybe something with the HTTP request/methods has changed in Android 4.0.4. I 
would really appreciate it if you could fix this. You API is so great. Thanks 
in advance.

Cheers.

Original issue reported on code.google.com by [email protected] on 21 Apr 2012 at 1:30

Error 400

What steps will reproduce the problem?
1. Execute first example with my client id and secret id


What is the expected output? What do you see instead?
Translate OK

What version of the product are you using? On what operating system?
Last all dependence


Please provide any additional information below.

dic 01, 2013 12:40:55 PM raiderz.main.RaiderzTraduccion main
Grave: null
java.lang.Exception: [microsoft-translator-api] Error retrieving translation : 
Server returned HTTP response code: 400 for URL: 
https://datamarket.accesscontrol.windows.net/v2/OAuth2-13
    at com.memetix.mst.MicrosoftTranslatorAPI.retrieveString(MicrosoftTranslatorAPI.java:202)


Original issue reported on code.google.com by [email protected] on 1 Dec 2013 at 3:44

[microsoft-translator-api] Error retrieving translation : Connection refused

What steps will reproduce the problem?
1. When I start the example to detect my input language


What is the expected output? What do you see instead?
[microsoft-translator-api] Error retrieving translation : Connection refused: 
connect


What version of the product are you using? On what operating system?
0.4 

Please provide any additional information below.

Thanks in advance

Original issue reported on code.google.com by [email protected] on 6 Dec 2011 at 5:09

Multi text Input is not working

What steps will reproduce the problem?
1. Enter ClientId/Client Secret
2. Give input as String[] of values with different language texts.
3. Now Execute,not all text are translated.

What is the expected output? What do you see instead?
Input:[¡hola, Prénoms français, Hallo]
Actual Result translatedText:[¡Hola, French names, Hallo]

Expected Result:[Hello, French surnames, Hello]

What version of the product are you using? On what operating system?
microsoft-translator-java-api-0.6.1-jar-with-dependencies

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 30 Jan 2013 at 8:47

You shoud allow the setting of the content-type... it is now hardcoded into the class to plain/text , which is not good

You should allow the setting of the content-type... it is now hardcoded into 
the class to plain/text , which is not good. One should be able to set it as it 
wishes. 

This is a problem description:

http://social.microsoft.com/Forums/en-US/translator/thread/fa4063eb-3cf9-4b0b-87
2c-849623256d71

Meanwhile I am downloading the sources and will do it myself (set a global 
static variable just as the appid key, to be set when needed)

Regards.

[email protected]

Original issue reported on code.google.com by [email protected] on 9 Nov 2011 at 6:09

Bug on method Translate.execute

An exception is thrown when the text to translate starts with the " character 
in the method "Translate.execute".
Example: Translate.execute("/"Test", inputLanguage, outputLanguage);
Error: There was an error deserializing the object of type System.String. 
Unexpected end of file. Following elements are not closed: root.
Version: 0.5

Original issue reported on code.google.com by [email protected] on 15 Jan 2012 at 12:21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.