From 4c6a5f7565067552fcc0e514ee14e0dbe7f95f1a Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Sat, 23 Nov 2024 22:04:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BF=BB=E8=AF=91=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/home/input_method/input_method_dialog_ui_model.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ui/home/input_method/input_method_dialog_ui_model.dart b/lib/ui/home/input_method/input_method_dialog_ui_model.dart index 9ffe101..be0cb62 100644 --- a/lib/ui/home/input_method/input_method_dialog_ui_model.dart +++ b/lib/ui/home/input_method/input_method_dialog_ui_model.dart @@ -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 首字母大写