@@ -16,13 +16,13 @@ This client supports the following Google Cloud Platform services at a [GA](#ver
1616- [ Stackdriver Logging] ( #stackdriver-logging-ga ) (GA)
1717- [ Cloud Datastore] ( #google-cloud-datastore-ga ) (GA)
1818- [ Cloud Storage] ( #google-cloud-storage-ga ) (GA)
19+ - [ Cloud Translation] ( #google-translation-ga ) (GA)
1920
2021This client supports the following Google Cloud Platform services at a [ Beta] ( #versioning ) quality level:
2122
2223- [ BigQuery] ( #google-cloud-bigquery-beta ) (Beta)
2324- [ Cloud Pub/Sub] ( #google-cloud-pubsub-beta ) (Beta)
2425- [ Cloud Spanner] ( #cloud-spanner-beta ) (Beta)
25- - [ Cloud Translation] ( #google-translation-beta ) (Beta)
2626- [ Cloud Natural Language] ( #google-cloud-language-beta ) (Beta)
2727- [ Cloud Vision] ( #google-cloud-vision-beta ) (Beta)
2828
@@ -368,6 +368,40 @@ if (blob != null) {
368368}
369369` ` `
370370
371+ Google Translation (GA)
372+ ----------------
373+
374+ - [API Documentation][translate-api]
375+ - [Official Documentation][translate-docs]
376+
377+ # ### Preview
378+
379+ Here' s a snippet showing a simple usage example. The example shows how to detect the language of
380+ some text and how to translate some text. The example assumes that either Application Default
381+ Credentials or a valid API key are available. An API key stored in the `GOOGLE_API_KEY` environment
382+ variable will be automatically detected. Complete source code can be found at
383+ [DetectLanguageAndTranslate.java](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/snippets/DetectLanguageAndTranslate.java).
384+
385+ ```java
386+ import com.google.cloud.translate.Detection;
387+ import com.google.cloud.translate.Translate;
388+ import com.google.cloud.translate.Translate.TranslateOption;
389+ import com.google.cloud.translate.TranslateOptions;
390+ import com.google.cloud.translate.Translation;
391+
392+ Translate translate = TranslateOptions.getDefaultInstance().getService();
393+
394+ Detection detection = translate.detect("Hola");
395+ String detectedLanguage = detection.getLanguage();
396+
397+ Translation translation = translate.translate(
398+ "World",
399+ TranslateOption.sourceLanguage("en"),
400+ TranslateOption.targetLanguage(detectedLanguage));
401+
402+ System.out.printf("Hola %s%n", translation.getTranslatedText());
403+ ```
404+
371405Google Cloud BigQuery (Beta)
372406----------------------
373407
@@ -742,40 +776,6 @@ while (projectIterator.hasNext()) {
742776}
743777` ` `
744778
745- Google Translation (Beta)
746- ----------------
747-
748- - [API Documentation][translate-api]
749- - [Official Documentation][translate-docs]
750-
751- #### Preview
752-
753- Here' s a snippet showing a simple usage example. The example shows how to detect the language of
754- some text and how to translate some text. The example assumes that either Application Default
755- Credentials or a valid API key are available. An API key stored in the ` GOOGLE_API_KEY` environment
756- variable will be automatically detected. Complete source code can be found at
757- [DetectLanguageAndTranslate.java](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/snippets/DetectLanguageAndTranslate.java).
758-
759- ` ` ` java
760- import com.google.cloud.translate.Detection;
761- import com.google.cloud.translate.Translate;
762- import com.google.cloud.translate.Translate.TranslateOption;
763- import com.google.cloud.translate.TranslateOptions;
764- import com.google.cloud.translate.Translation;
765-
766- Translate translate = TranslateOptions.getDefaultInstance().getService ();
767-
768- Detection detection = translate.detect(" Hola" );
769- String detectedLanguage = detection.getLanguage ();
770-
771- Translation translation = translate.translate(
772- " World" ,
773- TranslateOption.sourceLanguage(" en" ),
774- TranslateOption.targetLanguage(detectedLanguage));
775-
776- System.out.printf(" Hola %s%n" , translation.getTranslatedText ());
777- ` ` `
778-
779779Google Cloud Speech (Alpha)
780780----------------
781781
0 commit comments