locations
Creates, updates, deletes, gets or lists a locations resource.
Overview
| Name | locations |
| Type | Resource |
| Id | google.translate.locations |
Fields
The following fields are returned by SELECT queries:
- projects_locations_get
- projects_locations_list
| Name | Datatype | Description |
|---|---|---|
name | string | Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1" |
displayName | string | The friendly name for this location, typically a nearby city name. For example, "Tokyo". |
labels | object | Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} |
locationId | string | The canonical id for this location. For example: "us-east1". |
metadata | object | Service-specific metadata. For example the available capacity at the given location. |
| Name | Datatype | Description |
|---|---|---|
name | string | Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1" |
displayName | string | The friendly name for this location, typically a nearby city name. For example, "Tokyo". |
labels | object | Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} |
locationId | string | The canonical id for this location. For example: "us-east1". |
metadata | object | Service-specific metadata. For example the available capacity at the given location. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_locations_get | select | projectsId, locationsId | Gets information about a location. | |
projects_locations_list | select | projectsId | extraLocationTypes, filter, pageSize, pageToken | Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in the ListLocationsRequest.name field: * Global locations: If name is empty, the method lists the public locations available to all projects. * Project-specific locations: If name follows the format projects/{project}, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project. For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version. |
projects_locations_adaptive_mt_translate | exec | projectsId, locationsId | Translate text using Adaptive MT. | |
projects_locations_batch_translate_document | exec | projectsId, locationsId | Translates 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_batch_translate_text | exec | projectsId, locationsId | Translates 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_detect_language | exec | projectsId, locationsId | Detects the language of text within a request. | |
projects_locations_refine_text | exec | projectsId, locationsId | Refines the input translated text to improve the quality. | |
projects_locations_romanize_text | exec | projectsId, locationsId | Romanize input text written in non-Latin scripts to Latin text. | |
projects_locations_translate_document | exec | projectsId, locationsId | Translates documents in synchronous mode. | |
projects_locations_translate_text | exec | projectsId, locationsId | Translates input text and returns translated text. |
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.
| Name | Datatype | Description |
|---|---|---|
locationsId | string | |
projectsId | string | |
extraLocationTypes | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT examples
- projects_locations_get
- projects_locations_list
Gets information about a location.
SELECT
name,
displayName,
labels,
locationId,
metadata
FROM google.translate.locations
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
;
Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in the ListLocationsRequest.name field: * Global locations: If name is empty, the method lists the public locations available to all projects. * Project-specific locations: If name follows the format projects/{project}, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project. For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
SELECT
name,
displayName,
labels,
locationId,
metadata
FROM google.translate.locations
WHERE projectsId = '{{ projectsId }}' -- required
AND extraLocationTypes = '{{ extraLocationTypes }}'
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
Lifecycle Methods
- projects_locations_adaptive_mt_translate
- projects_locations_batch_translate_document
- projects_locations_batch_translate_text
- projects_locations_detect_language
- projects_locations_refine_text
- projects_locations_romanize_text
- projects_locations_translate_document
- projects_locations_translate_text
Translate text using Adaptive MT.
EXEC google.translate.locations.projects_locations_adaptive_mt_translate
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"content": "{{ content }}",
"dataset": "{{ dataset }}",
"glossaryConfig": "{{ glossaryConfig }}",
"mimeType": "{{ mimeType }}",
"referenceSentenceConfig": "{{ referenceSentenceConfig }}"
}'
;
Translates 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.
EXEC google.translate.locations.projects_locations_batch_translate_document
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"customizedAttribution": "{{ customizedAttribution }}",
"enableRotationCorrection": {{ enableRotationCorrection }},
"enableShadowRemovalNativePdf": {{ enableShadowRemovalNativePdf }},
"formatConversions": "{{ formatConversions }}",
"glossaries": "{{ glossaries }}",
"inputConfigs": "{{ inputConfigs }}",
"models": "{{ models }}",
"outputConfig": "{{ outputConfig }}",
"pdfNativeOnly": {{ pdfNativeOnly }},
"sourceLanguageCode": "{{ sourceLanguageCode }}",
"targetLanguageCodes": "{{ targetLanguageCodes }}"
}'
;
Translates 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.
EXEC google.translate.locations.projects_locations_batch_translate_text
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"glossaries": "{{ glossaries }}",
"inputConfigs": "{{ inputConfigs }}",
"labels": "{{ labels }}",
"models": "{{ models }}",
"outputConfig": "{{ outputConfig }}",
"sourceLanguageCode": "{{ sourceLanguageCode }}",
"targetLanguageCodes": "{{ targetLanguageCodes }}"
}'
;
Detects the language of text within a request.
EXEC google.translate.locations.projects_locations_detect_language
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"content": "{{ content }}",
"documentInputConfig": "{{ documentInputConfig }}",
"labels": "{{ labels }}",
"mimeType": "{{ mimeType }}",
"model": "{{ model }}"
}'
;
Refines the input translated text to improve the quality.
EXEC google.translate.locations.projects_locations_refine_text
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"refinementEntries": "{{ refinementEntries }}",
"sourceLanguageCode": "{{ sourceLanguageCode }}",
"targetLanguageCode": "{{ targetLanguageCode }}"
}'
;
Romanize input text written in non-Latin scripts to Latin text.
EXEC google.translate.locations.projects_locations_romanize_text
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"contents": "{{ contents }}",
"sourceLanguageCode": "{{ sourceLanguageCode }}"
}'
;
Translates documents in synchronous mode.
EXEC google.translate.locations.projects_locations_translate_document
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"customizedAttribution": "{{ customizedAttribution }}",
"documentInputConfig": "{{ documentInputConfig }}",
"documentOutputConfig": "{{ documentOutputConfig }}",
"enableRotationCorrection": {{ enableRotationCorrection }},
"enableShadowRemovalNativePdf": {{ enableShadowRemovalNativePdf }},
"glossaryConfig": "{{ glossaryConfig }}",
"isTranslateNativePdfOnly": {{ isTranslateNativePdfOnly }},
"labels": "{{ labels }}",
"model": "{{ model }}",
"sourceLanguageCode": "{{ sourceLanguageCode }}",
"targetLanguageCode": "{{ targetLanguageCode }}"
}'
;
Translates input text and returns translated text.
EXEC google.translate.locations.projects_locations_translate_text
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"contents": "{{ contents }}",
"glossaryConfig": "{{ glossaryConfig }}",
"labels": "{{ labels }}",
"mimeType": "{{ mimeType }}",
"model": "{{ model }}",
"sourceLanguageCode": "{{ sourceLanguageCode }}",
"targetLanguageCode": "{{ targetLanguageCode }}",
"transliterationConfig": "{{ transliterationConfig }}"
}'
;