mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-18 00:30:40 -07:00
fix: newline of message in argostranslate need to be replaced with \n
This commit is contained in:
parent
898ac53b97
commit
6b930d27f8
@ -8,6 +8,7 @@ import (
|
|||||||
"gtt/internal/lock"
|
"gtt/internal/lock"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -61,7 +62,10 @@ func (t *ArgosTranslate) Translate(message string) (
|
|||||||
bytes.NewBuffer([]byte(fmt.Sprintf(`{
|
bytes.NewBuffer([]byte(fmt.Sprintf(`{
|
||||||
"q": "%s",
|
"q": "%s",
|
||||||
"source": "%s",
|
"source": "%s",
|
||||||
"target": "%s" }`, message, langCode[t.srcLang], langCode[t.dstLang]))))
|
"target": "%s" }`,
|
||||||
|
strings.Replace(message, "\n", `\n`, -1),
|
||||||
|
langCode[t.srcLang],
|
||||||
|
langCode[t.dstLang]))))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", "", err
|
return "", "", "", err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user