mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-18 09:17:15 +08:00
Merge branch 'master' of github.com:yiisoft/yii2
This commit is contained in:
@ -606,7 +606,10 @@ class YiiBase
|
||||
public static function t($category, $message, $params = array(), $language = null)
|
||||
{
|
||||
if (self::$app !== null) {
|
||||
return self::$app->getI18N()->translate($category, $message, $params, $language);
|
||||
if ($language === null) {
|
||||
$language = self::$app->language;
|
||||
}
|
||||
return self::$app->getI18N()->translate($category, $message, $language);
|
||||
} else {
|
||||
return is_array($params) ? strtr($message, $params) : $message;
|
||||
}
|
||||
|
Reference in New Issue
Block a user