diff --git a/classes/php-gettext/gettext.inc b/classes/php-gettext/gettext.inc index 93268eca4c2..480cb0375fa 100644 --- a/classes/php-gettext/gettext.inc +++ b/classes/php-gettext/gettext.inc @@ -23,11 +23,11 @@ */ /* LC_CTYPE 0 -LC_NUMERIC 1 +LC_NUMERIC 1 LC_TIME 2 -LC_COLLATE 3 -LC_MONETARY 4 -LC_MESSAGES 5 +LC_COLLATE 3 +LC_MONETARY 4 +LC_MESSAGES 5 LC_ALL 6 */ diff --git a/common.php b/common.php index 2094bd46fb9..9724d2cb514 100644 --- a/common.php +++ b/common.php @@ -1675,9 +1675,12 @@ function GetLanguageFromSurveyID($surveyid) function SetInterfaceLanguage($languagetoset) { - //@$locale = (isset($_GET['lang']))? $_GET['lang'] : DEFAULT_LOCALE; - //if (function_exists('T_setlocale')) T_setlocale(LC_MESSAGES, $locale); -// echo setlocale(LC_ALL, $languagetoset); + @$locale = (isset($_GET['lang']))? $_GET['lang'] : DEFAULT_LOCALE; + if (function_exists('T_setlocale')) T_setlocale(LC_MESSAGES, $locale); + @setlocale(LC_ALL, $languagetoset); + @putenv("LANG=$languagetoset"); + @putenv("LANGUAGE=$languagetoset"); + bindtextdomain($languagetoset, dirname(__FILE__).'/locale'); if (!function_exists('bind_textdomain_codeset')) echo "You need at least PHP 4.2.x to run PHPSurveyor." and die; bind_textdomain_codeset($languagetoset,'UTF-8');