Language
class Language (View source)
Language object
Properties
protected string | $regex |
Methods
Constructs the Language object
Returns native name for language
Returns English name for language
Returns verbose name for language
Returns language code
Returns MySQL locale code, can be empty
Checks whether language is currently active.
Checks whether language matches HTTP header Accept-Language.
Checks whether language matches HTTP header User-Agent
Checks whether language is RTL
Details
__construct(string $code, string $name, string $native, string $regex, string $mysql)
Constructs the Language object
string
getNativeName()
Returns native name for language
string
getEnglishName()
Returns English name for language
string
getName()
Returns verbose name for language
string
getCode()
Returns language code
string
getMySQLLocale()
Returns MySQL locale code, can be empty
int
cmp(Language $other)
Compare function used for sorting
bool
isActive()
Checks whether language is currently active.
bool
matchesAcceptLanguage(string $header)
Checks whether language matches HTTP header Accept-Language.
bool
matchesUserAgent(string $header)
Checks whether language matches HTTP header User-Agent
bool
isRTL()
Checks whether language is RTL