\PrivateBinI18n

I18n

provides internationalization tools like translation, browser language detection, etc.

Summary

Methods
Properties
Constants
_()
translate()
loadTranslations()
getAvailableLanguages()
getBrowserLanguages()
getLanguage()
getLanguageLabels()
setLanguageFallback()
No public properties found
No constants found
_getPath()
_getPluralForm()
_getMatchingLanguage()
_matchLanguage()
$_language
$_languageFallback
$_languageLabels
$_availableLanguages
$_path
$_translations
N/A
No private methods found
No private properties found
N/A

Properties

$_language

$_language : string

language

Type

string

$_languageFallback

$_languageFallback : string

language fallback

Type

string

$_languageLabels

$_languageLabels : array

language labels

Type

array

$_availableLanguages

$_availableLanguages : array

available languages

Type

array

$_path

$_path : string

path to language files

Type

string

$_translations

$_translations : array

translation cache

Type

array

Methods

_()

_(string  $messageId) : string

translate a string, alias for translate()

Parameters

string $messageId

Returns

string

translate()

translate(string  $messageId) : string

translate a string

Parameters

string $messageId

Returns

string

getAvailableLanguages()

getAvailableLanguages() : array

get list of available translations based on files found

Returns

array

getLanguage()

getLanguage() : string

get currently loaded language

Returns

string

getLanguageLabels()

getLanguageLabels(array  $languages = array()) : array

get list of language labels

Only for given language codes, otherwise all labels.

Parameters

array $languages

Returns

array

setLanguageFallback()

setLanguageFallback(string  $lang) 

set the default language

Parameters

string $lang

_getPath()

_getPath(string  $file = '') : string

get language file path

Parameters

string $file

Returns

string