浏览代码

Add translation name parameter to flash_create_error message

Mark Wilson 11 年之前
父节点
当前提交
08c17cdeba
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Controller/CRUDController.php

+ 1 - 1
Controller/CRUDController.php

@@ -529,7 +529,7 @@ class CRUDController extends Controller
             // show an error message if the form failed validation
             // show an error message if the form failed validation
             if (!$isFormValid) {
             if (!$isFormValid) {
                 if (!$this->isXmlHttpRequest()) {
                 if (!$this->isXmlHttpRequest()) {
-                    $this->addFlash('sonata_flash_error', 'flash_create_error');
+                    $this->addFlash('sonata_flash_error', $this->admin->trans('flash_create_error', array('%name%' => $this->admin->toString($object)), 'SonataAdminBundle'));
                 }
                 }
             } elseif ($this->isPreviewRequested()) {
             } elseif ($this->isPreviewRequested()) {
                 // pick the preview template if the form was valid and preview was requested
                 // pick the preview template if the form was valid and preview was requested