Skip to content

Commit

Permalink
added fix for the client as per new lib
Browse files Browse the repository at this point in the history
  • Loading branch information
puneithk committed Nov 14, 2016
1 parent 0ec80c9 commit e582020
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion translate/cloud-client/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def run_quickstart():
api_key = 'YOUR_API_KEY'

# Instantiates a client
translate_client = translate.Client(api_key)
translate_client = translate.Client(api_key=api_key)

# The text to translate
text = u'Hello, world!'
Expand Down
7 changes: 4 additions & 3 deletions translate/cloud-client/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ def translate_text(api_key, target, text, model='base'):

# Text can also be a sequence of strings, in which case this method
# will return a sequence of results for each text.
result = translate_client.translate(text,
target_language=target,
model=model)
result = translate_client.translate(
text,
target_language=target,
model=model)

print(u'Text: {}'.format(result['input']))
print(u'Translation: {}'.format(result['translatedText']))
Expand Down

0 comments on commit e582020

Please sign in to comment.