class Projects extends Resource (View source)

The "projects" collection of methods.

Typical usage is:

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

Methods

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

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

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

Returns a list of supported languages for translation.

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

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

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

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

Details

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

Detects the language of text within a request. (projects.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

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

Returns a list of supported languages for translation.

(projects.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

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

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

(projects.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

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

Translates input text and returns translated text. (projects.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