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