Example #1
0
 /**
  * {@inheritdoc}
  */
 public function translate(Translator $i18n)
 {
     return $this->message = $i18n->get($this->msgId, $this->msgParams, $this->msgDomain);
 }
Example #2
0
 /**
  * Shortcut to call getGlobal() method on Translate object.
  * 
  * @return string
  */
 public function i18ng($id, $params = [])
 {
     return $this->i18n->getGlobal($id, $params);
 }
Example #3
0
 /**
  * This global is used in {% domain %} and {% enddomain %} tags.
  * 
  * {@inheritdoc}
  */
 public function getGlobals()
 {
     return ['i18n' => $this->i18n, 'format' => $this->i18n->getFormatter()];
 }
Example #4
0
 /**
  * Shortcut for Translator::get() with helper domain.
  * 
  * @return string
  */
 private function i18n($id, $args = [])
 {
     return $this->i18n->get($this->prefix . $id, $args, $this->domain);
 }