PHP Class Netson\L4gettext\L4gettext

Show file Open project: netson/l4gettext

Protected Properties

Property Type Description
$encoding string variable holds the current encoding
$locale string variable holds the current locale

Public Methods

Method Description
__construct ( ) constructor method accepts an optional $locale, otherwise the default will be used
__toString ( ) : string method to dump the current locale/encoding settings to string
createFolder ( string $path ) : L4gettext method which auto creates the LC_MESSAGES folder for each set locale, if they do not exist yet
getEncoding ( ) : string method to fetch the set encoding
getLocale ( ) : string method to fetch the set locale
getLocaleAndEncoding ( ) : string method to merge the locale and encoding into a single string
hasEncoding ( ) : boolean method to check if an encoding has been set
hasLocale ( ) : boolean method to check if a locale has been set
setEncoding ( string $encoding ) : L4gettext method to set the encoding
setLocale ( string $locale ) : L4gettext method to set the locale
setTextDomain ( string $textdomain, string $path ) : L4gettext method to set the text domain

Method Details

__construct() public method

constructor method accepts an optional $locale, otherwise the default will be used
public __construct ( )

__toString() public method

method to dump the current locale/encoding settings to string
public __toString ( ) : string
return string

createFolder() public method

method which auto creates the LC_MESSAGES folder for each set locale, if they do not exist yet
public createFolder ( string $path ) : L4gettext
$path string
return L4gettext

getEncoding() public method

method to fetch the set encoding
public getEncoding ( ) : string
return string

getLocale() public method

method to fetch the set locale
public getLocale ( ) : string
return string

getLocaleAndEncoding() public method

method to merge the locale and encoding into a single string
public getLocaleAndEncoding ( ) : string
return string

hasEncoding() public method

method to check if an encoding has been set
public hasEncoding ( ) : boolean
return boolean

hasLocale() public method

method to check if a locale has been set
public hasLocale ( ) : boolean
return boolean

setEncoding() public method

method to set the encoding
public setEncoding ( string $encoding ) : L4gettext
$encoding string
return L4gettext

setLocale() public method

method to set the locale
public setLocale ( string $locale ) : L4gettext
$locale string
return L4gettext

setTextDomain() public method

method to set the text domain
public setTextDomain ( string $textdomain, string $path ) : L4gettext
$textdomain string
$path string
return L4gettext

Property Details

$encoding protected property

variable holds the current encoding
protected string $encoding
return string

$locale protected property

variable holds the current locale
protected string $locale
return string