8000 Rename Translate title to Translation [ci skip] by shinfan · Pull Request #1867 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-translation-beta) (Beta)
- Cloud Vision (Beta)
- Cloud Natural Language (Beta)

Expand Down Expand Up @@ -89,7 +89,7 @@ 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
- [`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
Expand Down Expand Up @@ -650,7 +650,7 @@ while (projectIterator.hasNext()) {
}
```

Google Translate (Beta)
Google Translation (Beta)
----------------

- [API Documentation][translate-api]
Expand Down
4 changes: 2 additions & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion google-cloud-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <apiKey> languages
target/appassembler/bin/TranslateExample <apiKey> detect Hello,\ World!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
import java.util.Map;

/**
* An example of using Google Translate.
* An example of using Google Translation.
*
* <p>This example demonstrates a simple/typical Translate usage.
* <p>This example demonstrates a simple/typical Translation usage.
*
* <p>See the
* <a href="https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-examples/README.md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8000
42 changes: 21 additions & 21 deletions google-cloud-translate/README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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).
[`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
--------------

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
Expand All @@ -93,15 +93,15 @@ 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
Translate translate = TranslateOptions.newBuilder().setApiKey("myKey").build().getService();
```

#### 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:
Expand All @@ -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:
Expand Down Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions google-cloud-translate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<artifactId>google-cloud-translate</artifactId>

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

<version>${beta.version}</version>
<packaging>jar</packaging>
<name>Google Cloud Translate</name>
<name>Google Cloud Translation</name>
<url>https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-translate</url>
<description>
Java idiomatic client for Google Translate.
Java idiomatic client for Google Translation.
</description>
<parent>
<groupId>com.google.cloud</groupId>
Expand Down
C958
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import java.util.List;

/**
* An interface for Google Translate.
* An interface for Google Translation.
*
* @see <a href="https://cloud.google.com/translate/docs">Google Translate</a>
* @see <a href="https://cloud.google.com/translate/docs">Google Translation</a>
*/
public interface Translate extends Service<TranslateOptions> {

Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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 4268
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Set;

/**
* Google Translate service exception.
* Google Translation service exception.
*/
public class TranslateException extends BaseServiceException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <a href="https://cloud.google.com/translate/v2/translating-text-with-rest">Translating Text</a>
*/
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/**
* A client to Google Translate.
* A client to Google Translation.
*
* <p>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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TranslateOptions> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ String getString(Map<Option, ?> 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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/**
* A testing helper for Google Translate.
* A testing helper for Google Translation.
*
* <p>A simple usage example:
* <p>Before the test:
Expand Down
0