Skip to content

Commit

Permalink
Translation v3beta1 samples [(#2084)](GoogleCloudPlatform/python-docs…
Browse files Browse the repository at this point in the history
…-samples#2084)

* Add in progress beta snippets

Change-Id: I2cd8ddc2307a8e40d56ce7e493749dc05c34d164

* Add google-cloud-storage dependency

Change-Id: Iff7bc9b2c82b1e829580a3d4ad628087dbeee8be

* Non-'global' location required for BatchTranslateText

Change-Id: I5198aa6368a088e8f5ee295dc55a5e9e4ca8f494

* Upgrade google-cloud-translate to 1.4.0

1.4.0 includes the new v3beta1 alongside V2

Change-Id: I5adfe78ea7e78d84678db343cd84516e3d05491f

* Update Translate samples

You can now provide your own glossary ID

The tests now run within a randomly created bucket (deleted after each
test)

Change-Id: I5cb2680cd0e9e43c85932a6a0dc19e6fab5008c5

* pytest.fixture for random test bucket

Change-Id: I8e816ed4c95a6235347a29849044b4cab02d40a8

* flake8 spec fixes

Change-Id: I4932bcf856a9498b01d9661c90c6b45ee2958ee1

* Added pytest fixture for creating glossary (WIP)

Change-Id: Iddb5ecbf0eefb9efd2243dc4bc56b585102e9351

* Add assertions, remove placeholder TODOs

Change-Id: If1eb20bca5bfcc87dd0652d5488b2188afa626af
  • Loading branch information
beccasaurus authored and danoscarmike committed Jul 31, 2020
1 parent 8228b7c commit fa7dfd6
Show file tree
Hide file tree
Showing 5 changed files with 533 additions and 1 deletion.
37 changes: 37 additions & 0 deletions packages/google-cloud-translate/samples/snippets/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,43 @@ To run this sample:
Beta Snippets
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
: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
To run this sample:
.. code-block:: bash
$ python beta_snippets.py
usage: beta_snippets.py [-h]
{translate-text,batch-translate-text,detect-language,list-languages,list-languages-with-target,create-glossary,get-glossary,list-glossaries,delete-glossary,translate-with-glossary}
...
positional arguments:
{translate-text,batch-translate-text,detect-language,list-languages,list-languages-with-target,create-glossary,get-glossary,list-glossaries,delete-glossary,translate-with-glossary}
translate-text
batch-translate-text
detect-language
list-languages
list-languages-with-target
create-glossary
get-glossary
list-glossaries
delete-glossary
translate-with-glossary
optional arguments:
-h, --help show this help message and exit
The client library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ samples:
- name: Snippets
file: snippets.py
show_help: true
- name: Beta Snippets
file: beta_snippets.py
show_help: true

cloud_client_library: true

Expand Down
Loading

0 comments on commit fa7dfd6

Please sign in to comment.