]> git.wh0rd.org Git - tt-rss.git/commitdiff
check whether LC_MESSAGES or LC_ALL are defined before enabling translations
authorAndrew Dolgov <fox@bah.spb.su>
Thu, 3 Apr 2008 10:19:16 +0000 (11:19 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Thu, 3 Apr 2008 10:19:16 +0000 (11:19 +0100)
functions.php

index de54648374a4286a29708b48bc7a8b088514fd4d..d1bc05ccbb1442a1e0abea1e9a45a29dee2d8440 100644 (file)
                        }
 
                        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");