PHP Класс Frontend\Core\Language\Language

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

act() публичный статический Метод

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?
Результат string

buildCache() публичный статический Метод

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() публичный статический Метод

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?
Результат string

getAction() публичный статический Метод

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?
Результат string

getActions() публичный статический Метод

Get all the actions
public static getActions ( ) : array
Результат array

getActiveLanguages() публичный статический Метод

Get the active languages
public static getActiveLanguages ( ) : array
Результат array

getBrowserLanguage() публичный статический Метод

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?
Результат string

getError() публичный статический Метод

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?
Результат string

getErrors() публичный статический Метод

Get all the errors
public static getErrors ( ) : array
Результат array

getLabel() публичный статический Метод

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?
Результат string

getLabels() публичный статический Метод

Get all the labels
public static getLabels ( ) : array
Результат array

getMessage() публичный статический Метод

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?
Результат string

getMessages() публичный статический Метод

Get all the messages
public static getMessages ( ) : array
Результат array

getRedirectLanguages() публичный статический Метод

Get the redirect languages
public static getRedirectLanguages ( ) : array
Результат array

lbl() публичный статический Метод

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?
Результат string

msg() публичный статический Метод

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?
Результат string

setLocale() публичный статический Метод

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.