set language to English if not defined in session

This commit is contained in:
Roland Gruber 2004-10-07 09:48:31 +00:00
parent ee832bbf9b
commit c811b1721c
1 changed files with 9 additions and 9 deletions

View File

@ -38,7 +38,9 @@ include_once("modules.inc");
* Sets language settings for automatic translation
*/
function setlanguage() {
if ($_SESSION['language']) {
if (!isset($_SESSION['language'])) {
$_SESSION['language'] = "en_GB.utf8:UTF-8:English (Great Britain)";
}
$language = explode(":", $_SESSION['language']);
putenv("LANG=" . $language[0]); // e.g. LANG=de_DE
setlocale(LC_ALL, $language[0]); // set LC_ALL to de_DE
@ -46,8 +48,6 @@ function setlanguage() {
bindtextdomain("messages", $locdir);
textdomain("messages");
header("Content-type: text/html; charset=" . $language[1], true);
}
else echo _("Language not defined in session!");
}
/**