PHP Class Xinax\LaravelGettext\Translators\BaseTranslator

ファイルを表示 Open project: xinax/laravel-gettext Class Usage Examples

Protected Properties

Property Type Description
$adapter Framework adapter
$configuration Config container
$fileSystem Xinax\LaravelGettext\FileSystem File system helper

Public Methods

Method Description
__toString ( ) : mixed Return the current locale
getDomain ( ) : String Returns the current domain
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 ) : BaseTranslator Sets and stores on session the current locale code
supportedLocales ( ) : array Returns supported locales

Protected Methods

Method Description
sessionGet ( $key, null $default = null ) : mixed Return a value from session with an optional default
sessionSet ( $key, $value ) : mixed Sets a value in session session

Method Details

__toString() public method

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

getDomain() public method

Returns the current domain
public getDomain ( ) : String
return String

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

sessionGet() protected method

Return a value from session with an optional default
protected sessionGet ( $key, null $default = null ) : mixed
$key
$default null
return mixed

sessionSet() protected method

Sets a value in session session
protected sessionSet ( $key, $value ) : mixed
$key
$value
return mixed

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 and stores on session the current locale code
public setLocale ( $locale ) : BaseTranslator
return BaseTranslator

supportedLocales() public method

Returns supported locales
public supportedLocales ( ) : array
return array

Property Details

$adapter protected_oe property

Framework adapter
protected $adapter

$configuration protected_oe property

Config container
protected $configuration

$fileSystem protected_oe property

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