diff --git a/framework/yii/BaseYii.php b/framework/yii/BaseYii.php index cf9a96f..21dc81c 100644 --- a/framework/yii/BaseYii.php +++ b/framework/yii/BaseYii.php @@ -515,7 +515,11 @@ class BaseYii if (self::$app !== null) { return self::$app->getI18n()->translate($category, $message, $params, $language ?: self::$app->language); } else { - return is_array($params) ? strtr($message, $params) : $message; + $p = []; + foreach((array) $params as $name => $value) { + $p['{' . $name . '}'] = $value; + } + return ($p === []) ? $message : strtr($message, $p); } }