
translate: Fix translate bug fix
- Change length limit 4800 to 4500 - Fix merge chunk logical error
@86b11ee12c4a56679ef0f0477af537d02cb14d45
--- app/controllers/api/IssueApi.java
+++ app/controllers/api/IssueApi.java
... | ... | @@ -87,7 +87,7 @@ |
87 | 87 |
public static String TRANSLATION_API = play.Configuration.root().getString("application.extras.translation.api", ""); |
88 | 88 |
public static String TRANSLATION_HEADER_KEY = play.Configuration.root().getString("application.extras.translation.headerKey", ""); |
89 | 89 |
public static String TRANSLATION_HEADER_VALUE = play.Configuration.root().getString("application.extras.translation.headerValue", ""); |
90 |
- public static final int TRANSLATE_TEXT_LENGTH_LIMIT = 4800; |
|
90 |
+ public static final int TRANSLATE_TEXT_LENGTH_LIMIT = 4500; |
|
91 | 91 |
public static final String NEWLINE = "\r\n"; |
92 | 92 |
|
93 | 93 |
@Transactional |
... | ... | @@ -986,7 +986,6 @@ |
986 | 986 |
|
987 | 987 |
private static List<String> merge(List<String> texts) { |
988 | 988 |
|
989 |
- |
|
990 | 989 |
List<String> results = new ArrayList<>(); |
991 | 990 |
|
992 | 991 |
int chunkLength = 0; |
... | ... | @@ -999,8 +998,9 @@ |
999 | 998 |
chunkLength += text.length(); |
1000 | 999 |
} else { |
1001 | 1000 |
results.add(chunk); |
1002 |
- chunk = ""; |
|
1003 |
- chunkLength = 0; |
|
1001 |
+ chunk = text; |
|
1002 |
+ chunk += NEWLINE; |
|
1003 |
+ chunkLength = text.length(); |
|
1004 | 1004 |
} |
1005 | 1005 |
} |
1006 | 1006 |
results.add(chunk); |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?