public function current()
{
$locale = $this->LocaleDetector->current();
$language = $this->Language->where('active', 1)->where('code', $locale)->first();
// this language is not active, so let's the locale
// to be something different, like the default one
if (!$language) {
$locale = $this->LocaleDetector->universal();
$this->LocaleDetector->update($locale);
$language = $this->Language->where('code', $locale)->first();
}
return $language;
}