Skip to content

Commit e582020

Browse files
committed
added fix for the client as per new lib
1 parent 0ec80c9 commit e582020

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

translate/cloud-client/quickstart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def run_quickstart():
2424
api_key = 'YOUR_API_KEY'
2525

2626
# Instantiates a client
27-
translate_client = translate.Client(api_key)
27+
translate_client = translate.Client(api_key=api_key)
2828

2929
# The text to translate
3030
text = u'Hello, world!'

translate/cloud-client/snippets.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ def translate_text(api_key, target, text, model='base'):
7373

7474
# Text can also be a sequence of strings, in which case this method
7575
# will return a sequence of results for each text.
76-
result = translate_client.translate(text,
77-
target_language=target,
78-
model=model)
76+
result = translate_client.translate(
77+
text,
78+
target_language=target,
79+
model=model)
7980

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

0 commit comments

Comments
 (0)