Commit c0ab801f by Qiang Xue

Merge branch 'master' of github.com:yiisoft/yii2

parents 29ac3aee a08399bc
...@@ -606,7 +606,10 @@ class YiiBase ...@@ -606,7 +606,10 @@ class YiiBase
public static function t($category, $message, $params = array(), $language = null) public static function t($category, $message, $params = array(), $language = null)
{ {
if (self::$app !== 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 { } else {
return is_array($params) ? strtr($message, $params) : $message; return is_array($params) ? strtr($message, $params) : $message;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment