PHP Class Frontend\Core\Language\Language

Afficher le fichier Open project: forkcms/forkcms Class Usage Examples

Méthodes publiques

Méthode Description
act ( string $key, boolean $fallback = true ) : string Get an action from the language-file
buildCache ( string $language, string $application ) Build the language files
err ( string $key, boolean $fallback = true ) : string Get an error from the language-file
getAction ( string $key, boolean $fallback = true ) : string Get an action from the language-file
getActions ( ) : array Get all the actions
getActiveLanguages ( ) : array Get the active languages
getBrowserLanguage ( boolean $forRedirect = true ) : string Get the preferred language by using the browser-language
getError ( string $key, boolean $fallback = true ) : string Get an error from the language-file
getErrors ( ) : array Get all the errors
getLabel ( string $key, boolean $fallback = true ) : string Get a label from the language-file
getLabels ( ) : array Get all the labels
getMessage ( string $key, boolean $fallback = true ) : string Get a message from the language-file
getMessages ( ) : array Get all the messages
getRedirectLanguages ( ) : array Get the redirect languages
lbl ( string $key, boolean $fallback = true ) : string Get a label from the language-file
msg ( string $key, boolean $fallback = true ) : string Get a message from the language-file
setLocale ( string $language = null, boolean $force = false ) Set locale

Method Details

act() public static méthode

Get an action from the language-file
public static act ( string $key, boolean $fallback = true ) : string
$key string The key to get.
$fallback boolean Should we provide a fallback in English?
Résultat string

buildCache() public static méthode

Build the language files
public static buildCache ( string $language, string $application )
$language string The language to build the locale-file for.
$application string The application to build the locale-file for.

err() public static méthode

Get an error from the language-file
public static err ( string $key, boolean $fallback = true ) : string
$key string The key to get.
$fallback boolean Should we provide a fallback in English?
Résultat string

getAction() public static méthode

Get an action from the language-file
public static getAction ( string $key, boolean $fallback = true ) : string
$key string The key to get.
$fallback boolean Should we provide a fallback in English?
Résultat string

getActions() public static méthode

Get all the actions
public static getActions ( ) : array
Résultat array

getActiveLanguages() public static méthode

Get the active languages
public static getActiveLanguages ( ) : array
Résultat array

getBrowserLanguage() public static méthode

Get the preferred language by using the browser-language
public static getBrowserLanguage ( boolean $forRedirect = true ) : string
$forRedirect boolean Only look in the languages to redirect?
Résultat string

getError() public static méthode

Get an error from the language-file
public static getError ( string $key, boolean $fallback = true ) : string
$key string The key to get.
$fallback boolean Should we provide a fallback in English?
Résultat string

getErrors() public static méthode

Get all the errors
public static getErrors ( ) : array
Résultat array

getLabel() public static méthode

Get a label from the language-file
public static getLabel ( string $key, boolean $fallback = true ) : string
$key string The key to get.
$fallback boolean Should we provide a fallback in English?
Résultat string

getLabels() public static méthode

Get all the labels
public static getLabels ( ) : array
Résultat array

getMessage() public static méthode

Get a message from the language-file
public static getMessage ( string $key, boolean $fallback = true ) : string
$key string The key to get.
$fallback boolean Should we provide a fallback in English?
Résultat string

getMessages() public static méthode

Get all the messages
public static getMessages ( ) : array
Résultat array

getRedirectLanguages() public static méthode

Get the redirect languages
public static getRedirectLanguages ( ) : array
Résultat array

lbl() public static méthode

Get a label from the language-file
public static lbl ( string $key, boolean $fallback = true ) : string
$key string The key to get.
$fallback boolean Should we provide a fallback in English?
Résultat string

msg() public static méthode

Get a message from the language-file
public static msg ( string $key, boolean $fallback = true ) : string
$key string The key to get.
$fallback boolean Should we provide a fallback in English?
Résultat string

setLocale() public static méthode

Set locale
public static setLocale ( string $language = null, boolean $force = false )
$language string The language to load, if not provided we will load the language based on the URL.
$force boolean Force the language, so don't check if the language is active.