PHP Class TI_Lang, TastyIgniter

Inheritance: extends MX_Lang
Show file Open project: tastyigniter/tastyigniter

Protected Properties

Property Type Description
$languages

Public Methods

Method Description
defaultLang ( string $langfile, string $lang = '' ) : string Default Language
line ( string $line, string | array $params = NULL, boolean $log_errors = TRUE ) : string Language line
load ( mixed $langfile, string $lang = '', boolean $return = FALSE, boolean $add_suffix = TRUE, string $alt_path = '', string $_module = '' ) : string[] | void Load a language file

Protected Methods

Method Description
getIdiom ( string $language ) : string Language Idiom

Method Details

defaultLang() public method

Detects the browser language or uses the admin settings language as default language
public defaultLang ( string $langfile, string $lang = '' ) : string
$langfile string
$lang string
return string

getIdiom() protected method

Fetches the idiom of the browser's language from the database.
protected getIdiom ( string $language ) : string
$language string
return string

line() public method

Fetches a single line of text from the language array
public line ( string $line, string | array $params = NULL, boolean $log_errors = TRUE ) : string
$line string Language line key
$params string | array String or array of strings to be inserted at placeholders like %s, %d, etc.
$log_errors boolean Whether to log an error message if the line is not found
return string Translation

load() public method

Load a language file
public load ( mixed $langfile, string $lang = '', boolean $return = FALSE, boolean $add_suffix = TRUE, string $alt_path = '', string $_module = '' ) : string[] | void
$langfile mixed Language file name
$lang string
$return boolean Whether to return the loaded array of translations
$add_suffix boolean Whether to add suffix to $langfile
$alt_path string Alternative path to look for the language file
$_module string
return string[] | void Array containing translations, if $return is set to TRUE

Property Details

$languages protected property

protected $languages