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

Устаревший:
Наследование: extends 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.