/**
* {@inheritdoc}
*/
public function initializeType($type) { $language = NULL;
if ($this->currentUser
) { // Execute the language negotiation methods in the order they were set up
// and return the first valid language found.
foreach ($this->
getEnabledNegotiators($type) as $method_id =>
$info) { if (!
isset($this->negotiatedLanguages
[$method_id])) { try { $this->negotiatedLanguages
[$method_id] =
$this->
negotiateLanguage($type,
$method_id);
} catch (PluginNotFoundException
$e) { // If a plugin is not found, log the error so user can handle it.
$this->
getLogger('language'
)->
error($e->
getMessage());
} } // Since objects are references, we need to return a clone to prevent