Error checking if a locale isn't installed
This commit is contained in:
parent
e759b8969b
commit
4b4554476a
1 changed files with 10 additions and 4 deletions
|
@ -23,9 +23,15 @@ 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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue