HumHub Documentation (unofficial)

TranslatorAwareInterface

Table of Contents

Methods

getTranslator()  : TranslatorInterface|null
Returns translator used in object
getTranslatorTextDomain()  : string
Return the translation text domain
hasTranslator()  : bool
Checks if the object has a translator
isTranslatorEnabled()  : bool
Returns whether translator is enabled and should be used
setTranslator()  : self
Sets translator to use in helper
setTranslatorEnabled()  : self
Sets whether translator is enabled and should be used
setTranslatorTextDomain()  : TranslatorAwareInterface
Set translation text domain

Methods

getTranslatorTextDomain()

Return the translation text domain

public getTranslatorTextDomain() : string
Return values
string

isTranslatorEnabled()

Returns whether translator is enabled and should be used

public isTranslatorEnabled() : bool
Return values
bool

setTranslator()

Sets translator to use in helper

public setTranslator([TranslatorInterface $translator = null ][, string $textDomain = null ]) : self
Parameters
$translator : TranslatorInterface = null

[optional] translator. Default is null, which sets no translator.

$textDomain : string = null

[optional] text domain Default is null, which skips setTranslatorTextDomain

Return values
self

setTranslatorEnabled()

Sets whether translator is enabled and should be used

public setTranslatorEnabled([bool $enabled = true ]) : self
Parameters
$enabled : bool = true

[optional] whether translator should be used. Default is true.

Return values
self

        
On this page

Search results