diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 20e13db12b..ad8d3193b7 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -100,6 +100,7 @@ Yii Framework 2 Change Log - Enh #13268: Added logging of memory usage (bashkarev) - Enh: Added constants for specifying `yii\validators\CompareValidator::$type` (cebe) - Enh: Refactored `yii\web\ErrorAction` to make it reusable (silverfire) +- Bug #13287: Fixed translating "and" separator in `UniqueValidator` error message (jetexe) 2.0.10 October 20, 2016 diff --git a/framework/helpers/BaseInflector.php b/framework/helpers/BaseInflector.php index 4fb060de6c..4a8933c96a 100644 --- a/framework/helpers/BaseInflector.php +++ b/framework/helpers/BaseInflector.php @@ -566,8 +566,11 @@ class BaseInflector * @return string the generated sentence * @since 2.0.1 */ - public static function sentence(array $words, $twoWordsConnector = ' and ', $lastWordConnector = null, $connector = ', ') + public static function sentence(array $words, $twoWordsConnector = null, $lastWordConnector = null, $connector = ', ') { + if ($twoWordsConnector === null) { + $twoWordsConnector = Yii::t('yii', ' and '); + } if ($lastWordConnector === null) { $lastWordConnector = $twoWordsConnector; } diff --git a/framework/messages/ru/yii.php b/framework/messages/ru/yii.php index 936c889b15..b1aa070d63 100644 --- a/framework/messages/ru/yii.php +++ b/framework/messages/ru/yii.php @@ -21,6 +21,7 @@ return [ 'Unknown alias: -{name}' => 'Неизвестный псевдоним: -{name}', 'Yii Framework' => 'Yii Framework', '(not set)' => '(не задано)', + ' and ' => ' и ', 'An internal server error occurred.' => 'Возникла внутренняя ошибка сервера.', 'Are you sure you want to delete this item?' => 'Вы уверены, что хотите удалить этот элемент?', 'Error' => 'Ошибка',