Skip to main content

locations

Creates, updates, deletes, gets or lists a locations resource.

Overview

Namelocations
TypeResource
Idgoogle.translate.locations

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringResource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1"
displayNamestringThe friendly name for this location, typically a nearby city name. For example, "Tokyo".
labelsobjectCross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}
locationIdstringThe canonical id for this location. For example: "us-east1".
metadataobjectService-specific metadata. For example the available capacity at the given location.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_getselectprojectsId, locationsIdGets information about a location.
projects_locations_listselectprojectsIdfilter, pageSize, pageToken, extraLocationTypesLists information about the supported locations for this service.
projects_locations_translate_textexecprojectsId, locationsIdTranslates input text and returns translated text.
projects_locations_romanize_textexecprojectsId, locationsIdRomanize input text written in non-Latin scripts to Latin text.
projects_locations_detect_languageexecprojectsId, locationsIdDetects the language of text within a request.
projects_locations_translate_documentexecprojectsId, locationsIdTranslates documents in synchronous mode.
projects_locations_batch_translate_textexecprojectsId, locationsIdTranslates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
projects_locations_batch_translate_documentexecprojectsId, locationsIdTranslates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
projects_locations_adaptive_mt_translateexecprojectsId, locationsIdTranslate text using Adaptive MT.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
extraLocationTypesstring
filterstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets information about a location.

SELECT
name,
displayName,
labels,
locationId,
metadata
FROM google.translate.locations
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required;

Lifecycle Methods

Translates input text and returns translated text.

EXEC google.translate.locations.projects_locations_translate_text 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"contents": "{{ contents }}",
"mimeType": "{{ mimeType }}",
"sourceLanguageCode": "{{ sourceLanguageCode }}",
"targetLanguageCode": "{{ targetLanguageCode }}",
"model": "{{ model }}",
"glossaryConfig": "{{ glossaryConfig }}",
"transliterationConfig": "{{ transliterationConfig }}",
"labels": "{{ labels }}"
}';