|
|
@ -8,6 +8,7 @@ |
|
|
|
namespace yii\i18n; |
|
|
|
namespace yii\i18n; |
|
|
|
|
|
|
|
|
|
|
|
use Yii; |
|
|
|
use Yii; |
|
|
|
|
|
|
|
use yii\base\Arrayable; |
|
|
|
use yii\base\Component; |
|
|
|
use yii\base\Component; |
|
|
|
use yii\base\InvalidConfigException; |
|
|
|
use yii\base\InvalidConfigException; |
|
|
|
|
|
|
|
|
|
|
@ -94,7 +95,11 @@ class I18N extends Component |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function format($message, $params, $language) |
|
|
|
public function format($message, $params, $language) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$params = (array)$params; |
|
|
|
if ($params instanceof Arrayable) { |
|
|
|
|
|
|
|
$params = $params->toArray(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$params = (array)$params; |
|
|
|
|
|
|
|
} |
|
|
|
if ($params === []) { |
|
|
|
if ($params === []) { |
|
|
|
return $message; |
|
|
|
return $message; |
|
|
|
} |
|
|
|
} |
|
|
|