From 3e8df6836f0508fb4c6cd1c4a9f2f39192a01cea Mon Sep 17 00:00:00 2001
From: Abby Carey <abigailcarey123@gmail.com>
Date: Mon, 25 Oct 2021 06:54:09 -0700
Subject: [PATCH] docs(samples): Add Cloud Code tags for API Explorer pilot
 (#282)

This adds region tags in order to support the Cloud Code API Explorer pilot
---
 samples/snippets/translate_v3_translate_text.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/samples/snippets/translate_v3_translate_text.py b/samples/snippets/translate_v3_translate_text.py
index cdfe819f..095fd146 100644
--- a/samples/snippets/translate_v3_translate_text.py
+++ b/samples/snippets/translate_v3_translate_text.py
@@ -13,9 +13,14 @@
 # limitations under the License.
 
 # [START translate_v3_translate_text]
+# [START translate_v3_translate_text_0]
+# Imports the Google Cloud Translation library
 from google.cloud import translate
+# [END translate_v3_translate_text_0]
 
 
+# [START translate_v3_translate_text_1]
+# Initialize Translation client
 def translate_text(text="YOUR_TEXT_TO_TRANSLATE", project_id="YOUR_PROJECT_ID"):
     """Translating Text."""
 
@@ -24,7 +29,10 @@ def translate_text(text="YOUR_TEXT_TO_TRANSLATE", project_id="YOUR_PROJECT_ID"):
     location = "global"
 
     parent = f"projects/{project_id}/locations/{location}"
+    # [END translate_v3_translate_text_1]
 
+    # [START translate_v3_translate_text_2]
+    # Translate text from English to French
     # Detail on supported types can be found here:
     # https://cloud.google.com/translate/docs/supported-formats
     response = client.translate_text(
@@ -40,6 +48,7 @@ def translate_text(text="YOUR_TEXT_TO_TRANSLATE", project_id="YOUR_PROJECT_ID"):
     # Display the translation for each input text provided
     for translation in response.translations:
         print("Translated text: {}".format(translation.translated_text))
+    # [END translate_v3_translate_text_2]
 
 
 # [END translate_v3_translate_text]