Skip to content

Commit f303da4

Browse files
committed
Fix incomplete Google translation long text #31 #27
1 parent ad0d99e commit f303da4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/com/airsaid/localization/translate/impl/google/GoogleTranslationResult.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ public String toString() {
8585
if (sentences == null || sentences.isEmpty()) {
8686
return "";
8787
}
88-
String trans = sentences.get(0).getTrans();
89-
return trans != null ? trans : "";
88+
StringBuilder result = new StringBuilder();
89+
for (Sentences sentence : sentences) {
90+
String trans = sentence.getTrans();
91+
if (trans != null) result.append(trans);
92+
}
93+
return result.toString();
9094
}
9195

9296
public static class Sentences {

0 commit comments

Comments
 (0)