class ProjectsLocations extends Resource (View source)

The "locations" collection of methods.

Typical usage is:

 $translateService = new Google\Service\Translate(...);
 $locations = $translateService->projects_locations;

Methods

adaptiveMtTranslate(string $parent, AdaptiveMtTranslateRequest $postBody, array $optParams = [])

Translate text using Adaptive MT. (locations.adaptiveMtTranslate)

batchTranslateDocument(string $parent, BatchTranslateDocumentRequest $postBody, array $optParams = [])

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. (locations.batchTranslateDocument)

batchTranslateText(string $parent, BatchTranslateTextRequest $postBody, array $optParams = [])

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. (locations.batchTranslateText)

detectLanguage(string $parent, DetectLanguageRequest $postBody, array $optParams = [])

Detects the language of text within a request. (locations.detectLanguage)

get(string $name, array $optParams = [])

Gets information about a location. (locations.get)

getSupportedLanguages(string $parent, array $optParams = [])

Returns a list of supported languages for translation.

listProjectsLocations(string $name, array $optParams = [])

Lists information about the supported locations for this service.

romanizeText(string $parent, RomanizeTextRequest $postBody, array $optParams = [])

Romanize input text written in non-Latin scripts to Latin text.

translateDocument(string $parent, TranslateDocumentRequest $postBody, array $optParams = [])

Translates documents in synchronous mode. (locations.translateDocument)

translateText(string $parent, TranslateTextRequest $postBody, array $optParams = [])

Translates input text and returns translated text. (locations.translateText)

Details

AdaptiveMtTranslateResponse adaptiveMtTranslate(string $parent, AdaptiveMtTranslateRequest $postBody, array $optParams = [])

Translate text using Adaptive MT. (locations.adaptiveMtTranslate)

Parameters

string $parent

Required. Location to make a regional call. Format: projects/{project-number-or-id}/locations/{location-id}.

AdaptiveMtTranslateRequest $postBody
array $optParams

Optional parameters.

Return Value

AdaptiveMtTranslateResponse

Exceptions

Exception

Operation batchTranslateDocument(string $parent, BatchTranslateDocumentRequest $postBody, array $optParams = [])

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. (locations.batchTranslateDocument)

Parameters

string $parent

Required. Location to make a regional call. Format: projects/{project-number-or-id}/locations/{location-id}. The global location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

BatchTranslateDocumentRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation batchTranslateText(string $parent, BatchTranslateTextRequest $postBody, array $optParams = [])

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. (locations.batchTranslateText)

Parameters

string $parent

Required. Location to make a call. Must refer to a caller's project. Format: projects/{project-number-or- id}/locations/{location-id}. The global location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

BatchTranslateTextRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

DetectLanguageResponse detectLanguage(string $parent, DetectLanguageRequest $postBody, array $optParams = [])

Detects the language of text within a request. (locations.detectLanguage)

Parameters

string $parent

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or- id}/locations/{location-id} or projects/{project-number-or-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

DetectLanguageRequest $postBody
array $optParams

Optional parameters.

Return Value

DetectLanguageResponse

Exceptions

Exception

Location get(string $name, array $optParams = [])

Gets information about a location. (locations.get)

Parameters

string $name

Resource name for the location.

array $optParams

Optional parameters.

Return Value

Location

Exceptions

Exception

SupportedLanguages getSupportedLanguages(string $parent, array $optParams = [])

Returns a list of supported languages for translation.

(locations.getSupportedLanguages)

Parameters

string $parent

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project- number-or-id}. Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

array $optParams

Optional parameters.

Return Value

SupportedLanguages

Exceptions

Exception

ListLocationsResponse listProjectsLocations(string $name, array $optParams = [])

Lists information about the supported locations for this service.

(locations.listProjectsLocations)

Parameters

string $name

The resource that owns the locations collection, if applicable.

array $optParams

Optional parameters.

Return Value

ListLocationsResponse

Exceptions

Exception

RomanizeTextResponse romanizeText(string $parent, RomanizeTextRequest $postBody, array $optParams = [])

Romanize input text written in non-Latin scripts to Latin text.

(locations.romanizeText)

Parameters

string $parent

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or- id}/locations/{location-id} or projects/{project-number-or-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

RomanizeTextRequest $postBody
array $optParams

Optional parameters.

Return Value

RomanizeTextResponse

Exceptions

Exception

TranslateDocumentResponse translateDocument(string $parent, TranslateDocumentRequest $postBody, array $optParams = [])

Translates documents in synchronous mode. (locations.translateDocument)

Parameters

string $parent

Required. Location to make a regional call. Format: projects/{project-number-or-id}/locations/{location-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project- number-or-id}. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have the same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

TranslateDocumentRequest $postBody
array $optParams

Optional parameters.

Return Value

TranslateDocumentResponse

Exceptions

Exception

TranslateTextResponse translateText(string $parent, TranslateTextRequest $postBody, array $optParams = [])

Translates input text and returns translated text. (locations.translateText)

Parameters

string $parent

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project- number-or-id}. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

TranslateTextRequest $postBody
array $optParams

Optional parameters.

Return Value

TranslateTextResponse

Exceptions

Exception