added function to set language settings

This commit is contained in:
Roland Gruber 2003-05-06 15:17:09 +00:00
parent 64e2bb734f
commit 321d5e2426
1 changed files with 12 additions and 0 deletions

View File

@ -24,6 +24,18 @@ $Id$
*/ */
// sets language settings for i18n
function setlanguage() {
if ($_SESSION['language']) {
$language = explode(":", $_SESSION['language']);
putenv("LANG=" . $language[1]);
setlocale(LC_ALL, $language[0]);
$locdir = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/locale";
bindtextdomain("lam", $locdir);
textdomain("lam");
}
else echo _("Language not defined in session!");
}
class Config { class Config {