src/Reaction.php
public static function t($category, $message, $params = [], $language = null)
    {
        if (static::$app !== null && static::$app->getI18n() !== null) {
            return static::$app->getI18n()->translate($category, $message, $params, $language ?: static::$app->language);
        }
        $_params = [];
        foreach ($params as $key => $value) { $_params['{' . $key . '}'] = $value; }
        return !empty($params) ? strtr($message, $_params) : $message;
    }
public static function t($category, $message, $params = [], $language = null)
    {
        if (static::$app !== null && static::$app->getI18n() !== null) {
            return static::$app->getI18n()->translate($category, $message, $params, $language ?: static::$app->language);
        }
        $_params = [];
        foreach ($params as $key => $value) { $_params['{' . $key . '}'] = $value; }
        return !empty($params) ? strtr($message, $_params) : $message;
    }
Translates a message to the specified language.

@param string $category Message category
@param string $message  Message for translation
@param array  $params   Parameters array
@param string $language Language translate to
@return string