Browse Source

Made ActionColumn Yii::t() tags static again (#13489)

* Made ActionColumn Yii::t() tags static again

this was changed in 2.0.11 and cause the messages translation to not
recognize them anymore.

* Fixed formatting
tags/2.0.11.1
Carsten Brandt 8 years ago committed by GitHub
parent
commit
284cadfe03
  1. 1
      framework/CHANGELOG.md
  2. 14
      framework/grid/ActionColumn.php

1
framework/CHANGELOG.md

@ -5,6 +5,7 @@ Yii Framework 2 Change Log
------------------------
- Bug #11502: Fixed `yii\console\controllers\MessageController` to properly populate missing languages in case of extraction with "db" format (bizley)
- Bug #13489: Fixed button names in ActionColumn to contain proper `Yii::t()` tags and restored missing translations for `ja` and `ru` (cebe, softark)
2.0.11 February 01, 2017

14
framework/grid/ActionColumn.php

@ -161,7 +161,19 @@ class ActionColumn extends Column
{
if (!isset($this->buttons[$name]) && strpos($this->template, '{' . $name . '}') !== false) {
$this->buttons[$name] = function ($url, $model, $key) use ($name, $iconName, $additionalOptions) {
$title = Yii::t('yii', ucfirst($name));
switch ($name) {
case 'view':
$title = Yii::t('yii', 'View');
break;
case 'update':
$title = Yii::t('yii', 'Update');
break;
case 'delete':
$title = Yii::t('yii', 'Delete');
break;
default:
$title = ucfirst($name);
}
$options = array_merge([
'title' => $title,
'aria-label' => $title,

Loading…
Cancel
Save