We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbf6d80 commit 6962dbaCopy full SHA for 6962dba
translate/src/v3_translate_text.php
@@ -18,7 +18,9 @@
18
namespace Google\Cloud\Samples\Translate;
19
20
// [START translate_v3_translate_text]
21
+// [START translate_v3_import_client_library]
22
use Google\Cloud\Translate\V3\Client\TranslationServiceClient;
23
+// [END translate_v3_import_client_library]
24
use Google\Cloud\Translate\V3\TranslateTextRequest;
25
26
/**
@@ -42,6 +44,7 @@ function v3_translate_text(
42
44
->setTargetLanguageCode($targetLanguage)
43
45
->setParent($formattedParent);
46
$response = $translationServiceClient->translateText($request);
47
+
48
// Display the translation for each input text provided
49
foreach ($response->getTranslations() as $translation) {
50
printf('Translated text: %s' . PHP_EOL, $translation->getTranslatedText());
0 commit comments