1 개요
Bash
Copy
export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/my-key.json"
cat <<EOF > request.json
{
"q": "The Great Pyramid of Giza (also known as the Pyramid of Khufu or the Pyramid of Cheops) is the oldest and largest of the three pyramids in the Giza pyramid complex.",
"source": "en",
"target": "ko",
"format": "text"
}
EOF
curl -X POST \
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
https://translation.googleapis.com/language/translate/v2
Console
Copy
testuser@localhost:~$ sh test.sh
{
"data": {
"translations": [
{
"translatedText": "기자의 피라미드 (Khufu의 피라미드 또는 Cheops의 피라미드라고도 함)는 기자 피라미드 단지에있는 세 피라미드 중 가장 오래되고 가장 큰 피라미드입니다."
}
]
}
}
2 같이 보기
3 참고
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.