Error checking if a locale isn't installed

This commit is contained in:
Albert Santoni 2014-07-28 11:35:19 -04:00
parent e759b8969b
commit 4b4554476a

View file

@ -23,10 +23,16 @@ class Application_Model_Locale
} else { } else {
$lang = $locale.'.'.$codeset; $lang = $locale.'.'.$codeset;
} }
putenv("LC_ALL=$lang"); //putenv("LC_ALL=$lang");
putenv("LANG=$lang"); //putenv("LANG=$lang");
$res = setlocale(LC_MESSAGES, $lang); //Setting the LANGUAGE env var supposedly lets gettext search inside our locale dir even if the system
//doesn't have the particular locale that we want installed. This doesn't actually seem to work though. -- Albert
putenv("LANGUAGE=$locale");
if (setlocale(LC_MESSAGES, $lang) === false)
{
Logging::warn("Your system does not have the " . $lang . " locale installed. Run: sudo locale-gen " . $lang);
}
$domain = 'airtime'; $domain = 'airtime';
bindtextdomain($domain, '../locale'); bindtextdomain($domain, '../locale');
textdomain($domain); textdomain($domain);