Added getUserLocale function to pull locale data into the Login form

This commit is contained in:
Duncan Sommerville 2014-11-05 17:24:54 -05:00
parent eecd3fa188
commit e5e7942b42

View file

@ -47,5 +47,22 @@ class Application_Model_Locale
textdomain($domain);
bind_textdomain_codeset($domain, $codeset);
}
/**
* We need this function for the case where a user has logged out, but
* has an airtime_locale cookie containing their locale setting.
*
* If the user does not have an airtime_locale cookie set, we default
* to the station locale.
*
* When the user logs in, the value set in the login form will be passed
* into the airtime_locale cookie. This cookie is also updated when
* a user updates their user settings.
*/
public static function getUserLocale() {
$request = Zend_Controller_Front::getInstance()->getRequest();
$locale = $request->getCookie('airtime_locale', Application_Model_Preference::GetLocale());
return $locale;
}
}