diff --git a/.config/zsh/functions/translate b/.config/zsh/functions/translate index 848ea5f..7786575 100755 --- a/.config/zsh/functions/translate +++ b/.config/zsh/functions/translate @@ -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"}' \