public function setUp() { $translator = Translator::getInstance(); $translator->setTranslation('de', array('hello' => 'hallo')); $translator->setTranslation('fr', array('hello' => 'salu')); $this->translator = $translator; }
/** * 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); }