File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 18
18
namespace Google \Cloud \Samples \Translate ;
19
19
20
20
// [START translate_v3_translate_text]
21
+ // [START translate_v3_import_client_library]
21
22
use Google \Cloud \Translate \V3 \Client \TranslationServiceClient ;
23
+ // [END translate_v3_import_client_library]
22
24
use Google \Cloud \Translate \V3 \TranslateTextRequest ;
23
25
24
26
/**
@@ -42,6 +44,7 @@ function v3_translate_text(
42
44
->setTargetLanguageCode ($ targetLanguage )
43
45
->setParent ($ formattedParent );
44
46
$ response = $ translationServiceClient ->translateText ($ request );
47
+
45
48
// Display the translation for each input text provided
46
49
foreach ($ response ->getTranslations () as $ translation ) {
47
50
printf ('Translated text: %s ' . PHP_EOL , $ translation ->getTranslatedText ());
You can’t perform that action at this time.
0 commit comments