Skip to content

Commit eb81fac

Browse files
committed
Remove API key from Translate usage docs.
1 parent 455eaf6 commit eb81fac

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

docs/translate-usage.rst

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@ Authentication / Configuration
1313
- Use :class:`~google.cloud.translate.client.Client` objects to configure
1414
your applications.
1515

16-
- :class:`~google.cloud.translate.client.Client` objects hold both a ``key``
17-
and a connection to the Cloud Translation service.
18-
19-
- **An API key is required for Google Cloud Translation.** See
20-
`Identifying your application to Google`_ for details. This is
21-
significantly different than the other clients in ``google-cloud-python``.
16+
- :class:`~google.cloud.translate.client.Client` objects hold
17+
a connection to the Cloud Translation service.
2218

2319
Methods
2420
-------
@@ -28,7 +24,7 @@ To create a client:
2824
.. code::
2925
3026
>>> from google.cloud import translate
31-
>>> client = translate.Client('my-api-key')
27+
>>> client = translate.Client()
3228
3329
By default, the client targets English when doing detections
3430
and translations, but a non-default value can be used as
@@ -37,7 +33,7 @@ well:
3733
.. code::
3834
3935
>>> from google.cloud import translate
40-
>>> client = translate.Client('my-api-key', target_language='es')
36+
>>> client = translate.Client(target_language='es')
4137
4238
The Google Cloud Translation API has three supported methods, and they
4339
map to three methods on a client:
@@ -50,7 +46,7 @@ To get a list of languages supported by the Google Cloud Translation API
5046
.. code::
5147
5248
>>> from google.cloud import translate
53-
>>> client = translate.Client('my-api-key')
49+
>>> client = translate.Client()
5450
>>> client.get_languages()
5551
[
5652
{
@@ -65,7 +61,7 @@ To detect the language that some given text is written in:
6561
.. code::
6662
6763
>>> from google.cloud import translate
68-
>>> client = translate.Client('my-api-key')
64+
>>> client = translate.Client()
6965
>>> client.detect_language(['Me llamo', 'I am'])
7066
[
7167
{
@@ -88,7 +84,7 @@ To translate text:
8884
.. code::
8985
9086
>>> from google.cloud import translate
91-
>>> client = translate.Client('my-api-key')
87+
>>> client = translate.Client()
9288
>>> client.translate('koszula')
9389
{
9490
'translatedText': 'shirt',
@@ -101,7 +97,7 @@ or to use a non-default target language:
10197
.. code::
10298
10399
>>> from google.cloud import translate
104-
>>> client = translate.Client('my-api-key')
100+
>>> client = translate.Client()
105101
>>> client.translate(['Me llamo Jeff', 'My name is Jeff'],
106102
... target_language='de')
107103
[

0 commit comments

Comments
 (0)