Skip to content

Commit

Permalink
自动把分行的句子合并起来再翻译
Browse files Browse the repository at this point in the history
针对Borber#285 的问题修复
  • Loading branch information
pwh-pwh authored Aug 16, 2024
1 parent 8c08e6f commit 6b9ce62
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src-tauri/src/manager/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ pub async fn translate(content: &str) -> Result<TransVO> {
// 转换为 url 编码
let content = utf8_percent_encode(content, NON_ALPHANUMERIC).to_string();

// 将多行合并一行
let content = content.replace('\n', " ").replace('\r', " ");
let host = if config::mode() {
mirror::one()
} else {
Expand Down

0 comments on commit 6b9ce62

Please sign in to comment.