fix: 翻译禁用换行符

This commit is contained in:
xkeyC 2024-11-23 22:04:42 +08:00
parent 82943020f7
commit 4c6a5f7565

View File

@ -166,7 +166,8 @@ class InputMethodDialogUIModel extends _$InputMethodDialogUIModel {
_translateTimer =
Timer(Duration(milliseconds: webMessage ? 1 : 400), () async {
try {
final r = await Api.doGoogleTranslate(sourceText);
final inputText = sourceText.replaceAll("\n", " ");
final r = await Api.doGoogleTranslate(inputText);
if (r != null) {
String resultText = r;
// resultText