PHP Class Xinax\LaravelGettext\Translators\Gettext

Inheritance: extends BaseTranslator, implements Xinax\LaravelGettext\Translators\TranslatorInterface
Mostra file Open project: xinax/laravel-gettext

Protected Properties

Property Type Description
$adapter Framework adapter
$categories Locale categories
$configuration Config container
$domain String
$encoding Current encoding
$fileSystem Xinax\LaravelGettext\FileSystem File system helper
$locale Current locale

Public Methods

Method Description
__construct ( Config $config, Xinax\LaravelGettext\Adapters\AdapterInterface $adapter, FileSystem $fileSystem ) Initializes the gettext module translator
__toString ( ) : mixed Return the current locale
getEncoding ( ) : mixed Gets the Current encoding.
getLocale ( ) : String Returns the current locale string identifier
isLocaleSupported ( $locale ) : boolean Returns a boolean that indicates if $locale is supported by configuration
setDomain ( String $domain ) : self Sets the current domain and updates gettext domain application
setEncoding ( mixed $encoding ) : self Sets the Current encoding.
setLocale ( $locale ) Sets the current locale code
translate ( $message ) Translates a message with gettext
translatePlural ( $singular, $plural, $count ) : string Translates a plural message with gettext

Method Details

__construct() public method

Initializes the gettext module translator
public __construct ( Config $config, Xinax\LaravelGettext\Adapters\AdapterInterface $adapter, FileSystem $fileSystem )
$config Xinax\LaravelGettext\Config\Models\Config
$adapter Xinax\LaravelGettext\Adapters\AdapterInterface
$fileSystem Xinax\LaravelGettext\FileSystem

__toString() public method

Return the current locale
public __toString ( ) : mixed
return mixed

getEncoding() public method

Gets the Current encoding.
public getEncoding ( ) : mixed
return mixed

getLocale() public method

Returns the current locale string identifier
public getLocale ( ) : String
return String

isLocaleSupported() public method

Returns a boolean that indicates if $locale is supported by configuration
public isLocaleSupported ( $locale ) : boolean
return boolean

setDomain() public method

Sets the current domain and updates gettext domain application
public setDomain ( String $domain ) : self
$domain String
return self

setEncoding() public method

Sets the Current encoding.
public setEncoding ( mixed $encoding ) : self
$encoding mixed the encoding
return self

setLocale() public method

Sets the current locale code
public setLocale ( $locale )

translate() public method

Translates a message with gettext
public translate ( $message )
$message

translatePlural() public method

Translates a plural message with gettext
public translatePlural ( $singular, $plural, $count ) : string
$singular
$plural
$count
return string

Property Details

$adapter protected_oe property

Framework adapter
protected $adapter

$categories protected_oe property

Locale categories
protected $categories

$configuration protected_oe property

Config container
protected $configuration

$domain protected_oe property

protected String $domain
return String

$encoding protected_oe property

Current encoding
protected $encoding

$fileSystem protected_oe property

File system helper
protected FileSystem,Xinax\LaravelGettext $fileSystem
return Xinax\LaravelGettext\FileSystem

$locale protected_oe property

Current locale
protected $locale