class Language

Language object

Properties

protected $code
protected $name
protected $native
protected $regex
protected $mysql

Methods

__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

void
activate()

Activates given translation

Details

at line 36
__construct(string $code, string $name, string $native, string $regex, string $mysql)

Constructs the Language object

Parameters

string $code Language code
string $name English name
string $native Native name
string $regex Match regullar expression
string $mysql MySQL locale code

at line 53
string getNativeName()

Returns native name for language

Return Value

string

at line 63
string getEnglishName()

Returns English name for language

Return Value

string

at line 73
string getName()

Returns verbose name for language

Return Value

string

at line 87
string getCode()

Returns language code

Return Value

string

at line 97
string getMySQLLocale()

Returns MySQL locale code, can be empty

Return Value

string

at line 109
int cmp(Language $other)

Compare function used for sorting

Parameters

Language $other Other object to compare

Return Value

int same as strcmp

at line 119
bool isActive()

Checks whether language is currently active.

Return Value

bool

at line 131
bool matchesAcceptLanguage(string $header)

Checks whether language matches HTTP header Accept-Language.

Parameters

string $header Header content

Return Value

bool

at line 146
bool matchesUserAgent(string $header)

Checks whether language matches HTTP header User-Agent

Parameters

string $header Header content

Return Value

bool

at line 159
bool isRTL()

Checks whether language is RTL

Return Value

bool

at line 169
void activate()

Activates given translation

Return Value

void