added encoding fix in HTTP header
This commit is contained in:
parent
11245cba95
commit
d5dd1fbfcf
|
@ -28,15 +28,16 @@ include_once("status.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.:ISO-8859-1: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
|
||||||
$locdir = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/locale"; // set path to translations
|
$locdir = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/locale"; // set path to translations
|
||||||
bindtextdomain("messages", $locdir);
|
bindtextdomain("messages", $locdir);
|
||||||
textdomain("messages");
|
textdomain("messages");
|
||||||
}
|
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