Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9482f21

Browse files
committed
Fixed bug
Now it will return all sentences.
1 parent6368049 commit9482f21

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,14 @@ public static String translate(String sourceLanguage , String targetLanguage , S
154154
if (raw.length <2) {
155155
returnnull;
156156
}
157-
returnraw[1];//Returns the translation
157+
JSONArrayarr =newJSONArray(rawData);
158+
JSONArrayarr1 =arr.getJSONArray(0);
159+
StringBuildertrans =newStringBuilder();
160+
for (inti =0;i <arr1.length();i++) {
161+
JSONArrayarr2 =arr1.getJSONArray(i);
162+
trans.append(arr2.get(0).toString());
163+
}
164+
returntrans.toString();//Returns the translation
158165
}
159166

160167
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp