Beispiel #1
0
 public function __construct() {
   parent::__construct();
   $this->locale = $_SESSION['set_lang'];
   $this->host = $GLOBALS['cgp_host'];
   $this->userId = $GLOBALS['obm']['uid'];
   // to move somewhere else...
   mb_internal_encoding("UTF-8");
   SI18n::set_locale($this->locale);
   self::set_template_root(dirname(__FILE__).'/../../views/mail');
   $this->userInfo = get_user_info();
 }
Beispiel #2
0
 public function setup()
 {
     SI18n::add_data_path(dirname(__FILE__).'/data/simple');
     SI18n::set_locale('fr');
 }
Beispiel #3
0
 public function test_set_locale_from_http_accept()
 {
     $http_accept = 'fr-fr,fr;q=0.8,en-us;q=0.6,en;q=0.4,de;q=0.2';
     SI18n::set_locale(Locale::acceptFromHttp($http_accept));
     $this->assertEquals('fr_FR', SI18n::get_locale());
 }