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
Successful response
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. |
Successful response
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 | filter , pageSize , pageToken , extraLocationTypes | Lists information about the supported locations for this service. |
projects_locations_translate_text | exec | projectsId , locationsId | Translates input text and returns translated text. | |
projects_locations_romanize_text | exec | projectsId , locationsId | Romanize input text written in non-Latin scripts to Latin text. | |
projects_locations_detect_language | exec | projectsId , locationsId | Detects the language of text within a request. | |
projects_locations_translate_document | exec | projectsId , locationsId | Translates documents in synchronous mode. | |
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_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_adaptive_mt_translate | exec | projectsId , locationsId | Translate 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.
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.
SELECT
name,
displayName,
labels,
locationId,
metadata
FROM google.translate.locations
WHERE projectsId = '{{ projectsId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND extraLocationTypes = '{{ extraLocationTypes }}';
Lifecycle Methods
- projects_locations_translate_text
- projects_locations_romanize_text
- projects_locations_detect_language
- projects_locations_translate_document
- projects_locations_batch_translate_text
- projects_locations_batch_translate_document
- projects_locations_adaptive_mt_translate
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 }}"
}';
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 }}"
}';
Detects the language of text within a request.
EXEC google.translate.locations.projects_locations_detect_language
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"model": "{{ model }}",
"content": "{{ content }}",
"mimeType": "{{ mimeType }}",
"labels": "{{ labels }}"
}';
Translates documents in synchronous mode.
EXEC google.translate.locations.projects_locations_translate_document
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"sourceLanguageCode": "{{ sourceLanguageCode }}",
"targetLanguageCode": "{{ targetLanguageCode }}",
"documentInputConfig": "{{ documentInputConfig }}",
"documentOutputConfig": "{{ documentOutputConfig }}",
"model": "{{ model }}",
"glossaryConfig": "{{ glossaryConfig }}",
"labels": "{{ labels }}",
"customizedAttribution": "{{ customizedAttribution }}",
"isTranslateNativePdfOnly": {{ isTranslateNativePdfOnly }},
"enableShadowRemovalNativePdf": {{ enableShadowRemovalNativePdf }},
"enableRotationCorrection": {{ enableRotationCorrection }}
}';
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=
'{
"sourceLanguageCode": "{{ sourceLanguageCode }}",
"targetLanguageCodes": "{{ targetLanguageCodes }}",
"models": "{{ models }}",
"inputConfigs": "{{ inputConfigs }}",
"outputConfig": "{{ outputConfig }}",
"glossaries": "{{ glossaries }}",
"labels": "{{ labels }}"
}';
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=
'{
"sourceLanguageCode": "{{ sourceLanguageCode }}",
"targetLanguageCodes": "{{ targetLanguageCodes }}",
"inputConfigs": "{{ inputConfigs }}",
"outputConfig": "{{ outputConfig }}",
"models": "{{ models }}",
"glossaries": "{{ glossaries }}",
"formatConversions": "{{ formatConversions }}",
"customizedAttribution": "{{ customizedAttribution }}",
"enableShadowRemovalNativePdf": {{ enableShadowRemovalNativePdf }},
"enableRotationCorrection": {{ enableRotationCorrection }}
}';
Translate text using Adaptive MT.
EXEC google.translate.locations.projects_locations_adaptive_mt_translate
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"dataset": "{{ dataset }}",
"content": "{{ content }}",
"referenceSentenceConfig": "{{ referenceSentenceConfig }}",
"glossaryConfig": "{{ glossaryConfig }}"
}';