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 1818namespace Google \Cloud \Samples \Translate ;
1919
2020// [START translate_v3_translate_text]
21+ // [START translate_v3_import_client_library]
2122use Google \Cloud \Translate \V3 \Client \TranslationServiceClient ;
23+ // [END translate_v3_import_client_library]
2224use Google \Cloud \Translate \V3 \TranslateTextRequest ;
2325
2426/**
@@ -42,6 +44,7 @@ function v3_translate_text(
4244 ->setTargetLanguageCode ($ targetLanguage )
4345 ->setParent ($ formattedParent );
4446 $ response = $ translationServiceClient ->translateText ($ request );
47+
4548 // Display the translation for each input text provided
4649 foreach ($ response ->getTranslations () as $ translation ) {
4750 printf ('Translated text: %s ' . PHP_EOL , $ translation ->getTranslatedText ());
You can’t perform that action at this time.
0 commit comments