Свойство | Type | Description | |
---|---|---|---|
$_availableLanguages | array | available languages | |
$_language | string | language | |
$_languageFallback | string | language fallback | |
$_languageLabels | array | language labels | |
$_path | string | path to language files | |
$_translations | array | translation cache |
Méthode | Description | |
---|---|---|
_ ( string $messageId ) : string | translate a string, alias for translate() | |
getAvailableLanguages ( ) : array | get list of available translations based on files found | |
getBrowserLanguages ( ) : array | detect the clients supported languages and return them ordered by preference | |
getLanguage ( ) : string | get currently loaded language | |
getLanguageLabels ( array $languages = [] ) : array | get list of language labels | |
loadTranslations ( ) : void | loads translations | |
setLanguageFallback ( string $lang ) : void | set the default language | |
translate ( string $messageId ) : string | translate a string |
Méthode | Description | |
---|---|---|
_getMatchingLanguage ( array $acceptedLanguages, array $availableLanguages ) : string | compares two language preference arrays and returns the preferred match | |
_getPath ( string $file = '' ) : string | get language file path | |
_getPluralForm ( integer $n ) : integer | determines the plural form to use based on current language and given number | |
_matchLanguage ( string $a, string $b ) : float | compare two language IDs and return the degree they match |
protected static _getPluralForm ( integer $n ) : integer | ||
$n | integer | |
Résultat | integer |
public static getAvailableLanguages ( ) : array | ||
Résultat | array |
public static getBrowserLanguages ( ) : array | ||
Résultat | array |
public static getLanguage ( ) : string | ||
Résultat | string |
public static getLanguageLabels ( array $languages = [] ) : array | ||
$languages | array | |
Résultat | array |
public static loadTranslations ( ) : void | ||
Résultat | void |
public static setLanguageFallback ( string $lang ) : void | ||
$lang | string | |
Résultat | void |
protected static array $_availableLanguages | ||
Résultat | array |
protected static string $_language | ||
Résultat | string |
protected static string $_languageFallback | ||
Résultat | string |
protected static array $_languageLabels | ||
Résultat | array |
protected static string $_path | ||
Résultat | string |
protected static array $_translations | ||
Résultat | array |