You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
curl "https://translation.googleapis.com/language/translate/v2" \
-H "Authorization: Bearer $key" \
-s -X POST -H "Content-Type: application/json" \
--data "{ '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': 'ja', 'format': 'text' }"
Google翻訳APIをシェルスクリプトで叩いて英語を日本語に翻訳する。ほとんど公式チュートリアルのまま。
Google Translate API を有効化しておく
チュートリアルのとおりに。
https://cloud.google.com/translate/docs/quickstart
トークンの取得
Google Cloud の認証トークンを gcloud コマンドで取得する。環境変数でサービスアカウントファイルを指定する例。 · Issue #545 · YumaInaura/YumaInaura
Script
結果
Ref
Cloud Translation API ドキュメント | Cloud Translation API | Google Cloud
クイックスタート | Cloud Translation API | Google Cloud
The text was updated successfully, but these errors were encountered: