diff --git a/airtime_mvc/application/models/Locale.php b/airtime_mvc/application/models/Locale.php index 726302a82..e5ada5995 100644 --- a/airtime_mvc/application/models/Locale.php +++ b/airtime_mvc/application/models/Locale.php @@ -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; + } }