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