Language constructor builds the default language object.
array $options: The properties used to construct the language.
public function __construct(array $options = array()) {
// Set all the provided properties for the language.
foreach ($options as $name => $value) {
$this->{$name} = $value;
}
// If some options were not set, set sane defaults of a predefined language.
if (!isset($options['name']) || !isset($options['direction'])) {
$predefined = LanguageManager::getStandardLanguageList();
if (isset($predefined[$this->langcode])) {
if (!isset($options['name'])) {
$this->name = $predefined[$this->langcode][0];
}
if (!isset($options['direction']) && isset($predefined[$this->langcode][2])) {
$this->direction = $predefined[$this->langcode][2];
}
}
}
}