Exemplo n.º 1
0
 /**
  * Translates a string. You can pass more parameters, they will be sprintf'ed into the resulting translation
  * @param string $token
  * @return string
  */
 public function translate($token)
 {
     $params = func_get_args();
     array_shift($params);
     foreach ($this->getDictionaries($this->localizer->getCurrentLocale()) as $dictionary) {
         if (array_key_exists($token, $dictionary)) {
             return vsprintf($dictionary[$token], $params);
         }
     }
     return $token;
 }