Skip to content

Commit

Permalink
fix: 翻译禁用换行符
Browse files Browse the repository at this point in the history
  • Loading branch information
xkeyC committed Nov 23, 2024
1 parent 8294302 commit 4c6a5f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ui/home/input_method/input_method_dialog_ui_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 首字母大写
Expand Down

0 comments on commit 4c6a5f7

Please sign in to comment.