public function getCurrentLocale()
{
if ($this->currentLocale) {
return $this->currentLocale;
}
if ($this->useAcceptLanguageHeader()) {
$negotiator = new LanguageNegotiator($this->defaultLocale, $this->getSupportedLocales(), $this->request);
return $negotiator->negotiateLanguage();
}
// or get application default language
return $this->configRepository->get('app.locale');
}