Skip to content

Commit 4e1e08d

Browse files
committed
Fixed language autodetection in Synthesiser. Fix #40
1 parent a358780 commit 4e1e08d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/com/darkprograms/speech/translator/GoogleTranslate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static String getDisplayLanguage(String languageCode){
4848
*/
4949
public static String detectLanguage(String text) throws IOException{
5050
String encoded = URLEncoder.encode(text, "UTF-8"); //Encodes the string
51-
URL url = new URL(GOOGLE_TRANSLATE_URL + encoded); //Generates URL
51+
URL url = new URL(GOOGLE_TRANSLATE_URL + "&text=" + encoded); //Generates URL
5252
String rawData = urlToText(url);//Gets text from Google
5353
return findLanguage(rawData);
5454
}

0 commit comments

Comments
 (0)