Set docblock for the setButtonName method, and don't invalidate localisation text.

This commit is contained in:
Ryan Potter 2019-07-01 10:32:19 +12:00 committed by Robbie Averill
parent 651d6c1da9
commit 14283d88b8
2 changed files with 3 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,5 +1,4 @@
/vendor/*
/.idea
.sass-cache/*
/node_modules/
**/*.js.map

View File

@ -152,7 +152,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
/**
* Set the button name
*
* @param $name
* @param $name string
* @return $this
*/
public function setButtonName($name)
@ -211,7 +211,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
if (!$this->buttonName) {
// provide a default button name, can be changed by calling {@link setButtonName()} on this component
$objectName = $obj->i18n_singular_name();
$this->buttonName = _t(__CLASS__ . '.ButtonName', 'Add {name}', array('name' => $objectName));
$this->buttonName = _t(__CLASS__ . '.ButtonName', '{name}', ['name' => $objectName]);
}
$addAction = GridField_FormAction::create(
@ -219,7 +219,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
'add',
_t(
__CLASS__ . '.Add',
'{name}',
'Add {name}',
'Add button text',
['name' => $this->buttonName]
),