diff --git a/airtime_mvc/application/models/Locale.php b/airtime_mvc/application/models/Locale.php index c07c9974c..8cbf34ed0 100644 --- a/airtime_mvc/application/models/Locale.php +++ b/airtime_mvc/application/models/Locale.php @@ -23,10 +23,16 @@ class Application_Model_Locale } else { $lang = $locale.'.'.$codeset; } - putenv("LC_ALL=$lang"); - putenv("LANG=$lang"); - $res = setlocale(LC_MESSAGES, $lang); - + //putenv("LC_ALL=$lang"); + //putenv("LANG=$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'; bindtextdomain($domain, '../locale'); textdomain($domain);