return $this->cache->
get($key,
function DItemInterface
$item) use ($catalog,
$snippetSetId,
$fallbackLocale) { $item->
tag('translation.catalog.' .
$snippetSetId);
$item->
tag(sprintf('translation.catalog.%s',
$this->salesChannelId ?: 'DEFAULT'
));
return $this->snippetService->
getStorefrontSnippets($catalog,
$snippetSetId,
$fallbackLocale,
$this->salesChannelId
);
});
} private function getFallbackLocale(): string
{ try { return $this->languageLocaleProvider->
getLocaleForLanguageId(Defaults::LANGUAGE_SYSTEM
);
} catch (ConnectionException
) { // this allows us to use the translator even if there's no db connection yet
return 'en-GB';
} } private function resolveSalesChannelId(): void
{ if ($this->salesChannelId !== null
) { return;
}