From: Andrew Dolgov Date: Thu, 3 Apr 2008 10:19:16 +0000 (+0100) Subject: check whether LC_MESSAGES or LC_ALL are defined before enabling translations X-Git-Tag: 1.2.22~10 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=86e2e1b9fa400675ff7ecce2680ae9801188f386;p=tt-rss.git check whether LC_MESSAGES or LC_ALL are defined before enabling translations --- diff --git a/functions.php b/functions.php index de546483..d1bc05cc 100644 --- a/functions.php +++ b/functions.php @@ -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");