summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2008-04-03 11:19:16 +0100
committerAndrew Dolgov <[email protected]>2008-04-03 11:19:16 +0100
commit86e2e1b9fa400675ff7ecce2680ae9801188f386 (patch)
tree2c02d31dd44876b36ac18ab803ff37f6d6611e9e /functions.php
parent372481cc39396180cfc69a70be7c4d993cb6df02 (diff)
check whether LC_MESSAGES or LC_ALL are defined before enabling translations
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/functions.php b/functions.php
index de5464837..d1bc05ccb 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");