PHP Class Backend\Core\Engine\Language

Author: Tijs Verkoyen ([email protected])
Mostra file Open project: forkcms/forkcms Class Usage Examples

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 ( ) : string
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
Deprecation:
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
Deprecation:
public static getActiveLanguages ( ) : array
return array

getCheckboxValues() public static method

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

getCurrentModule() public static method

public static getCurrentModule ( ) : string
return string

getError() public static method

Get an error from the language-file
Deprecation:
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
Deprecation:
public static getErrors ( ) : array
return array

getInterfaceLanguage() public static method

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

getInterfaceLanguages() public static method

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

getLabel() public static method

Get a label from the language-file
Deprecation:
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
Deprecation:
public static getLabels ( ) : array
return array

getMessage() public static method

Get a message from the language-file
Deprecation:
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
Deprecation:
public static getMessages ( ) : array
return array

getWorkingLanguage() public static method

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

getWorkingLanguages() public static method

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

lbl() public static method

Get a label from the language-file
Deprecation:
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
Deprecation:
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.