Language
class Language implements LanguageInterface (View source)
An object containing the information for an interface language.
Properties
| static array | $defaultValues | The values to use to instantiate the default language. |
|
| protected string | $name | The human readable English name. |
|
| protected string | $id | The ID, langcode. |
|
| protected int | $direction | The direction, left-to-right, or right-to-left. |
|
| protected int | $weight | The weight, used for ordering languages in lists, like selects or tables. |
|
| protected bool | $locked | Locked indicates a language used by the system, not an actual language. |
Methods
Constructs a new class instance.
Gets the name of the language.
Gets the ID (language code).
Gets the text direction (left-to-right or right-to-left).
Gets the weight of the language.
Returns whether this language is the default language.
Returns whether this language is locked.
Gets the default langcode.
Details
__construct(array $values = [])
Constructs a new class instance.
string
getName()
Gets the name of the language.
string
getId()
Gets the ID (language code).
string
getDirection()
Gets the text direction (left-to-right or right-to-left).
int
getWeight()
Gets the weight of the language.
bool
isDefault()
Returns whether this language is the default language.
bool
isLocked()
Returns whether this language is locked.
static
sort(LanguageInterface[] $languages)
Sort language objects.
static protected string
getDefaultLangcode()
Gets the default langcode.