check whether LC_MESSAGES or LC_ALL are defined before enabling translations

This commit is contained in:
Andrew Dolgov 2008-04-03 11:19:16 +01:00
parent 372481cc39
commit 86e2e1b9fa
1 changed files with 7 additions and 1 deletions

View File

@ -46,7 +46,13 @@
}
if ($lang) {
_setlocale(LC_MESSAGES, $lang);
if (defined('LC_MESSAGES')) {
_setlocale(LC_MESSAGES, $lang);
} else if (defined('LC_ALL')) {
_setlocale(LC_ALL, $lang);
} else {
die("can't setlocale(): please set ENABLE_TRANSLATIONS to false in config.php");
}
_bindtextdomain("messages", "locale");
_textdomain("messages");
_bind_textdomain_codeset("messages", "UTF-8");