Environment::getLanguageKey()
\nn\t3::Environment()->getLanguageKey();
Get the current language (as abbreviation like "de") in the frontend
\nn\t3::Environment()->getLanguageKey();
Copied!
| @return string
Source Code
public function getLanguageKey () {
$request = $this->getRequest();
if ($request instanceof ServerRequestInterface) {
$data = $request->getAttribute('language', null);
if ($data) {
return $data->getTwoLetterIsoCode();
}
}
return '';
}
Copied!