BaseTranslationApi
abstract class BaseTranslationApi
Class BaseTranslationApi
Properties
TranslationController | $mod | ||
array | $ignoreTags | ||
protected string | $url | ||
protected string | $source_language | ||
protected string | $content | ||
protected string | $target_language | ||
protected string | $translated_content |
Methods
Checks if all requirements are set for a successfull translation call
No description
No description
No description
No description
No description
No description
No description
Send feedback aka improved human translation to the API
Sets the config var 'translation_enabled' to false to disable automatic translations.
No description
Sets possible content and target language
No description
No description
No description
No description
Translates content to target language. Possible errors should be added to the error array.
Details
at line 152
protected array
checkRequirements()
Checks if all requirements are set for a successfull translation call
at line 186
bool|null
getAPIStatus(string $apiStatusMessage = '')
No description
at line 67
string
getContent()
No description
at line 53
string
getSourceLanguage()
No description
at line 81
string
getTargetLanguage()
No description
at line 95
string
getTranslatedContent()
No description
at line 39
string
getUrl()
No description
at line 109
bool
hasFeedbackLoop()
No description
at line 125
void
sendFeedback(string $text, string $human, string $srcLang, string $tgtLang, string $originalTranslation)
Send feedback aka improved human translation to the API
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%
at line 74
setContent(string $content)
No description
at line 135
protected void
setParameters(string $content, string $target_language)
Sets possible content and target language
at line 60
setSourceLanguage(string $source_language)
No description
at line 88
setTargetLanguage(string $target_language)
No description
at line 102
setTranslatedContent(string $translated_content)
No description
at line 46
setUrl(string $url)
No description
at line 178
abstract array
translate(null|string $content = null, null|string $target_language = null)
Translates content to target language. Possible errors should be added to the error array.