|
|
@ -26,6 +26,8 @@ use Yii; |
|
|
|
* ); |
|
|
|
* ); |
|
|
|
* ~~~ |
|
|
|
* ~~~ |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* You may use [[fileMap]] to customize the association between category names and the file names. |
|
|
|
|
|
|
|
* |
|
|
|
* @author Qiang Xue <qiang.xue@gmail.com> |
|
|
|
* @author Qiang Xue <qiang.xue@gmail.com> |
|
|
|
* @since 2.0 |
|
|
|
* @since 2.0 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -60,10 +62,8 @@ class PhpMessageSource extends MessageSource |
|
|
|
$messageFile = Yii::getAlias($this->basePath) . "/$language/"; |
|
|
|
$messageFile = Yii::getAlias($this->basePath) . "/$language/"; |
|
|
|
if (isset($this->fileMap[$category])) { |
|
|
|
if (isset($this->fileMap[$category])) { |
|
|
|
$messageFile .= $this->fileMap[$category]; |
|
|
|
$messageFile .= $this->fileMap[$category]; |
|
|
|
} elseif (($pos = strrpos($category, '\\')) !== false) { |
|
|
|
|
|
|
|
$messageFile .= (substr($category, $pos) . '.php'); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$messageFile .= "$category.php"; |
|
|
|
$messageFile .= str_replace('\\', '/', $category) . '.php'; |
|
|
|
} |
|
|
|
} |
|
|
|
if (is_file($messageFile)) { |
|
|
|
if (is_file($messageFile)) { |
|
|
|
$messages = include($messageFile); |
|
|
|
$messages = include($messageFile); |
|
|
|