translate: replace newlines with \n
This commit is contained in:
parent
909bb56b4c
commit
cb1bec6d0b
|
@ -25,6 +25,7 @@ local to="de"
|
|||
local text="${@}"
|
||||
[[ ! -v 1 ]] && text=$(cat -)
|
||||
|
||||
text=${text//$'\n'/'\n'}
|
||||
curl --silent -X POST \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{"q": "'${text}'", "source": "'${from}'", "target": "'${to}'", "format": "text"}' \
|
||||
|
|
Loading…
Reference in New Issue
Block a user