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 = _translateTimer =
Timer(Duration(milliseconds: webMessage ? 1 : 400), () async { Timer(Duration(milliseconds: webMessage ? 1 : 400), () async {
try { try {
final r = await Api.doGoogleTranslate(sourceText); final inputText = sourceText.replaceAll("\n", " ");
final r = await Api.doGoogleTranslate(inputText);
if (r != null) { if (r != null) {
String resultText = r; String resultText = r;
// resultText // resultText