From 061f67a7a2e04f2202b68956d8e0cefb2ba8c971 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Wed, 5 Apr 2017 13:46:40 -0700 Subject: [PATCH 1/3] Rename Translate title to Translation --- README.md | 8 ++-- TESTING.md | 4 +- google-cloud-examples/README.md | 2 +- .../examples/translate/TranslateExample.java | 4 +- .../snippets/DetectLanguageAndTranslate.java | 2 +- google-cloud-translate/README.md | 42 +++++++++---------- google-cloud-translate/pom.xml | 4 +- .../com/google/cloud/translate/Language.java | 2 +- .../com/google/cloud/translate/Translate.java | 10 ++--- .../cloud/translate/TranslateException.java | 2 +- .../google/cloud/translate/Translation.java | 4 +- .../google/cloud/translate/package-info.java | 2 +- .../translate/spi/TranslateRpcFactory.java | 2 +- .../cloud/translate/spi/v2/TranslateRpc.java | 2 +- .../testing/RemoteTranslateHelper.java | 2 +- .../cloud/translate/testing/package-info.java | 2 +- 16 files changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index e451fa78d8f3..4e272fb5bcb8 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This client supports the following Google Cloud Platform services at a [Beta](#v - [Google Cloud Datastore](#google-cloud-datastore-beta) (Beta) - [Google Cloud Storage](#google-cloud-storage-beta) (Beta) - [Cloud Spanner](#cloud-spanner-beta) (Beta) -- [Google Cloud Translate](#google-translate-beta) (Beta) +- [Google Cloud Translation](#google-translate-beta) (Beta) - Cloud Vision (Beta) - Cloud Natural Language (Beta) @@ -89,8 +89,8 @@ Example Applications - Read more about using this application on the [`StorageExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/storage/StorageExample.html). - [`TaskList`](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/datastore/src/main/java/com/google/datastore/snippets/TaskList.java) - A command line application that uses Cloud Datastore to manage a to-do list. - Read about how to run the application on its [README page](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/datastore). -- [`TranslateExample`](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) - A simple command line interface providing some of Google Translate's functionality - - Read more about using this application on the [`TranslateExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). +- [`TranslationExample`](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) - A simple command line interface providing some of Google Translation's functionality + - Read more about using this application on the [`TranslationExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). Specifying a Project ID ----------------------- @@ -650,7 +650,7 @@ while (projectIterator.hasNext()) { } ``` -Google Translate (Beta) +Google Translation (Beta) ---------------- - [API Documentation][translate-api] diff --git a/TESTING.md b/TESTING.md index 779545202ab3..f9d66b3e1a81 100644 --- a/TESTING.md +++ b/TESTING.md @@ -233,10 +233,10 @@ Here is an example that clears the bucket created in Step 3 with a timeout of 5 RemoteStorageHelper.forceDelete(storage, bucket, 5, TimeUnit.SECONDS); ``` -### Testing code that uses Translate +### Testing code that uses Translation `RemoteTranslateHelper` contains convenience methods to make is easier to run tests against the -Google Translate service. +Google Translation service. 1. Create a test Google Cloud project. diff --git a/google-cloud-examples/README.md b/google-cloud-examples/README.md index c4c9b04aa491..4ae789291372 100644 --- a/google-cloud-examples/README.md +++ b/google-cloud-examples/README.md @@ -170,7 +170,7 @@ To run examples from your command line: * Here's an example run of `TranslateExample`. - Before running the example, go to the [Google Developers Console][developers-console] to ensure that "Google Translate API" is enabled and that you have a valid API key. + Before running the example, go to the [Google Developers Console][developers-console] to ensure that "Google Translation API" is enabled and that you have a valid API key. ``` target/appassembler/bin/TranslateExample languages target/appassembler/bin/TranslateExample detect Hello,\ World! diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java index 547689b96f80..5e3829698177 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java @@ -28,9 +28,9 @@ import java.util.Map; /** - * An example of using Google Translate. + * An example of using Google Translation. * - *

This example demonstrates a simple/typical Translate usage. + *

This example demonstrates a simple/typical Translation usage. * *

See the * diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/snippets/DetectLanguageAndTranslate.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/snippets/DetectLanguageAndTranslate.java index 5d506fe22fec..ab28d630f728 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/snippets/DetectLanguageAndTranslate.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/snippets/DetectLanguageAndTranslate.java @@ -29,7 +29,7 @@ import com.google.cloud.translate.Translation; /** - * A snippet for Google Translate showing how to detect the language of some text and translate + * A snippet for Google Translation showing how to detect the language of some text and translate * some other text. */ public class DetectLanguageAndTranslate { diff --git a/google-cloud-translate/README.md b/google-cloud-translate/README.md index 717bf6305cd0..8f6eee214b75 100644 --- a/google-cloud-translate/README.md +++ b/google-cloud-translate/README.md @@ -1,7 +1,7 @@ -Google Cloud Java Client for Translate +Google Cloud Java Client for Translation ==================================== -Java idiomatic client for [Google Translate](https://cloud.google.com/translate/). +Java idiomatic client for [Google Translation](https://cloud.google.com/translate/). [![Build Status](https://travis-ci.org/GoogleCloudPlatform/google-cloud-java.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/google-cloud-java) [![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/google-cloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/google-cloud-java?branch=master) @@ -37,48 +37,48 @@ libraryDependencies += "com.google.cloud" % "google-cloud-translate" % "0.11.1-a Example Application ------------------- -[`TranslateExample`](../google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) is a simple command line interface that provides some of Google Translate's functionality. Read more about using the application on the [`TranslateExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). +[`TranslationExample`](../google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) is a simple command line interface that provides some of Google Translation's functionality. Read more about using the application on the [`TranslationExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). Authentication -------------- -Google Translate requires an API key to be passed with every request. For instructions on how to -get an API key follow the [Translate quickstart](https://cloud.google.com/translate/v2/quickstart). +Google Translation requires an API key to be passed with every request. For instructions on how to +get an API key follow the [Translation quickstart](https://cloud.google.com/translate/v2/quickstart). -About Google Translate +About Google Translation -------------------- -[Google Translate][google-translate] provides a simple programmatic interface for translating an -arbitrary string into any supported language. Translate is highly responsive, so websites and -applications can integrate with Translate API for fast, dynamic translation of source text from the +[Google Translation][google-translate] provides a simple programmatic interface for translating an +arbitrary string into any supported language. Translation is highly responsive, so websites and +applications can integrate with Translation API for fast, dynamic translation of source text from the source language to a target language (e.g., French to English). Language detection is also available In cases where the source language is unknown. -See the [Translate quickstart](https://cloud.google.com/translate/v2/quickstart) for more details -on how to activate Google Translate for your project. +See the [Translation quickstart](https://cloud.google.com/translate/v2/quickstart) for more details +on how to activate Google Translation for your project. -See the ``google-cloud`` API [Translate documentation][translate-api] to learn how to interact with -the Google Translate using this Client Library. +See the ``google-cloud`` API [Translation documentation][translate-api] to learn how to interact with +the Google Translation using this Client Library. Getting Started --------------- #### Prerequisites For this tutorial, you need a [Google Developers Console](https://console.developers.google.com/) -project with "Translate API" enabled via the console's API Manager. You also need to enable +project with "Translation API" enabled via the console's API Manager. You also need to enable billing via the [Google Developers Console](https://console.developers.google.com/). Finally, you must set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following command in command line: `gcloud auth application-default login`. Alternatively, you can authenticate -Translate requests using an API key. See -[Translate quickstart](https://cloud.google.com/translate/v2/quickstart) for more details. +Translation requests using an API key. See +[Translation quickstart](https://cloud.google.com/translate/v2/quickstart) for more details. #### Installation and setup You'll need to obtain the `google-cloud-translate` library. See the [Quickstart](#quickstart) section to add `google-cloud-translate` as a dependency in your code. #### Creating an authorized service object -To make authenticated requests to Google Translate, you must create a service object with +To make authenticated requests to Google Translation, you must create a service object with credentials or with an API key. The simplest way to authenticate is to use [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). These credentials are automatically inferred from your environment, so you only need the following @@ -93,7 +93,7 @@ Translate translate = TranslateOptions.getDefaultInstance().getService(); Notice that this code can be also used with an API key. By default, an API key is looked for in the `GOOGLE_API_KEY` environment variable. Once the API key is set, you can make API calls by invoking -methods on the Translate service created via `TranslateOptions.getDefaultInstance().getService()`. +methods on the Translation service created via `TranslateOptions.getDefaultInstance().getService()`. You can also explicitly set the API key as follows: ```java @@ -101,7 +101,7 @@ Translate translate = TranslateOptions.newBuilder().setApiKey("myKey").build().g ``` #### Detecting language -With Google Translate you can detect the language of some text. The service will provide you with +With Google Translation you can detect the language of some text. The service will provide you with the code of the detected language and a level of confidence. Add the following import at the top of your file: @@ -117,7 +117,7 @@ String detectedLanguage = detection.getLanguage(); ``` #### Translating text -Google translate allows you to translate some text. When translating one or more texts you can +Google translation allows you to translate some text. When translating one or more texts you can either provide the source language or let the service detect it for you. Add the following imports at the top of your file: @@ -156,7 +156,7 @@ Java 7 or above is required for using this client. Testing ------- -This library has tools to help make tests for code using Cloud Translate. +This library has tools to help make tests for code using Cloud Translation. See [TESTING] to read more about testing. diff --git a/google-cloud-translate/pom.xml b/google-cloud-translate/pom.xml index 2f18f365a225..a7589ef3d485 100644 --- a/google-cloud-translate/pom.xml +++ b/google-cloud-translate/pom.xml @@ -4,10 +4,10 @@ google-cloud-translate ${beta.version} jar - Google Cloud Translate + Google Cloud Translation https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-translate - Java idiomatic client for Google Translate. + Java idiomatic client for Google Translation. com.google.cloud diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/Language.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/Language.java index a6c626c0fbff..1d79518b35b1 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/Language.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/Language.java @@ -24,7 +24,7 @@ import java.util.Objects; /** - * Information about a language supported by Google Translate. Objects of this class contain + * Information about a language supported by Google Translation. Objects of this class contain * language's code and the language name. * * @see diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/Translate.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/Translate.java index bd09a9e615ec..0c08e481da6a 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/Translate.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/Translate.java @@ -22,9 +22,9 @@ import java.util.List; /** - * An interface for Google Translate. + * An interface for Google Translation. * - * @see Google Translate + * @see Google Translation */ public interface Translate extends Service { @@ -64,7 +64,7 @@ private TranslateOption(TranslateRpc.Option rpcOption, String value) { } /** - * Returns an option for setting the source language. If not provided, Google Translate will try + * Returns an option for setting the source language. If not provided, Google Translation will try * to detect the language of the text to translate. * * @param sourceLanguage the source language code @@ -85,7 +85,7 @@ public static TranslateOption targetLanguage(String targetLanguage) { /** * Sets the language translation model. You can use this parameter to take advantage of Neural - * Machine Translation. Possible values are {@code base} and {@code nmt}. Google Translate could + * Machine Translation. Possible values are {@code base} and {@code nmt}. Google Translation could * use a different model to translate your text, use {@link Translation#getModel()} to know * which model was used for translation. Please notice that you must be whitelisted to use this * option, otherwise translation will fail. @@ -98,7 +98,7 @@ public static TranslateOption model(String model) { } /** - * Returns the list of languages supported by Google Translate. If + * Returns the list of languages supported by Google Translation. If * {@link LanguageListOption#targetLanguage(String)} is provided, {@link Language#getName()} * values are localized according to the provided target language. If no such option is passed, * {@link Language#getName()} values are localized according to diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateException.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateException.java index de176255add9..5d47e4a9522a 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateException.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateException.java @@ -24,7 +24,7 @@ import java.util.Set; /** - * Google Translate service exception. + * Google Translation service exception. */ public class TranslateException extends BaseServiceException { diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/Translation.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/Translation.java index 0acd10857654..3527203f64e9 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/Translation.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/Translation.java @@ -27,7 +27,7 @@ /** * Information about a translation. Objects of this class contain the translated text and the source * language's code. Source language's code can be the one provided by the user (if any) or the one - * detected by the Google Translate service. + * detected by the Google Translation service. * * Translating Text */ @@ -63,7 +63,7 @@ public String getTranslatedText() { /** * Returns the language code of the source text. If no source language was provided this value is - * the source language as detected by the Google Translate service. + * the source language as detected by the Google Translation service. */ public String getSourceLanguage() { return sourceLanguage; diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/package-info.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/package-info.java index 3fe371993708..ef5bc85a8ead 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/package-info.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/package-info.java @@ -15,7 +15,7 @@ */ /** - * A client to Google Translate. + * A client to Google Translation. * *

Here's a simple usage example for using google-cloud. This example shows how to detect the * language of some text and how to translate some text. The example assumes that the diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/TranslateRpcFactory.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/TranslateRpcFactory.java index 3da42ee836a6..be1338e7d22c 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/TranslateRpcFactory.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/TranslateRpcFactory.java @@ -20,7 +20,7 @@ import com.google.cloud.translate.TranslateOptions; /** - * An interface for Translate RPC factory. + * An interface for Translation RPC factory. * Implementation will be loaded via {@link java.util.ServiceLoader}. */ public interface TranslateRpcFactory extends ServiceRpcFactory { diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/v2/TranslateRpc.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/v2/TranslateRpc.java index 9f4193421c1f..3078dd70b14f 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/v2/TranslateRpc.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/spi/v2/TranslateRpc.java @@ -52,7 +52,7 @@ String getString(Map options) { } /** - * Returns a list of the languages supported by Google Translate. + * Returns a list of the languages supported by Google Translation. * * @param optionMap options to listing language translations */ diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java index 4d0ade6ac4d9..7d91d0b427e1 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java @@ -52,7 +52,7 @@ public TranslateOptions getOptions() { /** * Creates a {@code RemoteTranslateHelper} object for the given API key. * - * @param apiKey API key used to issue requests to Google Translate. + * @param apiKey API key used to issue requests to Google Translation. */ public static RemoteTranslateHelper create(String apiKey) { HttpTransportOptions transportOptions = TranslateOptions.getDefaultHttpTransportOptions(); diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/package-info.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/package-info.java index ff798c563896..573d9b1a22ca 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/package-info.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/package-info.java @@ -15,7 +15,7 @@ */ /** - * A testing helper for Google Translate. + * A testing helper for Google Translation. * *

A simple usage example: *

Before the test: From e9799e4e824aab2176f5217abaae0a7e22be4178 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Wed, 5 Apr 2017 14:48:03 -0700 Subject: [PATCH 2/3] Update PR comments --- README.md | 6 +++--- google-cloud-translate/README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4e272fb5bcb8..a2e6a293a733 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This client supports the following Google Cloud Platform services at a [Beta](#v - [Google Cloud Datastore](#google-cloud-datastore-beta) (Beta) - [Google Cloud Storage](#google-cloud-storage-beta) (Beta) - [Cloud Spanner](#cloud-spanner-beta) (Beta) -- [Google Cloud Translation](#google-translate-beta) (Beta) +- [Google Cloud Translation](#google-translation-beta) (Beta) - Cloud Vision (Beta) - Cloud Natural Language (Beta) @@ -89,8 +89,8 @@ Example Applications - Read more about using this application on the [`StorageExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/storage/StorageExample.html). - [`TaskList`](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/datastore/src/main/java/com/google/datastore/snippets/TaskList.java) - A command line application that uses Cloud Datastore to manage a to-do list. - Read about how to run the application on its [README page](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/datastore). -- [`TranslationExample`](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) - A simple command line interface providing some of Google Translation's functionality - - Read more about using this application on the [`TranslationExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). +- [`TranslateExample`](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) - A simple command line interface providing some of Google Translation's functionality + - Read more about using this application on the [`TranslateExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). Specifying a Project ID ----------------------- diff --git a/google-cloud-translate/README.md b/google-cloud-translate/README.md index 8f6eee214b75..178cf8540d87 100644 --- a/google-cloud-translate/README.md +++ b/google-cloud-translate/README.md @@ -37,7 +37,7 @@ libraryDependencies += "com.google.cloud" % "google-cloud-translate" % "0.11.1-a Example Application ------------------- -[`TranslationExample`](../google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) is a simple command line interface that provides some of Google Translation's functionality. Read more about using the application on the [`TranslationExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). +[`TranslateExample`](../google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) is a simple command line interface that provides some of Google Translation's functionality. Read more about using the application on the [`TransleExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). Authentication -------------- From 0d06a9f2ee6c074be06087206f0d7f8ec603b582 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Wed, 5 Apr 2017 14:51:34 -0700 Subject: [PATCH 3/3] fix typo --- google-cloud-translate/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-translate/README.md b/google-cloud-translate/README.md index 178cf8540d87..062746be7463 100644 --- a/google-cloud-translate/README.md +++ b/google-cloud-translate/README.md @@ -37,7 +37,7 @@ libraryDependencies += "com.google.cloud" % "google-cloud-translate" % "0.11.1-a Example Application ------------------- -[`TranslateExample`](../google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) is a simple command line interface that provides some of Google Translation's functionality. Read more about using the application on the [`TransleExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). +[`TranslateExample`](../google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) is a simple command line interface that provides some of Google Translation's functionality. Read more about using the application on the [`TranslateExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html). Authentication --------------