Example #1
0
 /**
  * @return string
  */
 public function get()
 {
     $args = func_get_args();
     if (empty($args)) {
         throw new \InvalidArgumentException('empty argument');
     }
     if (count($args) === 1) {
         return $this->translator->get($args[0]);
     }
     return call_user_func_array([$this->translator, 'get'], $args);
 }
Example #2
0
 /**
  * @param array $defaults
  */
 private function initialize(array $defaults)
 {
     if (!empty($defaults)) {
         $this->defaults = $defaults + $this->defaults;
     }
     $this->setParser(new $this->defaults['parser']());
     $translator = new Translator();
     $translator->getConfig()->setPath(__DIR__ . '/languages')->setLanguage('en');
     $this->translator = $translator;
 }