Stud.IP  6.0
TranslatablePluginTrait.php File Reference

Functions

 initializeTranslation ($domain)
 
 getTranslationDomain ()
 
 hasTranslation ()
 
 _ ($string)
 
 _n ($string0, $string1, $n)
 

Variables

trait TranslatablePluginTrait
 

Function Documentation

◆ _()

_ (   $string)

Plugin localization for a single string.

Parameters
string$stringString to translate
Returns
string

◆ _n()

_n (   $string0,
  $string1,
  $n 
)

Plugin localization for plural strings.

Parameters
string$string0String to translate (singular)
string$string1String to translate (plural)
mixed$nQuantity factor (may be an array or array-like)
Returns
string

◆ getTranslationDomain()

getTranslationDomain ( )
protected

Returns the defined translation domain from plugin manifest. If none is set, false is returned.

Returns
false|string The translation domain from manifest, if set

◆ hasTranslation()

hasTranslation ( )

Returns whether the plugin has a translation defined or not.

Returns
bool

◆ initializeTranslation()

initializeTranslation (   $domain)
protected

Initializes the translation for the plugin.

Parameters
string$domain

Variable Documentation

◆ TranslatablePluginTrait

trait TranslatablePluginTrait
Initial value:
{
protected $translation_domain = null

Trait used to allow plugins to be translated in a generic way.

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL2 or any later version
Since
Stud.IP 5.0