Skip to content

Instantly share code, notes, and snippets.

@DataSolveProblems
Created June 17, 2019 07:21
Show Gist options
  • Save DataSolveProblems/a3d7bd84aa96e4aef5afe0a4214b5328 to your computer and use it in GitHub Desktop.
Save DataSolveProblems/a3d7bd84aa96e4aef5afe0a4214b5328 to your computer and use it in GitHub Desktop.
import os
from google.cloud import translate
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r'<CLIENT_SECRET.json>'
translate_client = translate.Client()
text = 'Good Morning. GoodBye. And Hello'
target = 'ja'
output = translate_client.translate(
text,
target_language=target)
print(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment