示例#1
0
 /**
  * Passes a string thru an printf
  *
  * @access	public
  * @param	format The format string
  * @param	mixed Mixed number of arguments for the sprintf function
  */
 public static function printf($string)
 {
     $lang = SomeFactory::getLanguage();
     $args = func_get_args();
     if (count($args) > 0) {
         $args[0] = $lang->_($args[0]);
         return call_user_func_array('printf', $args);
     }
     return '';
 }
示例#2
0
 public function setLanguage()
 {
     $session = SomeFactory::getSession();
     $conf = SomeFactory::getConfiguration();
     $language = SomeRequest::getVar('language', null);
     $sesslanguage = $session->get('language', null);
     $argumentlanguage = $conf->get('language', 'common');
     if ($language) {
         $session->set('language', $language);
         $argumentlanguage = $language;
     } else {
         if ($sesslanguage) {
             $argumentlanguage = $sesslanguage;
         }
     }
     $this->language = $argumentlanguage;
     SomeFactory::getLanguage($argumentlanguage);
 }
示例#3
0
 protected function loadLanguage()
 {
     $app = SomeRequest::getVar('app');
     $language = SomeFactory::getLanguage();
     $language->load($app);
 }