示例#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();
 }
示例#2
0
文件: I18nTest.php 项目: Kervinou/OBM
 public function test_translate_and_pluralize()
 {
     $this->assertEquals('2 messages', SI18n::translate_and_pluralize('inbox', 2));
     $this->assertEquals('2 messages', _p('inbox', 2));
 }
示例#3
0
文件: of_i18n.php 项目: Kervinou/OBM
<?php

require_once(dirname(__FILE__).'/../lib/Stato/i18n/i18n.php');
if($GLOBALS['module']) {
  SI18n::add_data_path(dirname(__FILE__).'/../../conf/locale/'.$GLOBALS['module']);
  SI18n::add_data_path(dirname(__FILE__).'/../../locale/'.$GLOBALS['module']);
}
SI18n::add_data_path(dirname(__FILE__).'/../../locale');
SI18n::add_data_path(dirname(__FILE__).'/../../conf/locale');
示例#4
0
function get_localized_country($code) {
  $countries = include(dirname(__FILE__)."/../lib/Stato/i18n/data/countries/".SI18n::get_locale().".php");
  return $countries[$code];
}
示例#5
0
文件: i18n.php 项目: Kervinou/OBM
 public static function set_locale($locale)
 {
     self::$locale = $locale;
 }
示例#6
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());
 }