PHP Class Backend\Core\Language\Language

Mostra file Open project: forkcms/forkcms Class Usage Examples

Protected Properties

Property Type Description
$activeLanguages array The active languages
$currentInterfaceLanguage string The current interface-language
$currentWorkingLanguage string The current language that the user is working with
$err array The labels
$lbl
$msg

Public Methods

Method Description
err ( string $key, string $module = null ) : string Get an error from the language-file
getActiveLanguages ( ) : array Get the active languages
getCheckboxValues ( ) : array Get all active languages in a format usable by SpoonForm's addRadioButton
getCurrentModule ( )
getError ( string $key, string $module = null ) : string Get an error from the language-file
getErrors ( ) : array Get all the errors from the language-file
getInterfaceLanguage ( ) : string Get the current interface language
getInterfaceLanguages ( ) : array Get all the possible interface languages
getLabel ( string $key, string $module = null ) : string Get a label from the language-file
getLabels ( ) : array Get all the labels from the language-file
getMessage ( string $key, string $module = null ) : string Get a message from the language-file
getMessages ( ) : array Get the messages
getWorkingLanguage ( ) : string Get the current working language
getWorkingLanguages ( ) : array Get all possible working languages
lbl ( string $key, string $module = null ) : string Get a label from the language-file
msg ( string $key, string $module = null ) : string Get a message from the language-file
setLocale ( string $language ) Set locale It will require the correct file and init the needed vars
setWorkingLanguage ( string $language ) Set the current working language

Method Details

err() public static method

Get an error from the language-file
public static err ( string $key, string $module = null ) : string
$key string The key to get.
$module string The module wherein we should search.
return string

getActiveLanguages() public static method

Get the active languages
public static getActiveLanguages ( ) : array
return array

getCheckboxValues() public static method

Get all active languages in a format usable by SpoonForm's addRadioButton
public static getCheckboxValues ( ) : array
return array

getCurrentModule() public static method

public static getCurrentModule ( )

getError() public static method

Get an error from the language-file
public static getError ( string $key, string $module = null ) : string
$key string The key to get.
$module string The module wherein we should search.
return string

getErrors() public static method

Get all the errors from the language-file
public static getErrors ( ) : array
return array

getInterfaceLanguage() public static method

Get the current interface language
public static getInterfaceLanguage ( ) : string
return string

getInterfaceLanguages() public static method

Get all the possible interface languages
public static getInterfaceLanguages ( ) : array
return array

getLabel() public static method

Get a label from the language-file
public static getLabel ( string $key, string $module = null ) : string
$key string The key to get.
$module string The module wherein we should search.
return string

getLabels() public static method

Get all the labels from the language-file
public static getLabels ( ) : array
return array

getMessage() public static method

Get a message from the language-file
public static getMessage ( string $key, string $module = null ) : string
$key string The key to get.
$module string The module wherein we should search.
return string

getMessages() public static method

Get the messages
public static getMessages ( ) : array
return array

getWorkingLanguage() public static method

Get the current working language
public static getWorkingLanguage ( ) : string
return string

getWorkingLanguages() public static method

Get all possible working languages
public static getWorkingLanguages ( ) : array
return array

lbl() public static method

Get a label from the language-file
public static lbl ( string $key, string $module = null ) : string
$key string The key to get.
$module string The module wherein we should search.
return string

msg() public static method

Get a message from the language-file
public static msg ( string $key, string $module = null ) : string
$key string The key to get.
$module string The module wherein we should search.
return string

setLocale() public static method

Set locale It will require the correct file and init the needed vars
public static setLocale ( string $language )
$language string The language to load.

setWorkingLanguage() public static method

Set the current working language
public static setWorkingLanguage ( string $language )
$language string The language to use, if not provided we will use the working language.

Property Details

$activeLanguages protected_oe static_oe property

The active languages
protected static array $activeLanguages
return array

$currentInterfaceLanguage protected_oe static_oe property

The current interface-language
protected static string $currentInterfaceLanguage
return string

$currentWorkingLanguage protected_oe static_oe property

The current language that the user is working with
protected static string $currentWorkingLanguage
return string

$err protected_oe static_oe property

The labels
protected static array $err
return array

$lbl protected_oe static_oe property

protected static $lbl

$msg protected_oe static_oe property

protected static $msg