Setup
To start using Cloud Translation, you need a project that has the Cloud Translation API enabled and credentials to make authenticated calls. The following sections detail how to get set up before you make your first call to the Cloud Translation API.
The setup process involves the Google Cloud console, which is a web interface that you can use to provision, configure, manage, and monitor systems in Google Cloud. If you haven't used the Google Cloud console before, see the Cloud console page for more information.
Before you begin
Cloud Translation is available in two editions ( Basic and Advanced ). Decide which edition to use because each edition has its own set of client libraries.
Create or select a project
To use services provided by Google Cloud, you must create a project . A project organizes all your Google Cloud resources. A project consists of a set of collaborators, enabled APIs (and other resources), monitoring tools, billing information, and authentication and access controls. You can create one project, or you can create multiple projects and use them to organize your Google Cloud resources in a resource hierarchy . When creating a project, take note of the project ID . You will need this ID to make API calls. For more information on projects, see the Resource Manager documentation .
We recommend that you create separate projects for experiments, testing, and production. After you create a project, record the project number or ID . You must provide the project number (or ID) when you make calls to the Cloud Translation API.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Enable billing
You must enable billing to use Cloud Translation. For more information about Cloud Translation pricing, see the pricing page .
A billing account is used to define who pays for a given set of resources, and it can be linked to one or more projects. Project usage is charged to the linked billing account. In most cases, you configure billing when you create a project. For more information, see the Billing documentation .
Verify that billing is enabled for your Google Cloud project .
Enabling the API
You must enable the Cloud Translation API for your project. For more information on enabling APIs, see the Service Usage documentation .
Enable the Cloud Translation API.
Set usage quotas
Cloud Translation has a quota management system to help you and Google manage usage of the service. By default, the number of characters that you can send per day is unlimited. If you have a set budget, we recommend monitoring your daily usage and adjusting quotas according to your planned spend.
For more information about quotas, see Quotas and limits .
Set up authentication
If you plan to use the Cloud Translation API, you need to set up authentication. Any client application that uses the API must be authenticated and granted access to the requested resources. For more information, see Authenticate to Cloud Translation .
Identity and Access Management roles
When a principal (user account, service account, and so on) calls an API, Google Cloud requires that the principal has the appropriate permissions. You can grant permissions by granting roles to a principal. For more information, see Control access with IAM .
Installing client libraries
Client libraries are available for several popular languages. We recommend that you use these client libraries to make calls to Cloud Translation because they make it easier to access the APIs. If a client library doesn't meet your needs or isn't available for your language, build your own custom code. For more information, see Using your own client code .
For example, when you use a client library, it can determine your credentials
implicitly through the GOOGLE_APPLICATION_CREDENTIALS
environment variable.
You don't need to explicitly specify your credentials in code. For more
information, see Client Libraries
Explained
in the Cloud APIs
documentation.
Cloud Translation - Basic client libraries
Select the programming language that you are using for development, and then run the related command. For more information, see the Cloud Translation - Basic client libraries overview .
C#
nuget install Google.Cloud.Translation.V2