PHP Interface Xinax\LaravelGettext\Translators\TranslatorInterface

Datei anzeigen Open project: xinax/laravel-gettext Interface Usage Examples

Public Methods

Method Description
__construct ( Config $config, Xinax\LaravelGettext\Adapters\AdapterInterface $adapter, FileSystem $fileSystem ) TranslatorInterface constructor.
__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 ) Sets the current locale code
supportedLocales ( ) : array Returns supported locales
translate ( $message ) : string Translates a single message
translatePlural ( $singular, $plural, $count ) : mixed Translates a plural string

Method Details

__construct() public method

TranslatorInterface constructor.
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

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

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 )

supportedLocales() public method

Returns supported locales
public supportedLocales ( ) : array
return array

translate() public method

Translates a single message
public translate ( $message ) : string
$message
return string

translatePlural() public method

Translates a plural string
public translatePlural ( $singular, $plural, $count ) : mixed
$singular
$plural
$count
return mixed