From 86e2e1b9fa400675ff7ecce2680ae9801188f386 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 3 Apr 2008 11:19:16 +0100 Subject: [PATCH] check whether LC_MESSAGES or LC_ALL are defined before enabling translations --- functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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"); -- 2.39.5