class Google extends BaseTranslationApi

Properties

TranslationController $mod from  BaseTranslationApi
array $ignoreTags from  BaseTranslationApi
protected string $url from  BaseTranslationApi
protected string $source_language from  BaseTranslationApi
protected string $content from  BaseTranslationApi
protected string $target_language from  BaseTranslationApi
protected string $translated_content from  BaseTranslationApi
protected string $key

Methods

array
checkRequirements()

No description

bool|null
getAPIStatus(string $apiStatusMessage = '')

No description

string
getContent()

No description

string
getKey()

No description

string
getSourceLanguage()

No description

string
getTargetLanguage()

No description

string
getTranslatedContent()

No description

string
getUrl()

No description

bool
hasFeedbackLoop()

No description

void
sendFeedback(string $text, string $human, string $srcLang, string $tgtLang, string $originalTranslation)

Send feedback aka improved human translation to the API

void
setBackgroundTranslationToDisabled()

Sets the config var 'translation_enabled' to false to disable automatic translations.

setContent(string $content)

No description

setKey(string $key)

No description

void
setParameters(string $content, string $target_language)

Sets possible content and target language

setSourceLanguage(string $source_language)

No description

setTargetLanguage(string $target_language)

No description

setTranslatedContent(string $translated_content)

No description

setUrl(string $url)

No description

array
translate(null|string $content = null, null|string $target_language = null)

No description

Details

at line 107
protected array checkRequirements()

No description

Return Value

array

$errors Is an ampty array if there are no errors.

in BaseTranslationApi at line 186
bool|null getAPIStatus(string $apiStatusMessage = '')

No description

Parameters

string $apiStatusMessage

Return Value

bool|null

in BaseTranslationApi at line 67
string getContent()

No description

Return Value

string

at line 15
string getKey()

No description

Return Value

string

in BaseTranslationApi at line 53
string getSourceLanguage()

No description

Return Value

string

in BaseTranslationApi at line 81
string getTargetLanguage()

No description

Return Value

string

in BaseTranslationApi at line 95
string getTranslatedContent()

No description

Return Value

string

in BaseTranslationApi at line 39
string getUrl()

No description

Return Value

string

in BaseTranslationApi at line 109
bool hasFeedbackLoop()

No description

Return Value

bool

This Api has a feedback loop. It is possible to send inproved translations to an endpoint

in BaseTranslationApi at line 125
void sendFeedback(string $text, string $human, string $srcLang, string $tgtLang, string $originalTranslation)

Send feedback aka improved human translation to the API

Parameters

string $text

The source text in the source language

string $human

The improved human translation in the target language

string $srcLang

The source language string

string $tgtLang

The target language string

string $originalTranslation

The original received auto translation

Return Value

void

Exceptions

TranslationException

On error

in BaseTranslationApi at line 215
void setBackgroundTranslationToDisabled()

Sets the config var 'translation_enabled' to false to disable automatic translations.

Is triggered for example by a translation character quota bigger than 98%

Return Value

void

in BaseTranslationApi at line 74
setContent(string $content)

No description

Parameters

string $content

at line 22
setKey(string $key)

No description

Parameters

string $key

in BaseTranslationApi at line 135
protected void setParameters(string $content, string $target_language)

Sets possible content and target language

Parameters

string $content
string $target_language

Return Value

void

in BaseTranslationApi at line 60
setSourceLanguage(string $source_language)

No description

Parameters

string $source_language

in BaseTranslationApi at line 88
setTargetLanguage(string $target_language)

No description

Parameters

string $target_language

in BaseTranslationApi at line 102
setTranslatedContent(string $translated_content)

No description

Parameters

string $translated_content

in BaseTranslationApi at line 46
setUrl(string $url)

No description

Parameters

string $url

at line 29
array translate(null|string $content = null, null|string $target_language = null)

No description

Parameters

null|string $content
null|string $target_language

Return Value

array

$errors Is an empty Array if no errors.