public function translate($message, array $params = array())
    {
        // Update the current message with the domain translation, if we have one.
        if (isset($this->messages[$message]) && ! empty($this->messages[$message])) {
            $message = $this->messages[$message];
        }

        if (empty($params)) {
            return $message;
        }

        $formatter = new MessageFormatter();

        return $formatter->format($message, $params, $this->locale);
    }
public function translate($message, array $params = array())
    {
        // Update the current message with the domain translation, if we have one.
        if (isset($this->messages[$message]) && ! empty($this->messages[$message])) {
            $message = $this->messages[$message];
        }

        if (empty($params)) {
            return $message;
        }

        $formatter = new MessageFormatter();

        return $formatter->format($message, $params, $this->locale);
    }
public function translate ( $ message , array $ params = array ( ) ) { // Update the current message with the domain translation, if we have one. if ( isset ( $ this -> messages [ $ message ] ) && ! empty ( $ this -> messages [ $ message ] ) ) { $ message = $ this -> messages [ $ message ] ; } if ( empty ( $ params ) ) { return $ message ; } $ formatter = new MessageFormatter ( ) ; return $ formatter -> format ( $ message , $ params , $ this -> locale ) ; }
Translate a message with optional formatting
@param string $message Original message.
@param array $params Optional params for formatting.
@return string
Translate a message with optional formatting