示例#1
0
 public function setUp()
 {
     $translator = Translator::getInstance();
     $translator->setTranslation('de', array('hello' => 'hallo'));
     $translator->setTranslation('fr', array('hello' => 'salu'));
     $this->translator = $translator;
 }
示例#2
0
 /**
  * Returns the translation of the given string
  *
  * @param string $string [more arguments for printf-like placeholders)
  * @return string
  */
 public function _($string)
 {
     $args = func_get_args();
     $translator = \Hynage\I18n\Translator::getInstance();
     return call_user_func_array(array($translator, 'translate'), $args);
 }