Skip to content

Commit

Permalink
remove URLs before send text to tranlation API
Browse files Browse the repository at this point in the history
  • Loading branch information
sl5net committed Sep 8, 2023
1 parent ef1a292 commit 2b335bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gui/common/functions_utility~autociv.js
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,8 @@ function sendChatTranslated(guiObject, text, sourceLanguage, targetLanguage) {
}
text = text.replace(/\[\n\t\r\s\W]+/gi, ' ')

// dont send links to tranlater api
text = text.replace(/[^\s]+:\/\/[^\s]+/gi, '…')

const explainTranslation = `its translation from ${sourceLanguage} to ${targetLanguage} last lines`

Expand Down

0 comments on commit 2b335bc

Please sign in to comment.