set language to English if not defined in session
This commit is contained in:
parent
ee832bbf9b
commit
c811b1721c
|
@ -38,7 +38,9 @@ include_once("modules.inc");
|
||||||
* Sets language settings for automatic translation
|
* Sets language settings for automatic translation
|
||||||
*/
|
*/
|
||||||
function setlanguage() {
|
function setlanguage() {
|
||||||
if ($_SESSION['language']) {
|
if (!isset($_SESSION['language'])) {
|
||||||
|
$_SESSION['language'] = "en_GB.utf8:UTF-8:English (Great Britain)";
|
||||||
|
}
|
||||||
$language = explode(":", $_SESSION['language']);
|
$language = explode(":", $_SESSION['language']);
|
||||||
putenv("LANG=" . $language[0]); // e.g. LANG=de_DE
|
putenv("LANG=" . $language[0]); // e.g. LANG=de_DE
|
||||||
setlocale(LC_ALL, $language[0]); // set LC_ALL to de_DE
|
setlocale(LC_ALL, $language[0]); // set LC_ALL to de_DE
|
||||||
|
@ -47,8 +49,6 @@ function setlanguage() {
|
||||||
textdomain("messages");
|
textdomain("messages");
|
||||||
header("Content-type: text/html; charset=" . $language[1], true);
|
header("Content-type: text/html; charset=" . $language[1], true);
|
||||||
}
|
}
|
||||||
else echo _("Language not defined in session!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of string with all available configuration profiles (without .conf)
|
* Returns an array of string with all available configuration profiles (without .conf)
|
||||||
|
|
Loading…
Reference in New Issue