Index: upload/main.inc.php =================================================================== --- upload/main.inc.php (Revision 2) +++ upload/main.inc.php (Arbeitskopie) @@ -96,6 +96,7 @@ require(INCLUDE_DIR.'class.format.php'); //format helpers require(INCLUDE_DIR.'class.validator.php'); //Class to help with basic form input validation...please help improve it. require(INCLUDE_DIR.'mysql.php'); + require(INCLUDE_DIR.'class.localize.php'); #CURRENT EXECUTING SCRIPT. define('THISPAGE',Misc::currentURL()); Index: upload/include/class.localize.php =================================================================== --- upload/include/class.localize.php (Revision 0) +++ upload/include/class.localize.php (Revision 0) @@ -0,0 +1,40 @@ + + Copyright (c) 2010 iit-online.de + http://www.iit-online.de + + ---------------------------------------------------------------------------- + "THE BEER-WARE LICENSE" (Revision 42): + wrote this file. As long as you retain this notice you + can do whatever you want with this stuff. If we meet some day, and you think + this stuff is worth it, you can buy me a beer in return Andre Mohren + ---------------------------------------------------------------------------- + + vim: expandtab sw=4 ts=4 sts=4: + $Id: $ +**********************************************************************/ +class Localize { + static $strings; + + function get($string) { + if(!self::$strings) { + $cfg=Sys::getConfig(); + if($cfg->getLocale()) + self::read($cfg->getLocale()); + } + if(!self::$strings) + self::read('en_EN'); + if(self::$strings[$string]) + return self::$strings[$string]; + return $string; + } + + function read($locale) { + require(ROOT_PATH.'localizations/'.$locale); + self::$strings = $config; + } +} +?> Index: upload/include/class.config.php =================================================================== --- upload/include/class.config.php (Revision 2) +++ upload/include/class.config.php (Arbeitskopie) @@ -120,6 +120,10 @@ return $this->config['timezone_offset']; } + function getLocale(){ + return $this->config['locale']; + } + function getPageSize() { return $this->config['max_page_size']; } @@ -468,6 +472,7 @@ $f['daydatetime_format']=array('type'=>'string', 'required'=>1, 'error'=>'Day, Datetime format required'); $f['admin_email']=array('type'=>'email', 'required'=>1, 'error'=>'Valid email required'); $f['autolock_minutes']=array('type'=>'int', 'required'=>1, 'error'=>'Enter lock time in minutes'); + $f['locale']=array('type'=>'string', 'required'=>1, 'error'=>'Language required'); //TODO: check option fields for validity. //do the validation. @@ -584,6 +589,7 @@ ',admin_email='.db_input($var['admin_email']). ',helpdesk_title='.db_input($var['helpdesk_title']). ',helpdesk_url='.db_input($var['helpdesk_url']). + ',locale='.db_input($var['locale']). ' WHERE id='.$this->getId(); //echo $sql; if(db_query($sql)) { Index: upload/include/staff/preference.inc.php =================================================================== --- upload/include/staff/preference.inc.php (Revision 2) +++ upload/include/staff/preference.inc.php (Arbeitskopie) @@ -51,6 +51,20 @@ Helpdesk Name/Title: + Language: + +   + + Default Email Templates: