mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 06:37:55 +08:00 
			
		
		
		
	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
This commit is contained in:
		@ -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 #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
 | 
					2.0.11 February 01, 2017
 | 
				
			||||||
 | 
				
			|||||||
@ -161,7 +161,19 @@ class ActionColumn extends Column
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        if (!isset($this->buttons[$name]) && strpos($this->template, '{' . $name . '}') !== false) {
 | 
					        if (!isset($this->buttons[$name]) && strpos($this->template, '{' . $name . '}') !== false) {
 | 
				
			||||||
            $this->buttons[$name] = function ($url, $model, $key) use ($name, $iconName, $additionalOptions) {
 | 
					            $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([
 | 
					                $options = array_merge([
 | 
				
			||||||
                    'title' => $title,
 | 
					                    'title' => $title,
 | 
				
			||||||
                    'aria-label' => $title,
 | 
					                    'aria-label' => $title,
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user