CC-4810: Add language setting to login page

-done
This commit is contained in:
denise 2013-01-09 18:03:23 -05:00
parent 7866b8a0cb
commit 1572955d07
9 changed files with 49 additions and 16 deletions

View file

@ -14,4 +14,22 @@ class Application_Model_Locale
return $out;
}
}
public static function configureLocalization($locale = null)
{
$codeset = 'UTF-8';
if (is_null($locale)) {
$lang = Application_Model_Preference::GetLocale().'.'.$codeset;
} else {
$lang = $locale.'.'.$codeset;
}
putenv("LC_ALL=$lang");
putenv("LANG=$lang");
$res = setlocale(LC_MESSAGES, $lang);
$domain = 'airtime';
bindtextdomain($domain, '/usr/share/airtime/locale');
textdomain($domain);
bind_textdomain_codeset($domain, $codeset);
}
}