$criteria->
setTitle('header::currencies'
);
$currencies =
$this->currencyRoute
->
load($event->
getStoreApiRequest(),
$context,
$criteria) ->
getCurrencies();
$contextLanguage =
$languages->
get($context->
getContext()->
getLanguageId());
if (!
$contextLanguage) { throw new \
RuntimeException(sprintf('Context language with id %s not found',
$context->
getContext()->
getLanguageId()));
} $page =
new HeaderPagelet( $navigation,
$languages,
$currencies,
$contextLanguage,
$context->
getCurrency(),
$this->
getServiceMenu($context) );
$this->eventDispatcher->
dispatch(new HeaderPageletLoadedEvent($page,
$context,
$request));
return $page;
}