|
1 |
| -.. This file is automatically generated. Do not edit this file directly. |
| 1 | +These samples have been moved. |
2 | 2 |
|
3 |
| -Google Translation API Python Samples |
4 |
| -=============================================================================== |
5 |
| - |
6 |
| -.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
7 |
| - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=translate/cloud-client/README.rst |
8 |
| - |
9 |
| - |
10 |
| -This directory contains samples for Google Translation API. With `Google Translation API`, you can dynamically translate text between thousands of language pairs. |
11 |
| - |
12 |
| - |
13 |
| - |
14 |
| - |
15 |
| -.. _Google Translation API: https://cloud.google.com/translate/docs |
16 |
| - |
17 |
| -Setup |
18 |
| -------------------------------------------------------------------------------- |
19 |
| - |
20 |
| - |
21 |
| -Authentication |
22 |
| -++++++++++++++ |
23 |
| - |
24 |
| -This sample requires you to have authentication setup. Refer to the |
25 |
| -`Authentication Getting Started Guide`_ for instructions on setting up |
26 |
| -credentials for applications. |
27 |
| - |
28 |
| -.. _Authentication Getting Started Guide: |
29 |
| - https://cloud.google.com/docs/authentication/getting-started |
30 |
| - |
31 |
| -Install Dependencies |
32 |
| -++++++++++++++++++++ |
33 |
| - |
34 |
| -#. Clone python-docs-samples and change directory to the sample directory you want to use. |
35 |
| - |
36 |
| - .. code-block:: bash |
37 |
| -
|
38 |
| - $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git |
39 |
| -
|
40 |
| -#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. |
41 |
| - |
42 |
| - .. _Python Development Environment Setup Guide: |
43 |
| - https://cloud.google.com/python/setup |
44 |
| - |
45 |
| -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. |
46 |
| - |
47 |
| - .. code-block:: bash |
48 |
| -
|
49 |
| - $ virtualenv env |
50 |
| - $ source env/bin/activate |
51 |
| -
|
52 |
| -#. Install the dependencies needed to run the samples. |
53 |
| - |
54 |
| - .. code-block:: bash |
55 |
| -
|
56 |
| - $ pip install -r requirements.txt |
57 |
| -
|
58 |
| -.. _pip: https://pip.pypa.io/ |
59 |
| -.. _virtualenv: https://virtualenv.pypa.io/ |
60 |
| - |
61 |
| -Samples |
62 |
| -------------------------------------------------------------------------------- |
63 |
| - |
64 |
| -Quickstart |
65 |
| -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
66 |
| - |
67 |
| -.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
68 |
| - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=translate/cloud-client/quickstart.py,translate/cloud-client/README.rst |
69 |
| - |
70 |
| - |
71 |
| - |
72 |
| - |
73 |
| -To run this sample: |
74 |
| - |
75 |
| -.. code-block:: bash |
76 |
| -
|
77 |
| - $ python quickstart.py |
78 |
| -
|
79 |
| -
|
80 |
| -Snippets |
81 |
| -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
82 |
| - |
83 |
| -.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
84 |
| - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=translate/cloud-client/snippets.py,translate/cloud-client/README.rst |
85 |
| - |
86 |
| - |
87 |
| - |
88 |
| - |
89 |
| -To run this sample: |
90 |
| - |
91 |
| -.. code-block:: bash |
92 |
| -
|
93 |
| - $ python snippets.py |
94 |
| -
|
95 |
| - usage: snippets.py [-h] |
96 |
| - {detect-language,list-languages,list-languages-with-target,translate-text} |
97 |
| - ... |
98 |
| -
|
99 |
| - This application demonstrates how to perform basic operations with the |
100 |
| - Google Cloud Translate API |
101 |
| -
|
102 |
| - For more information, the documentation at |
103 |
| - https://cloud.google.com/translate/docs. |
104 |
| -
|
105 |
| - positional arguments: |
106 |
| - {detect-language,list-languages,list-languages-with-target,translate-text} |
107 |
| - detect-language Detects the text's language. |
108 |
| - list-languages Lists all available languages. |
109 |
| - list-languages-with-target |
110 |
| - Lists all available languages and localizes them to |
111 |
| - the target language. Target must be an ISO 639-1 |
112 |
| - language code. See https://g.co/cloud/translate/v2 |
113 |
| - /translate-reference#supported_languages |
114 |
| - translate-text Translates text into the target language. Target must |
115 |
| - be an ISO 639-1 language code. See |
116 |
| - https://g.co/cloud/translate/v2/translate- |
117 |
| - reference#supported_languages |
118 |
| -
|
119 |
| - optional arguments: |
120 |
| - -h, --help show this help message and exit |
121 |
| -
|
122 |
| -
|
123 |
| -
|
124 |
| -Beta Snippets |
125 |
| -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
126 |
| -
|
127 |
| -.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
128 |
| - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=translate/cloud-client/beta_snippets.py,translate/cloud-client/README.rst |
129 |
| -
|
130 |
| -
|
131 |
| -
|
132 |
| -
|
133 |
| -To run this sample: |
134 |
| -
|
135 |
| -.. code-block:: bash |
136 |
| -
|
137 |
| - $ python beta_snippets.py |
138 |
| -
|
139 |
| - usage: beta_snippets.py [-h] |
140 |
| - {translate-text,batch-translate-text,detect-language,list-languages,list-languages-with-target,create-glossary,get-glossary,list-glossaries,delete-glossary,translate-with-glossary} |
141 |
| - ... |
142 |
| -
|
143 |
| - positional arguments: |
144 |
| - {translate-text,batch-translate-text,detect-language,list-languages,list-languages-with-target,create-glossary,get-glossary,list-glossaries,delete-glossary,translate-with-glossary} |
145 |
| - translate-text |
146 |
| - batch-translate-text |
147 |
| - detect-language |
148 |
| - list-languages |
149 |
| - list-languages-with-target |
150 |
| - create-glossary |
151 |
| - get-glossary |
152 |
| - list-glossaries |
153 |
| - delete-glossary |
154 |
| - translate-with-glossary |
155 |
| -
|
156 |
| - optional arguments: |
157 |
| - -h, --help show this help message and exit |
158 |
| -
|
159 |
| -
|
160 |
| -
|
161 |
| -
|
162 |
| -
|
163 |
| -The client library |
164 |
| -------------------------------------------------------------------------------- |
165 |
| -
|
166 |
| -This sample uses the `Google Cloud Client Library for Python`_. |
167 |
| -You can read the documentation for more details on API usage and use GitHub |
168 |
| -to `browse the source`_ and `report issues`_. |
169 |
| -
|
170 |
| -.. _Google Cloud Client Library for Python: |
171 |
| - https://googlecloudplatform.github.io/google-cloud-python/ |
172 |
| -.. _browse the source: |
173 |
| - https://github.com/GoogleCloudPlatform/google-cloud-python |
174 |
| -.. _report issues: |
175 |
| - https://github.com/GoogleCloudPlatform/google-cloud-python/issues |
176 |
| -
|
177 |
| -
|
178 |
| -.. _Google Cloud SDK: https://cloud.google.com/sdk/ |
| 3 | +https://github.com/googleapis/python-translate/tree/master/samples |
0 commit comments